From d5a6688a22ebaa2992e549f44c224fc8d0fc5cc7 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Fri, 10 Feb 2023 09:12:32 +1030 Subject: [PATCH 01/15] fix(eslint-plugin): [no-import-type-side-effects] correctly ignore zero-specifier imports (#6444) --- .../eslint-plugin/src/rules/no-import-type-side-effects.ts | 4 ++++ .../tests/rules/no-import-type-side-effects.test.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/packages/eslint-plugin/src/rules/no-import-type-side-effects.ts b/packages/eslint-plugin/src/rules/no-import-type-side-effects.ts index ce80a654afe5..941aa93e72ae 100644 --- a/packages/eslint-plugin/src/rules/no-import-type-side-effects.ts +++ b/packages/eslint-plugin/src/rules/no-import-type-side-effects.ts @@ -29,6 +29,10 @@ export default util.createRule({ 'ImportDeclaration[importKind!="type"]'( node: TSESTree.ImportDeclaration, ): void { + if (node.specifiers.length === 0) { + return; + } + const specifiers: TSESTree.ImportSpecifier[] = []; for (const specifier of node.specifiers) { if ( diff --git a/packages/eslint-plugin/tests/rules/no-import-type-side-effects.test.ts b/packages/eslint-plugin/tests/rules/no-import-type-side-effects.test.ts index 9dade06a9432..98d7923e4b45 100644 --- a/packages/eslint-plugin/tests/rules/no-import-type-side-effects.test.ts +++ b/packages/eslint-plugin/tests/rules/no-import-type-side-effects.test.ts @@ -18,6 +18,7 @@ ruleTester.run('no-import-type-side-effects', rule, { "import type T, { U } from 'mod';", "import T, { type U } from 'mod';", "import type * as T from 'mod';", + "import 'mod';", ], invalid: [ { From fb799e7a8aecc4b8f4a0c42b7d030fcad7162749 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 9 Feb 2023 21:32:54 -0500 Subject: [PATCH 02/15] chore: migrated `shared-fixtures` to `ast-spec` (#6436) * chore: migrated shared-fixtures to ast-spec * Removed shared-fixtures package * Updated snapshots * Corrected last snapshot * Updated typescript-estree test snapshots * Moved to legacy-fixtures dir, with a bit of docs * Revert "Moved to legacy-fixtures dir, with a bit of docs" This reverts commit 1323b6cf2da64ca7cd4321f06ccc5a466dae1f12. * rename unsorted-fixtures to legacy-fixtures --- .eslintignore | 1 - .prettierignore | 1 - .../fixture.ts | 8 + .../snapshots/1-TSESTree-AST.shot | 178 ++ .../snapshots/2-TSESTree-Tokens.shot | 206 ++ .../snapshots/3-Babel-AST.shot | 177 ++ .../snapshots/4-Babel-Tokens.shot | 206 ++ .../snapshots/5-AST-Alignment-AST.shot | 182 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 8 + .../snapshots/1-TSESTree-AST.shot | 212 ++ .../snapshots/2-TSESTree-Tokens.shot | 256 ++ .../snapshots/3-Babel-AST.shot | 211 ++ .../snapshots/4-Babel-Tokens.shot | 256 ++ .../snapshots/5-AST-Alignment-AST.shot | 216 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 8 + .../snapshots/1-TSESTree-AST.shot | 155 + .../snapshots/2-TSESTree-Tokens.shot | 176 ++ .../snapshots/3-Babel-AST.shot | 154 + .../snapshots/4-Babel-Tokens.shot | 176 ++ .../snapshots/5-AST-Alignment-AST.shot | 159 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 8 + .../snapshots/1-TSESTree-AST.shot | 186 ++ .../snapshots/2-TSESTree-Tokens.shot | 206 ++ .../snapshots/3-Babel-AST.shot | 185 ++ .../snapshots/4-Babel-Tokens.shot | 206 ++ .../snapshots/5-AST-Alignment-AST.shot | 190 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../type-parameter-whitespace-loc/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 81 + .../snapshots/2-TSESTree-Tokens.shot | 96 + .../snapshots/3-Babel-AST.shot | 70 + .../snapshots/4-Babel-Tokens.shot | 96 + .../snapshots/5-AST-Alignment-AST.shot | 86 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/type-parameters/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 99 + .../snapshots/2-TSESTree-Tokens.shot | 136 + .../snapshots/3-Babel-AST.shot | 88 + .../snapshots/4-Babel-Tokens.shot | 136 + .../snapshots/5-AST-Alignment-AST.shot | 104 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../_error_/abstract-interface/fixture.ts | 4 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../await-without-async-function/fixture.ts | 6 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 7 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 7 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 8 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 9 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 9 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../_error_/const-assertions/fixture.ts | 19 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../_error_/export-type-star-from/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../export-with-import-assertions/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../_error_/import-type-error/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../var-with-definite-assignment/fixture.ts | 5 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 99 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 98 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 108 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 147 + .../snapshots/2-TSESTree-Tokens.shot | 166 + .../snapshots/3-Babel-AST.shot | 146 + .../snapshots/4-Babel-Tokens.shot | 166 + .../snapshots/5-AST-Alignment-AST.shot | 156 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 6 + .../snapshots/1-TSESTree-AST.shot | 114 + .../snapshots/2-TSESTree-Tokens.shot | 136 + .../snapshots/3-Babel-AST.shot | 112 + .../snapshots/4-Babel-Tokens.shot | 136 + .../snapshots/5-AST-Alignment-AST.shot | 124 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 92 + .../snapshots/2-TSESTree-Tokens.shot | 126 + .../snapshots/3-Babel-AST.shot | 91 + .../snapshots/4-Babel-Tokens.shot | 126 + .../snapshots/5-AST-Alignment-AST.shot | 99 + .../snapshots/6-AST-Alignment-Tokens.shot | 132 + .../fixture.ts | 9 + .../snapshots/1-TSESTree-AST.shot | 262 ++ .../snapshots/2-TSESTree-Tokens.shot | 386 +++ .../snapshots/3-Babel-AST.shot | 261 ++ .../snapshots/4-Babel-Tokens.shot | 386 +++ .../snapshots/5-AST-Alignment-AST.shot | 278 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 394 +++ .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 148 + .../snapshots/2-TSESTree-Tokens.shot | 166 + .../snapshots/3-Babel-AST.shot | 146 + .../snapshots/4-Babel-Tokens.shot | 166 + .../snapshots/5-AST-Alignment-AST.shot | 154 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 95 + .../snapshots/2-TSESTree-Tokens.shot | 136 + .../snapshots/3-Babel-AST.shot | 95 + .../snapshots/4-Babel-Tokens.shot | 136 + .../snapshots/5-AST-Alignment-AST.shot | 104 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 120 + .../snapshots/2-TSESTree-Tokens.shot | 166 + .../snapshots/3-Babel-AST.shot | 120 + .../snapshots/4-Babel-Tokens.shot | 166 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../angle-bracket-type-assertion/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 76 + .../snapshots/2-TSESTree-Tokens.shot | 86 + .../snapshots/3-Babel-AST.shot | 76 + .../snapshots/4-Babel-Tokens.shot | 86 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 93 + .../snapshots/2-TSESTree-Tokens.shot | 136 + .../snapshots/3-Babel-AST.shot | 93 + .../snapshots/4-Babel-Tokens.shot | 136 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 168 + .../snapshots/2-TSESTree-Tokens.shot | 176 ++ .../snapshots/3-Babel-AST.shot | 157 + .../snapshots/4-Babel-Tokens.shot | 176 ++ .../snapshots/5-AST-Alignment-AST.shot | 173 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../async-function-expression/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 69 + .../snapshots/2-TSESTree-Tokens.shot | 126 + .../snapshots/3-Babel-AST.shot | 69 + .../snapshots/4-Babel-Tokens.shot | 126 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 7 + .../snapshots/1-TSESTree-AST.shot | 176 ++ .../snapshots/2-TSESTree-Tokens.shot | 226 ++ .../snapshots/3-Babel-AST.shot | 176 ++ .../snapshots/4-Babel-Tokens.shot | 226 ++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 232 ++ .../call-signatures-with-generics/fixture.ts | 6 + .../snapshots/1-TSESTree-AST.shot | 224 ++ .../snapshots/2-TSESTree-Tokens.shot | 296 ++ .../snapshots/3-Babel-AST.shot | 202 ++ .../snapshots/4-Babel-Tokens.shot | 296 ++ .../snapshots/5-AST-Alignment-AST.shot | 234 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/call-signatures/fixture.ts | 6 + .../snapshots/1-TSESTree-AST.shot | 160 + .../snapshots/2-TSESTree-Tokens.shot | 236 ++ .../snapshots/3-Babel-AST.shot | 160 + .../snapshots/4-Babel-Tokens.shot | 236 ++ .../snapshots/5-AST-Alignment-AST.shot | 168 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/cast-as-expression/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 73 + .../snapshots/2-TSESTree-Tokens.shot | 86 + .../snapshots/3-Babel-AST.shot | 73 + .../snapshots/4-Babel-Tokens.shot | 86 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/cast-as-multi-assign/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 92 + .../snapshots/2-TSESTree-Tokens.shot | 106 + .../snapshots/3-Babel-AST.shot | 92 + .../snapshots/4-Babel-Tokens.shot | 106 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../basics/fixtures/cast-as-multi/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 81 + .../snapshots/2-TSESTree-Tokens.shot | 66 + .../cast-as-multi/snapshots/3-Babel-AST.shot | 81 + .../snapshots/4-Babel-Tokens.shot | 66 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/cast-as-operator/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 74 + .../snapshots/2-TSESTree-Tokens.shot | 86 + .../snapshots/3-Babel-AST.shot | 74 + .../snapshots/4-Babel-Tokens.shot | 86 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../basics/fixtures/cast-as-simple/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 75 + .../snapshots/2-TSESTree-Tokens.shot | 76 + .../cast-as-simple/snapshots/3-Babel-AST.shot | 75 + .../snapshots/4-Babel-Tokens.shot | 76 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../catch-clause-with-annotation/fixture.ts | 7 + .../snapshots/1-TSESTree-AST.shot | 150 + .../snapshots/2-TSESTree-Tokens.shot | 226 ++ .../snapshots/3-Babel-AST.shot | 150 + .../snapshots/4-Babel-Tokens.shot | 226 ++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 4 + .../snapshots/1-TSESTree-AST.shot | 83 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 83 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 4 + .../snapshots/1-TSESTree-AST.shot | 65 + .../snapshots/2-TSESTree-Tokens.shot | 66 + .../snapshots/3-Babel-AST.shot | 65 + .../snapshots/4-Babel-Tokens.shot | 66 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 4 + .../snapshots/1-TSESTree-AST.shot | 65 + .../snapshots/2-TSESTree-Tokens.shot | 66 + .../snapshots/3-Babel-AST.shot | 65 + .../snapshots/4-Babel-Tokens.shot | 66 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 10 + .../snapshots/1-TSESTree-AST.shot | 249 ++ .../snapshots/2-TSESTree-Tokens.shot | 256 ++ .../snapshots/3-Babel-AST.shot | 244 ++ .../snapshots/4-Babel-Tokens.shot | 256 ++ .../snapshots/5-AST-Alignment-AST.shot | 253 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 269 ++ .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 90 + .../snapshots/2-TSESTree-Tokens.shot | 96 + .../snapshots/3-Babel-AST.shot | 88 + .../snapshots/4-Babel-Tokens.shot | 96 + .../snapshots/5-AST-Alignment-AST.shot | 94 + .../snapshots/6-AST-Alignment-Tokens.shot | 103 + .../fixtures/class-static-blocks/fixture.ts | 10 + .../snapshots/1-TSESTree-AST.shot | 164 + .../snapshots/2-TSESTree-Tokens.shot | 236 ++ .../snapshots/3-Babel-AST.shot | 162 + .../snapshots/4-Babel-Tokens.shot | 236 ++ .../snapshots/5-AST-Alignment-AST.shot | 168 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 12 + .../snapshots/1-TSESTree-AST.shot | 358 +++ .../snapshots/2-TSESTree-Tokens.shot | 416 +++ .../snapshots/3-Babel-AST.shot | 352 +++ .../snapshots/4-Babel-Tokens.shot | 416 +++ .../snapshots/5-AST-Alignment-AST.shot | 362 +++ .../snapshots/6-AST-Alignment-Tokens.shot | 428 +++ .../fixture.ts | 7 + .../snapshots/1-TSESTree-AST.shot | 144 + .../snapshots/2-TSESTree-Tokens.shot | 186 ++ .../snapshots/3-Babel-AST.shot | 142 + .../snapshots/4-Babel-Tokens.shot | 186 ++ .../snapshots/5-AST-Alignment-AST.shot | 148 + .../snapshots/6-AST-Alignment-Tokens.shot | 194 ++ .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 144 + .../snapshots/2-TSESTree-Tokens.shot | 176 ++ .../snapshots/3-Babel-AST.shot | 143 + .../snapshots/4-Babel-Tokens.shot | 176 ++ .../snapshots/5-AST-Alignment-AST.shot | 148 + .../snapshots/6-AST-Alignment-Tokens.shot | 182 ++ .../fixture.ts | 7 + .../snapshots/1-TSESTree-AST.shot | 172 + .../snapshots/2-TSESTree-Tokens.shot | 196 ++ .../snapshots/3-Babel-AST.shot | 171 + .../snapshots/4-Babel-Tokens.shot | 196 ++ .../snapshots/5-AST-Alignment-AST.shot | 176 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 7 + .../snapshots/1-TSESTree-AST.shot | 178 ++ .../snapshots/2-TSESTree-Tokens.shot | 206 ++ .../snapshots/3-Babel-AST.shot | 176 ++ .../snapshots/4-Babel-Tokens.shot | 206 ++ .../snapshots/5-AST-Alignment-AST.shot | 182 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../class-with-declare-properties/fixture.ts | 11 + .../snapshots/1-TSESTree-AST.shot | 348 +++ .../snapshots/2-TSESTree-Tokens.shot | 496 +++ .../snapshots/3-Babel-AST.shot | 341 ++ .../snapshots/4-Babel-Tokens.shot | 496 +++ .../snapshots/5-AST-Alignment-AST.shot | 352 +++ .../snapshots/6-AST-Alignment-Tokens.shot | 508 +++ .../class-with-definite-assignment/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 90 + .../snapshots/2-TSESTree-Tokens.shot | 96 + .../snapshots/3-Babel-AST.shot | 88 + .../snapshots/4-Babel-Tokens.shot | 96 + .../snapshots/5-AST-Alignment-AST.shot | 94 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 76 + .../snapshots/2-TSESTree-Tokens.shot | 86 + .../snapshots/3-Babel-AST.shot | 76 + .../snapshots/4-Babel-Tokens.shot | 86 + .../snapshots/5-AST-Alignment-AST.shot | 82 + .../snapshots/6-AST-Alignment-Tokens.shot | 92 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 155 + .../snapshots/2-TSESTree-Tokens.shot | 166 + .../snapshots/3-Babel-AST.shot | 144 + .../snapshots/4-Babel-Tokens.shot | 166 + .../snapshots/5-AST-Alignment-AST.shot | 160 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../class-with-extends-generic/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 117 + .../snapshots/2-TSESTree-Tokens.shot | 126 + .../snapshots/3-Babel-AST.shot | 106 + .../snapshots/4-Babel-Tokens.shot | 126 + .../snapshots/5-AST-Alignment-AST.shot | 122 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 145 + .../snapshots/2-TSESTree-Tokens.shot | 146 + .../snapshots/3-Babel-AST.shot | 133 + .../snapshots/4-Babel-Tokens.shot | 146 + .../snapshots/5-AST-Alignment-AST.shot | 152 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../class-with-generic-method/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 126 + .../snapshots/2-TSESTree-Tokens.shot | 126 + .../snapshots/3-Babel-AST.shot | 114 + .../snapshots/4-Babel-Tokens.shot | 126 + .../snapshots/5-AST-Alignment-AST.shot | 133 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 116 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 116 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 122 + .../snapshots/6-AST-Alignment-Tokens.shot | 122 + .../class-with-implements-generic/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 97 + .../snapshots/2-TSESTree-Tokens.shot | 96 + .../snapshots/3-Babel-AST.shot | 97 + .../snapshots/4-Babel-Tokens.shot | 96 + .../snapshots/5-AST-Alignment-AST.shot | 103 + .../snapshots/6-AST-Alignment-Tokens.shot | 102 + .../fixtures/class-with-implements/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 67 + .../snapshots/2-TSESTree-Tokens.shot | 66 + .../snapshots/3-Babel-AST.shot | 67 + .../snapshots/4-Babel-Tokens.shot | 66 + .../snapshots/5-AST-Alignment-AST.shot | 73 + .../snapshots/6-AST-Alignment-Tokens.shot | 72 + .../fixtures/class-with-method/fixture.ts | 7 + .../snapshots/1-TSESTree-AST.shot | 238 ++ .../snapshots/2-TSESTree-Tokens.shot | 246 ++ .../snapshots/3-Babel-AST.shot | 224 ++ .../snapshots/4-Babel-Tokens.shot | 246 ++ .../snapshots/5-AST-Alignment-AST.shot | 245 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../class-with-mixin-reference/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 169 + .../snapshots/2-TSESTree-Tokens.shot | 176 ++ .../snapshots/3-Babel-AST.shot | 158 + .../snapshots/4-Babel-Tokens.shot | 176 ++ .../snapshots/5-AST-Alignment-AST.shot | 174 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/class-with-mixin/fixture.ts | 11 + .../snapshots/1-TSESTree-AST.shot | 498 +++ .../snapshots/2-TSESTree-Tokens.shot | 656 ++++ .../snapshots/3-Babel-AST.shot | 476 +++ .../snapshots/4-Babel-Tokens.shot | 656 ++++ .../snapshots/5-AST-Alignment-AST.shot | 508 +++ .../snapshots/6-AST-Alignment-Tokens.shot | 664 ++++ .../fixture.ts | 19 + .../snapshots/1-TSESTree-AST.shot | 694 +++++ .../snapshots/2-TSESTree-Tokens.shot | 1026 ++++++ .../snapshots/3-Babel-AST.shot | 681 ++++ .../snapshots/4-Babel-Tokens.shot | 1026 ++++++ .../snapshots/5-AST-Alignment-AST.shot | 706 +++++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 83 + .../snapshots/2-TSESTree-Tokens.shot | 126 + .../snapshots/3-Babel-AST.shot | 81 + .../snapshots/4-Babel-Tokens.shot | 126 + .../snapshots/5-AST-Alignment-AST.shot | 87 + .../snapshots/6-AST-Alignment-Tokens.shot | 132 + .../class-with-optional-methods/fixture.ts | 7 + .../snapshots/1-TSESTree-AST.shot | 201 ++ .../snapshots/2-TSESTree-Tokens.shot | 246 ++ .../snapshots/3-Babel-AST.shot | 195 ++ .../snapshots/4-Babel-Tokens.shot | 246 ++ .../snapshots/5-AST-Alignment-AST.shot | 211 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 252 ++ .../class-with-optional-properties/fixture.ts | 15 + .../snapshots/1-TSESTree-AST.shot | 451 +++ .../snapshots/2-TSESTree-Tokens.shot | 646 ++++ .../snapshots/3-Babel-AST.shot | 433 +++ .../snapshots/4-Babel-Tokens.shot | 646 ++++ .../snapshots/5-AST-Alignment-AST.shot | 455 +++ .../snapshots/6-AST-Alignment-Tokens.shot | 652 ++++ .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 82 + .../snapshots/2-TSESTree-Tokens.shot | 106 + .../snapshots/3-Babel-AST.shot | 80 + .../snapshots/4-Babel-Tokens.shot | 106 + .../snapshots/5-AST-Alignment-AST.shot | 86 + .../snapshots/6-AST-Alignment-Tokens.shot | 112 + .../class-with-override-method/fixture.ts | 7 + .../snapshots/1-TSESTree-AST.shot | 103 + .../snapshots/2-TSESTree-Tokens.shot | 126 + .../snapshots/3-Babel-AST.shot | 103 + .../snapshots/4-Babel-Tokens.shot | 126 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../class-with-override-property/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 90 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 89 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 94 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 7 + .../snapshots/1-TSESTree-AST.shot | 178 ++ .../snapshots/2-TSESTree-Tokens.shot | 216 ++ .../snapshots/3-Babel-AST.shot | 172 + .../snapshots/4-Babel-Tokens.shot | 216 ++ .../snapshots/5-AST-Alignment-AST.shot | 182 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 229 ++ .../fixture.ts | 10 + .../snapshots/1-TSESTree-AST.shot | 289 ++ .../snapshots/2-TSESTree-Tokens.shot | 356 +++ .../snapshots/3-Babel-AST.shot | 288 ++ .../snapshots/4-Babel-Tokens.shot | 356 +++ .../snapshots/5-AST-Alignment-AST.shot | 293 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 368 +++ .../class-with-property-function/fixture.ts | 6 + .../snapshots/1-TSESTree-AST.shot | 215 ++ .../snapshots/2-TSESTree-Tokens.shot | 276 ++ .../snapshots/3-Babel-AST.shot | 211 ++ .../snapshots/4-Babel-Tokens.shot | 276 ++ .../snapshots/5-AST-Alignment-AST.shot | 221 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../class-with-property-values/fixture.ts | 9 + .../snapshots/1-TSESTree-AST.shot | 267 ++ .../snapshots/2-TSESTree-Tokens.shot | 386 +++ .../snapshots/3-Babel-AST.shot | 257 ++ .../snapshots/4-Babel-Tokens.shot | 386 +++ .../snapshots/5-AST-Alignment-AST.shot | 271 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 10 + .../snapshots/1-TSESTree-AST.shot | 289 ++ .../snapshots/2-TSESTree-Tokens.shot | 356 +++ .../snapshots/3-Babel-AST.shot | 288 ++ .../snapshots/4-Babel-Tokens.shot | 356 +++ .../snapshots/5-AST-Alignment-AST.shot | 293 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 368 +++ .../fixture.ts | 10 + .../snapshots/1-TSESTree-AST.shot | 289 ++ .../snapshots/2-TSESTree-Tokens.shot | 356 +++ .../snapshots/3-Babel-AST.shot | 288 ++ .../snapshots/4-Babel-Tokens.shot | 356 +++ .../snapshots/5-AST-Alignment-AST.shot | 293 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 368 +++ .../fixture.ts | 8 + .../snapshots/1-TSESTree-AST.shot | 191 ++ .../snapshots/2-TSESTree-Tokens.shot | 216 ++ .../snapshots/3-Babel-AST.shot | 190 ++ .../snapshots/4-Babel-Tokens.shot | 216 ++ .../snapshots/5-AST-Alignment-AST.shot | 195 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../class-with-readonly-property/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 83 + .../snapshots/2-TSESTree-Tokens.shot | 106 + .../snapshots/3-Babel-AST.shot | 81 + .../snapshots/4-Babel-Tokens.shot | 106 + .../snapshots/5-AST-Alignment-AST.shot | 87 + .../snapshots/6-AST-Alignment-Tokens.shot | 112 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 97 + .../snapshots/2-TSESTree-Tokens.shot | 96 + .../snapshots/3-Babel-AST.shot | 86 + .../snapshots/4-Babel-Tokens.shot | 96 + .../snapshots/5-AST-Alignment-AST.shot | 102 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 78 + .../snapshots/2-TSESTree-Tokens.shot | 76 + .../snapshots/3-Babel-AST.shot | 67 + .../snapshots/4-Babel-Tokens.shot | 76 + .../snapshots/5-AST-Alignment-AST.shot | 83 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../class-with-type-parameter/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 78 + .../snapshots/2-TSESTree-Tokens.shot | 76 + .../snapshots/3-Babel-AST.shot | 67 + .../snapshots/4-Babel-Tokens.shot | 76 + .../snapshots/5-AST-Alignment-AST.shot | 83 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../basics/fixtures/const-enum/fixture.ts | 6 + .../const-enum/snapshots/1-TSESTree-AST.shot | 87 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../const-enum/snapshots/3-Babel-AST.shot | 87 + .../const-enum/snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 122 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 105 + .../snapshots/2-TSESTree-Tokens.shot | 126 + .../snapshots/3-Babel-AST.shot | 103 + .../snapshots/4-Babel-Tokens.shot | 126 + .../snapshots/5-AST-Alignment-AST.shot | 111 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/declare-function/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 87 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 87 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 546 ++++ .../snapshots/2-TSESTree-Tokens.shot | 726 +++++ .../snapshots/3-Babel-AST.shot | 546 ++++ .../snapshots/4-Babel-Tokens.shot | 726 +++++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 108 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 108 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 132 + .../snapshots/2-TSESTree-Tokens.shot | 146 + .../snapshots/3-Babel-AST.shot | 132 + .../snapshots/4-Babel-Tokens.shot | 146 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../destructuring-assignment/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 108 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 108 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/directive-in-module/fixture.ts | 7 + .../snapshots/1-TSESTree-AST.shot | 129 + .../snapshots/2-TSESTree-Tokens.shot | 136 + .../snapshots/3-Babel-AST.shot | 128 + .../snapshots/4-Babel-Tokens.shot | 136 + .../snapshots/5-AST-Alignment-AST.shot | 133 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../directive-in-namespace/fixture.ts | 7 + .../snapshots/1-TSESTree-AST.shot | 129 + .../snapshots/2-TSESTree-Tokens.shot | 136 + .../snapshots/3-Babel-AST.shot | 128 + .../snapshots/4-Babel-Tokens.shot | 136 + .../snapshots/5-AST-Alignment-AST.shot | 133 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 124 + .../snapshots/2-TSESTree-Tokens.shot | 156 + .../snapshots/3-Babel-AST.shot | 124 + .../snapshots/4-Babel-Tokens.shot | 156 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 70 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 70 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/export-as-namespace/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 35 + .../snapshots/2-TSESTree-Tokens.shot | 56 + .../snapshots/3-Babel-AST.shot | 35 + .../snapshots/4-Babel-Tokens.shot | 56 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/export-assignment/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 35 + .../snapshots/2-TSESTree-Tokens.shot | 46 + .../snapshots/3-Babel-AST.shot | 35 + .../snapshots/4-Babel-Tokens.shot | 46 + .../snapshots/5-AST-Alignment-AST.shot | 40 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 6 + .../snapshots/1-TSESTree-AST.shot | 101 + .../snapshots/2-TSESTree-Tokens.shot | 136 + .../snapshots/3-Babel-AST.shot | 101 + .../snapshots/4-Babel-Tokens.shot | 136 + .../snapshots/5-AST-Alignment-AST.shot | 106 + .../snapshots/6-AST-Alignment-Tokens.shot | 142 + .../export-declare-named-enum/fixture.ts | 6 + .../snapshots/1-TSESTree-AST.shot | 100 + .../snapshots/2-TSESTree-Tokens.shot | 126 + .../snapshots/3-Babel-AST.shot | 100 + .../snapshots/4-Babel-Tokens.shot | 126 + .../snapshots/5-AST-Alignment-AST.shot | 105 + .../snapshots/6-AST-Alignment-Tokens.shot | 132 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 79 + .../snapshots/2-TSESTree-Tokens.shot | 86 + .../snapshots/3-Babel-AST.shot | 68 + .../snapshots/4-Babel-Tokens.shot | 86 + .../snapshots/5-AST-Alignment-AST.shot | 84 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 100 + .../snapshots/2-TSESTree-Tokens.shot | 106 + .../snapshots/3-Babel-AST.shot | 78 + .../snapshots/4-Babel-Tokens.shot | 106 + .../snapshots/5-AST-Alignment-AST.shot | 106 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../export-default-interface/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 96 + .../snapshots/2-TSESTree-Tokens.shot | 126 + .../snapshots/3-Babel-AST.shot | 96 + .../snapshots/4-Babel-Tokens.shot | 126 + .../snapshots/5-AST-Alignment-AST.shot | 102 + .../snapshots/6-AST-Alignment-Tokens.shot | 132 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 91 + .../snapshots/2-TSESTree-Tokens.shot | 86 + .../snapshots/3-Babel-AST.shot | 80 + .../snapshots/4-Babel-Tokens.shot | 86 + .../snapshots/5-AST-Alignment-AST.shot | 96 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 112 + .../snapshots/2-TSESTree-Tokens.shot | 106 + .../snapshots/3-Babel-AST.shot | 90 + .../snapshots/4-Babel-Tokens.shot | 106 + .../snapshots/5-AST-Alignment-AST.shot | 118 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/export-named-enum/fixture.ts | 6 + .../snapshots/1-TSESTree-AST.shot | 99 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 99 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 122 + .../export-star-as-ns-from/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 48 + .../snapshots/2-TSESTree-Tokens.shot | 76 + .../snapshots/3-Babel-AST.shot | 48 + .../snapshots/4-Babel-Tokens.shot | 76 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../basics/fixtures/export-type-as/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 61 + .../snapshots/2-TSESTree-Tokens.shot | 86 + .../export-type-as/snapshots/3-Babel-AST.shot | 61 + .../snapshots/4-Babel-Tokens.shot | 86 + .../snapshots/5-AST-Alignment-AST.shot | 66 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/export-type-from-as/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 71 + .../snapshots/2-TSESTree-Tokens.shot | 106 + .../snapshots/3-Babel-AST.shot | 71 + .../snapshots/4-Babel-Tokens.shot | 106 + .../snapshots/5-AST-Alignment-AST.shot | 76 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/export-type-from/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 71 + .../snapshots/2-TSESTree-Tokens.shot | 86 + .../snapshots/3-Babel-AST.shot | 71 + .../snapshots/4-Babel-Tokens.shot | 86 + .../snapshots/5-AST-Alignment-AST.shot | 76 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../basics/fixtures/export-type/fixture.ts | 3 + .../export-type/snapshots/1-TSESTree-AST.shot | 61 + .../snapshots/2-TSESTree-Tokens.shot | 66 + .../export-type/snapshots/3-Babel-AST.shot | 61 + .../export-type/snapshots/4-Babel-Tokens.shot | 66 + .../snapshots/5-AST-Alignment-AST.shot | 66 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 152 + .../snapshots/2-TSESTree-Tokens.shot | 186 ++ .../snapshots/3-Babel-AST.shot | 141 + .../snapshots/4-Babel-Tokens.shot | 186 ++ .../snapshots/5-AST-Alignment-AST.shot | 157 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 89 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 89 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/function-overloads/fixture.ts | 7 + .../snapshots/1-TSESTree-AST.shot | 335 ++ .../snapshots/2-TSESTree-Tokens.shot | 416 +++ .../snapshots/3-Babel-AST.shot | 335 ++ .../snapshots/4-Babel-Tokens.shot | 416 +++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/function-with-await/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 89 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 89 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 207 ++ .../snapshots/2-TSESTree-Tokens.shot | 216 ++ .../snapshots/3-Babel-AST.shot | 207 ++ .../snapshots/4-Babel-Tokens.shot | 216 ++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 205 ++ .../snapshots/2-TSESTree-Tokens.shot | 196 ++ .../snapshots/3-Babel-AST.shot | 205 ++ .../snapshots/4-Babel-Tokens.shot | 196 ++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 81 + .../snapshots/2-TSESTree-Tokens.shot | 96 + .../snapshots/3-Babel-AST.shot | 70 + .../snapshots/4-Babel-Tokens.shot | 96 + .../snapshots/5-AST-Alignment-AST.shot | 86 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 178 ++ .../snapshots/2-TSESTree-Tokens.shot | 206 ++ .../snapshots/3-Babel-AST.shot | 167 + .../snapshots/4-Babel-Tokens.shot | 206 ++ .../snapshots/5-AST-Alignment-AST.shot | 183 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../function-with-type-parameters/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 168 + .../snapshots/2-TSESTree-Tokens.shot | 176 ++ .../snapshots/3-Babel-AST.shot | 157 + .../snapshots/4-Babel-Tokens.shot | 176 ++ .../snapshots/5-AST-Alignment-AST.shot | 173 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 9 + .../snapshots/1-TSESTree-AST.shot | 231 ++ .../snapshots/2-TSESTree-Tokens.shot | 286 ++ .../snapshots/3-Babel-AST.shot | 231 ++ .../snapshots/4-Babel-Tokens.shot | 286 ++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/function-with-types/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 116 + .../snapshots/2-TSESTree-Tokens.shot | 146 + .../snapshots/3-Babel-AST.shot | 116 + .../snapshots/4-Babel-Tokens.shot | 146 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../basics/fixtures/global-this/fixture.ts | 13 + .../global-this/snapshots/1-TSESTree-AST.shot | 222 ++ .../snapshots/2-TSESTree-Tokens.shot | 226 ++ .../global-this/snapshots/3-Babel-AST.shot | 222 ++ .../global-this/snapshots/4-Babel-Tokens.shot | 226 ++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 232 ++ .../import-equal-declaration/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 57 + .../snapshots/2-TSESTree-Tokens.shot | 86 + .../snapshots/3-Babel-AST.shot | 57 + .../snapshots/4-Babel-Tokens.shot | 86 + .../snapshots/5-AST-Alignment-AST.shot | 62 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../import-equal-type-declaration/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 57 + .../snapshots/2-TSESTree-Tokens.shot | 96 + .../snapshots/3-Babel-AST.shot | 57 + .../snapshots/4-Babel-Tokens.shot | 96 + .../snapshots/5-AST-Alignment-AST.shot | 62 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 57 + .../snapshots/2-TSESTree-Tokens.shot | 96 + .../snapshots/3-Babel-AST.shot | 57 + .../snapshots/4-Babel-Tokens.shot | 96 + .../snapshots/5-AST-Alignment-AST.shot | 62 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 57 + .../snapshots/2-TSESTree-Tokens.shot | 106 + .../snapshots/3-Babel-AST.shot | 57 + .../snapshots/4-Babel-Tokens.shot | 106 + .../snapshots/5-AST-Alignment-AST.shot | 62 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/import-type-default/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 59 + .../snapshots/2-TSESTree-Tokens.shot | 66 + .../snapshots/3-Babel-AST.shot | 59 + .../snapshots/4-Babel-Tokens.shot | 66 + .../snapshots/5-AST-Alignment-AST.shot | 64 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/import-type-empty/fixture.ts | 4 + .../snapshots/1-TSESTree-AST.shot | 59 + .../snapshots/2-TSESTree-Tokens.shot | 56 + .../snapshots/3-Babel-AST.shot | 59 + .../snapshots/4-Babel-Tokens.shot | 56 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/import-type-named-as/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 70 + .../snapshots/2-TSESTree-Tokens.shot | 106 + .../snapshots/3-Babel-AST.shot | 70 + .../snapshots/4-Babel-Tokens.shot | 106 + .../snapshots/5-AST-Alignment-AST.shot | 75 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/import-type-named/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 100 + .../snapshots/2-TSESTree-Tokens.shot | 106 + .../snapshots/3-Babel-AST.shot | 100 + .../snapshots/4-Babel-Tokens.shot | 106 + .../snapshots/5-AST-Alignment-AST.shot | 105 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../import-type-star-as-ns/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 59 + .../snapshots/2-TSESTree-Tokens.shot | 86 + .../snapshots/3-Babel-AST.shot | 59 + .../snapshots/4-Babel-Tokens.shot | 86 + .../snapshots/5-AST-Alignment-AST.shot | 64 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../import-with-import-assertions/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 90 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 90 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../interface-extends-multiple/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 85 + .../snapshots/2-TSESTree-Tokens.shot | 86 + .../snapshots/3-Babel-AST.shot | 85 + .../snapshots/4-Babel-Tokens.shot | 86 + .../snapshots/5-AST-Alignment-AST.shot | 93 + .../snapshots/6-AST-Alignment-Tokens.shot | 92 + .../fixtures/interface-extends/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 66 + .../snapshots/2-TSESTree-Tokens.shot | 66 + .../snapshots/3-Babel-AST.shot | 66 + .../snapshots/4-Babel-Tokens.shot | 66 + .../snapshots/5-AST-Alignment-AST.shot | 72 + .../snapshots/6-AST-Alignment-Tokens.shot | 72 + .../interface-type-parameters/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 77 + .../snapshots/2-TSESTree-Tokens.shot | 76 + .../snapshots/3-Babel-AST.shot | 66 + .../snapshots/4-Babel-Tokens.shot | 76 + .../snapshots/5-AST-Alignment-AST.shot | 82 + .../snapshots/6-AST-Alignment-Tokens.shot | 82 + .../fixture.ts | 15 + .../snapshots/1-TSESTree-AST.shot | 676 ++++ .../snapshots/2-TSESTree-Tokens.shot | 1036 ++++++ .../snapshots/3-Babel-AST.shot | 654 ++++ .../snapshots/4-Babel-Tokens.shot | 1036 ++++++ .../snapshots/5-AST-Alignment-AST.shot | 694 +++++ .../snapshots/6-AST-Alignment-Tokens.shot | 1042 +++++++ .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 87 + .../snapshots/2-TSESTree-Tokens.shot | 86 + .../snapshots/3-Babel-AST.shot | 85 + .../snapshots/4-Babel-Tokens.shot | 86 + .../snapshots/5-AST-Alignment-AST.shot | 97 + .../snapshots/6-AST-Alignment-Tokens.shot | 92 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 128 + .../snapshots/2-TSESTree-Tokens.shot | 126 + .../snapshots/3-Babel-AST.shot | 117 + .../snapshots/4-Babel-Tokens.shot | 126 + .../snapshots/5-AST-Alignment-AST.shot | 135 + .../snapshots/6-AST-Alignment-Tokens.shot | 132 + .../interface-with-generic/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 77 + .../snapshots/2-TSESTree-Tokens.shot | 76 + .../snapshots/3-Babel-AST.shot | 66 + .../snapshots/4-Babel-Tokens.shot | 76 + .../snapshots/5-AST-Alignment-AST.shot | 82 + .../snapshots/6-AST-Alignment-Tokens.shot | 82 + .../fixtures/interface-with-jsdoc/fixture.ts | 9 + .../snapshots/1-TSESTree-AST.shot | 79 + .../snapshots/2-TSESTree-Tokens.shot | 96 + .../snapshots/3-Babel-AST.shot | 79 + .../snapshots/4-Babel-Tokens.shot | 96 + .../snapshots/5-AST-Alignment-AST.shot | 84 + .../snapshots/6-AST-Alignment-Tokens.shot | 102 + .../fixtures/interface-with-method/fixture.ts | 6 + .../snapshots/1-TSESTree-AST.shot | 236 ++ .../snapshots/2-TSESTree-Tokens.shot | 256 ++ .../snapshots/3-Babel-AST.shot | 225 ++ .../snapshots/4-Babel-Tokens.shot | 256 ++ .../snapshots/5-AST-Alignment-AST.shot | 245 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 262 ++ .../fixture.ts | 7 + .../snapshots/1-TSESTree-AST.shot | 180 ++ .../snapshots/2-TSESTree-Tokens.shot | 266 ++ .../snapshots/3-Babel-AST.shot | 180 ++ .../snapshots/4-Babel-Tokens.shot | 266 ++ .../snapshots/5-AST-Alignment-AST.shot | 185 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 272 ++ .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 66 + .../snapshots/2-TSESTree-Tokens.shot | 66 + .../snapshots/3-Babel-AST.shot | 66 + .../snapshots/4-Babel-Tokens.shot | 66 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 72 + .../fixtures/intrinsic-keyword/fixture.ts | 6 + .../snapshots/1-TSESTree-AST.shot | 292 ++ .../snapshots/2-TSESTree-Tokens.shot | 406 +++ .../snapshots/3-Babel-AST.shot | 248 ++ .../snapshots/4-Babel-Tokens.shot | 406 +++ .../snapshots/5-AST-Alignment-AST.shot | 300 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../basics/fixtures/keyof-operator/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 64 + .../snapshots/2-TSESTree-Tokens.shot | 66 + .../keyof-operator/snapshots/3-Babel-AST.shot | 64 + .../snapshots/4-Babel-Tokens.shot | 66 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/keyword-variables/fixture.ts | 79 + .../snapshots/1-TSESTree-AST.shot | 2598 ++++++++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 2656 ++++++++++++++++ .../snapshots/3-Babel-AST.shot | 2594 +++++++++++++++ .../snapshots/4-Babel-Tokens.shot | 2656 ++++++++++++++++ .../snapshots/5-AST-Alignment-AST.shot | 2605 ++++++++++++++++ .../snapshots/6-AST-Alignment-Tokens.shot | 2674 ++++++++++++++++ .../fixtures/nested-type-arguments/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 156 + .../snapshots/2-TSESTree-Tokens.shot | 146 + .../snapshots/3-Babel-AST.shot | 156 + .../snapshots/4-Babel-Tokens.shot | 146 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/never-type-param/fixture.ts | 4 + .../snapshots/1-TSESTree-AST.shot | 167 + .../snapshots/2-TSESTree-Tokens.shot | 176 ++ .../snapshots/3-Babel-AST.shot | 167 + .../snapshots/4-Babel-Tokens.shot | 176 ++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../non-null-assertion-operator/fixture.ts | 6 + .../snapshots/1-TSESTree-AST.shot | 202 ++ .../snapshots/2-TSESTree-Tokens.shot | 236 ++ .../snapshots/3-Babel-AST.shot | 202 ++ .../snapshots/4-Babel-Tokens.shot | 236 ++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 242 ++ .../fixture.ts | 4 + .../snapshots/1-TSESTree-AST.shot | 116 + .../snapshots/2-TSESTree-Tokens.shot | 106 + .../snapshots/3-Babel-AST.shot | 116 + .../snapshots/4-Babel-Tokens.shot | 106 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 116 + .../fixtures/nullish-coalescing/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 142 + .../snapshots/2-TSESTree-Tokens.shot | 176 ++ .../snapshots/3-Babel-AST.shot | 142 + .../snapshots/4-Babel-Tokens.shot | 176 ++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 182 ++ .../object-with-escaped-properties/fixture.ts | 11 + .../snapshots/1-TSESTree-AST.shot | 258 ++ .../snapshots/2-TSESTree-Tokens.shot | 366 +++ .../snapshots/3-Babel-AST.shot | 256 ++ .../snapshots/4-Babel-Tokens.shot | 366 +++ .../snapshots/5-AST-Alignment-AST.shot | 262 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 376 +++ .../object-with-typed-methods/fixture.ts | 14 + .../snapshots/1-TSESTree-AST.shot | 474 +++ .../snapshots/2-TSESTree-Tokens.shot | 586 ++++ .../snapshots/3-Babel-AST.shot | 452 +++ .../snapshots/4-Babel-Tokens.shot | 586 ++++ .../snapshots/5-AST-Alignment-AST.shot | 524 ++++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 10 + .../snapshots/1-TSESTree-AST.shot | 557 ++++ .../snapshots/2-TSESTree-Tokens.shot | 586 ++++ .../snapshots/3-Babel-AST.shot | 557 ++++ .../snapshots/4-Babel-Tokens.shot | 586 ++++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 15 + .../snapshots/1-TSESTree-AST.shot | 705 +++++ .../snapshots/2-TSESTree-Tokens.shot | 876 ++++++ .../snapshots/3-Babel-AST.shot | 705 +++++ .../snapshots/4-Babel-Tokens.shot | 876 ++++++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/optional-chain-call/fixture.ts | 15 + .../snapshots/1-TSESTree-AST.shot | 705 +++++ .../snapshots/2-TSESTree-Tokens.shot | 796 +++++ .../snapshots/3-Babel-AST.shot | 705 +++++ .../snapshots/4-Babel-Tokens.shot | 796 +++++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 10 + .../snapshots/1-TSESTree-AST.shot | 560 ++++ .../snapshots/2-TSESTree-Tokens.shot | 696 +++++ .../snapshots/3-Babel-AST.shot | 560 ++++ .../snapshots/4-Babel-Tokens.shot | 696 +++++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 10 + .../snapshots/1-TSESTree-AST.shot | 578 ++++ .../snapshots/2-TSESTree-Tokens.shot | 816 +++++ .../snapshots/3-Babel-AST.shot | 578 ++++ .../snapshots/4-Babel-Tokens.shot | 816 +++++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../optional-chain-element-access/fixture.ts | 10 + .../snapshots/1-TSESTree-AST.shot | 534 ++++ .../snapshots/2-TSESTree-Tokens.shot | 686 ++++ .../snapshots/3-Babel-AST.shot | 534 ++++ .../snapshots/4-Babel-Tokens.shot | 686 ++++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 7 + .../snapshots/1-TSESTree-AST.shot | 317 ++ .../snapshots/2-TSESTree-Tokens.shot | 356 +++ .../snapshots/3-Babel-AST.shot | 317 ++ .../snapshots/4-Babel-Tokens.shot | 356 +++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../optional-chain-with-parens/fixture.ts | 10 + .../snapshots/1-TSESTree-AST.shot | 563 ++++ .../snapshots/2-TSESTree-Tokens.shot | 586 ++++ .../snapshots/3-Babel-AST.shot | 563 ++++ .../snapshots/4-Babel-Tokens.shot | 586 ++++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../basics/fixtures/optional-chain/fixture.ts | 9 + .../snapshots/1-TSESTree-AST.shot | 451 +++ .../snapshots/2-TSESTree-Tokens.shot | 426 +++ .../optional-chain/snapshots/3-Babel-AST.shot | 451 +++ .../snapshots/4-Babel-Tokens.shot | 426 +++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../parenthesized-use-strict/fixture.ts | 4 + .../snapshots/1-TSESTree-AST.shot | 36 + .../snapshots/2-TSESTree-Tokens.shot | 46 + .../snapshots/3-Babel-AST.shot | 36 + .../snapshots/4-Babel-Tokens.shot | 46 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/private-fields-in-in/fixture.ts | 8 + .../snapshots/1-TSESTree-AST.shot | 169 + .../snapshots/2-TSESTree-Tokens.shot | 176 ++ .../snapshots/3-Babel-AST.shot | 166 + .../snapshots/4-Babel-Tokens.shot | 176 ++ .../snapshots/5-AST-Alignment-AST.shot | 173 + .../snapshots/6-AST-Alignment-Tokens.shot | 186 ++ .../fixtures/readonly-arrays/fixture.ts | 11 + .../snapshots/1-TSESTree-AST.shot | 419 +++ .../snapshots/2-TSESTree-Tokens.shot | 506 +++ .../snapshots/3-Babel-AST.shot | 419 +++ .../snapshots/4-Babel-Tokens.shot | 506 +++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/readonly-tuples/fixture.ts | 6 + .../snapshots/1-TSESTree-AST.shot | 255 ++ .../snapshots/2-TSESTree-Tokens.shot | 316 ++ .../snapshots/3-Babel-AST.shot | 255 ++ .../snapshots/4-Babel-Tokens.shot | 316 ++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 55 + .../snapshots/2-TSESTree-Tokens.shot | 46 + .../snapshots/3-Babel-AST.shot | 55 + .../snapshots/4-Babel-Tokens.shot | 46 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 55 + .../snapshots/2-TSESTree-Tokens.shot | 46 + .../snapshots/3-Babel-AST.shot | 55 + .../snapshots/4-Babel-Tokens.shot | 46 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 55 + .../snapshots/2-TSESTree-Tokens.shot | 46 + .../snapshots/3-Babel-AST.shot | 55 + .../snapshots/4-Babel-Tokens.shot | 46 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/symbol-type-param/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 117 + .../snapshots/2-TSESTree-Tokens.shot | 146 + .../snapshots/3-Babel-AST.shot | 117 + .../snapshots/4-Babel-Tokens.shot | 146 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 105 + .../snapshots/2-TSESTree-Tokens.shot | 126 + .../snapshots/3-Babel-AST.shot | 105 + .../snapshots/4-Babel-Tokens.shot | 126 + .../snapshots/5-AST-Alignment-AST.shot | 112 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 97 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 97 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 102 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../type-alias-declaration-export/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 77 + .../snapshots/2-TSESTree-Tokens.shot | 86 + .../snapshots/3-Babel-AST.shot | 77 + .../snapshots/4-Babel-Tokens.shot | 86 + .../snapshots/5-AST-Alignment-AST.shot | 82 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 156 + .../snapshots/2-TSESTree-Tokens.shot | 166 + .../snapshots/3-Babel-AST.shot | 145 + .../snapshots/4-Babel-Tokens.shot | 166 + .../snapshots/5-AST-Alignment-AST.shot | 161 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../type-alias-declaration/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 146 + .../snapshots/2-TSESTree-Tokens.shot | 136 + .../snapshots/3-Babel-AST.shot | 135 + .../snapshots/4-Babel-Tokens.shot | 136 + .../snapshots/5-AST-Alignment-AST.shot | 151 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 104 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 104 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 141 + .../snapshots/2-TSESTree-Tokens.shot | 176 ++ .../snapshots/3-Babel-AST.shot | 141 + .../snapshots/4-Babel-Tokens.shot | 176 ++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../type-assertion-in-function/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 119 + .../snapshots/2-TSESTree-Tokens.shot | 146 + .../snapshots/3-Babel-AST.shot | 119 + .../snapshots/4-Babel-Tokens.shot | 146 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../type-assertion-in-interface/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 127 + .../snapshots/2-TSESTree-Tokens.shot | 146 + .../snapshots/3-Babel-AST.shot | 127 + .../snapshots/4-Babel-Tokens.shot | 146 + .../snapshots/5-AST-Alignment-AST.shot | 133 + .../snapshots/6-AST-Alignment-Tokens.shot | 152 + .../type-assertion-in-method/fixture.ts | 10 + .../snapshots/1-TSESTree-AST.shot | 221 ++ .../snapshots/2-TSESTree-Tokens.shot | 276 ++ .../snapshots/3-Babel-AST.shot | 218 ++ .../snapshots/4-Babel-Tokens.shot | 276 ++ .../snapshots/5-AST-Alignment-AST.shot | 225 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 158 + .../snapshots/2-TSESTree-Tokens.shot | 196 ++ .../snapshots/3-Babel-AST.shot | 158 + .../snapshots/4-Babel-Tokens.shot | 196 ++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 136 + .../snapshots/2-TSESTree-Tokens.shot | 166 + .../snapshots/3-Babel-AST.shot | 136 + .../snapshots/4-Babel-Tokens.shot | 166 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 144 + .../snapshots/2-TSESTree-Tokens.shot | 166 + .../snapshots/3-Babel-AST.shot | 144 + .../snapshots/4-Babel-Tokens.shot | 166 + .../snapshots/5-AST-Alignment-AST.shot | 150 + .../snapshots/6-AST-Alignment-Tokens.shot | 172 + .../fixture.ts | 10 + .../snapshots/1-TSESTree-AST.shot | 255 ++ .../snapshots/2-TSESTree-Tokens.shot | 316 ++ .../snapshots/3-Babel-AST.shot | 252 ++ .../snapshots/4-Babel-Tokens.shot | 316 ++ .../snapshots/5-AST-Alignment-AST.shot | 259 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../type-guard-in-arrow-function/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 199 ++ .../snapshots/2-TSESTree-Tokens.shot | 226 ++ .../snapshots/3-Babel-AST.shot | 199 ++ .../snapshots/4-Babel-Tokens.shot | 226 ++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../type-guard-in-function/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 177 ++ .../snapshots/2-TSESTree-Tokens.shot | 196 ++ .../snapshots/3-Babel-AST.shot | 177 ++ .../snapshots/4-Babel-Tokens.shot | 196 ++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../type-guard-in-interface/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 144 + .../snapshots/2-TSESTree-Tokens.shot | 156 + .../snapshots/3-Babel-AST.shot | 144 + .../snapshots/4-Babel-Tokens.shot | 156 + .../snapshots/5-AST-Alignment-AST.shot | 150 + .../snapshots/6-AST-Alignment-Tokens.shot | 162 + .../fixtures/type-guard-in-method/fixture.ts | 10 + .../snapshots/1-TSESTree-AST.shot | 311 ++ .../snapshots/2-TSESTree-Tokens.shot | 356 +++ .../snapshots/3-Babel-AST.shot | 308 ++ .../snapshots/4-Babel-Tokens.shot | 356 +++ .../snapshots/5-AST-Alignment-AST.shot | 315 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 125 + .../snapshots/2-TSESTree-Tokens.shot | 166 + .../snapshots/3-Babel-AST.shot | 115 + .../snapshots/4-Babel-Tokens.shot | 166 + .../snapshots/5-AST-Alignment-AST.shot | 133 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/type-import-type/fixture.ts | 4 + .../snapshots/1-TSESTree-AST.shot | 156 + .../snapshots/2-TSESTree-Tokens.shot | 226 ++ .../snapshots/3-Babel-AST.shot | 143 + .../snapshots/4-Babel-Tokens.shot | 226 ++ .../snapshots/5-AST-Alignment-AST.shot | 172 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../type-only-export-specifiers/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 101 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 101 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../type-only-import-specifiers/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 100 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 100 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 9 + .../snapshots/1-TSESTree-AST.shot | 482 +++ .../snapshots/2-TSESTree-Tokens.shot | 536 ++++ .../snapshots/3-Babel-AST.shot | 438 +++ .../snapshots/4-Babel-Tokens.shot | 536 ++++ .../snapshots/5-AST-Alignment-AST.shot | 494 +++ .../snapshots/6-AST-Alignment-Tokens.shot | 544 ++++ .../type-parameters-comments/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 225 ++ .../snapshots/2-TSESTree-Tokens.shot | 276 ++ .../snapshots/3-Babel-AST.shot | 203 ++ .../snapshots/4-Babel-Tokens.shot | 276 ++ .../snapshots/5-AST-Alignment-AST.shot | 231 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../type-reference-comments/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 138 + .../snapshots/2-TSESTree-Tokens.shot | 136 + .../snapshots/3-Babel-AST.shot | 136 + .../snapshots/4-Babel-Tokens.shot | 136 + .../snapshots/5-AST-Alignment-AST.shot | 142 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/typed-keyword-bigint/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 44 + .../snapshots/2-TSESTree-Tokens.shot | 56 + .../snapshots/3-Babel-AST.shot | 44 + .../snapshots/4-Babel-Tokens.shot | 56 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/typed-keyword-boolean/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 44 + .../snapshots/2-TSESTree-Tokens.shot | 56 + .../snapshots/3-Babel-AST.shot | 44 + .../snapshots/4-Babel-Tokens.shot | 56 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/typed-keyword-false/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 55 + .../snapshots/2-TSESTree-Tokens.shot | 56 + .../snapshots/3-Babel-AST.shot | 55 + .../snapshots/4-Babel-Tokens.shot | 56 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/typed-keyword-never/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 44 + .../snapshots/2-TSESTree-Tokens.shot | 56 + .../snapshots/3-Babel-AST.shot | 44 + .../snapshots/4-Babel-Tokens.shot | 56 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/typed-keyword-null/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 44 + .../snapshots/2-TSESTree-Tokens.shot | 56 + .../snapshots/3-Babel-AST.shot | 44 + .../snapshots/4-Babel-Tokens.shot | 56 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 62 + .../fixtures/typed-keyword-number/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 44 + .../snapshots/2-TSESTree-Tokens.shot | 56 + .../snapshots/3-Babel-AST.shot | 44 + .../snapshots/4-Babel-Tokens.shot | 56 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/typed-keyword-object/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 44 + .../snapshots/2-TSESTree-Tokens.shot | 56 + .../snapshots/3-Babel-AST.shot | 44 + .../snapshots/4-Babel-Tokens.shot | 56 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/typed-keyword-string/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 44 + .../snapshots/2-TSESTree-Tokens.shot | 56 + .../snapshots/3-Babel-AST.shot | 44 + .../snapshots/4-Babel-Tokens.shot | 56 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/typed-keyword-symbol/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 44 + .../snapshots/2-TSESTree-Tokens.shot | 56 + .../snapshots/3-Babel-AST.shot | 44 + .../snapshots/4-Babel-Tokens.shot | 56 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/typed-keyword-true/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 55 + .../snapshots/2-TSESTree-Tokens.shot | 56 + .../snapshots/3-Babel-AST.shot | 55 + .../snapshots/4-Babel-Tokens.shot | 56 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../typed-keyword-undefined/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 44 + .../snapshots/2-TSESTree-Tokens.shot | 56 + .../snapshots/3-Babel-AST.shot | 44 + .../snapshots/4-Babel-Tokens.shot | 56 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/typed-keyword-unknown/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 44 + .../snapshots/2-TSESTree-Tokens.shot | 56 + .../snapshots/3-Babel-AST.shot | 44 + .../snapshots/4-Babel-Tokens.shot | 56 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/typed-keyword-void/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 44 + .../snapshots/2-TSESTree-Tokens.shot | 56 + .../snapshots/3-Babel-AST.shot | 44 + .../snapshots/4-Babel-Tokens.shot | 56 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../typed-method-signature/fixture.ts | 6 + .../snapshots/1-TSESTree-AST.shot | 236 ++ .../snapshots/2-TSESTree-Tokens.shot | 276 ++ .../snapshots/3-Babel-AST.shot | 225 ++ .../snapshots/4-Babel-Tokens.shot | 276 ++ .../snapshots/5-AST-Alignment-AST.shot | 245 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../basics/fixtures/typed-this/fixture.ts | 5 + .../typed-this/snapshots/1-TSESTree-AST.shot | 201 ++ .../snapshots/2-TSESTree-Tokens.shot | 236 ++ .../typed-this/snapshots/3-Babel-AST.shot | 201 ++ .../typed-this/snapshots/4-Babel-Tokens.shot | 236 ++ .../snapshots/5-AST-Alignment-AST.shot | 209 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 244 ++ .../fixtures/union-intersection/fixture.ts | 11 + .../snapshots/1-TSESTree-AST.shot | 497 +++ .../snapshots/2-TSESTree-Tokens.shot | 626 ++++ .../snapshots/3-Babel-AST.shot | 515 +++ .../snapshots/4-Babel-Tokens.shot | 626 ++++ .../snapshots/5-AST-Alignment-AST.shot | 559 ++++ .../snapshots/6-AST-Alignment-Tokens.shot | 640 ++++ .../basics/fixtures/unique-symbol/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 54 + .../snapshots/2-TSESTree-Tokens.shot | 66 + .../unique-symbol/snapshots/3-Babel-AST.shot | 54 + .../snapshots/4-Babel-Tokens.shot | 66 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../unknown-type-annotation/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 66 + .../snapshots/2-TSESTree-Tokens.shot | 56 + .../snapshots/3-Babel-AST.shot | 66 + .../snapshots/4-Babel-Tokens.shot | 56 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 62 + .../fixtures/var-with-dotted-type/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 114 + .../snapshots/2-TSESTree-Tokens.shot | 96 + .../snapshots/3-Babel-AST.shot | 114 + .../snapshots/4-Babel-Tokens.shot | 96 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../basics/fixtures/var-with-type/fixture.ts | 4 + .../snapshots/1-TSESTree-AST.shot | 136 + .../snapshots/2-TSESTree-Tokens.shot | 146 + .../var-with-type/snapshots/3-Babel-AST.shot | 136 + .../snapshots/4-Babel-Tokens.shot | 146 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 66 + .../snapshots/2-TSESTree-Tokens.shot | 56 + .../snapshots/3-Babel-AST.shot | 66 + .../snapshots/4-Babel-Tokens.shot | 56 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 62 + .../class-decorator-factory/fixture.ts | 6 + .../snapshots/1-TSESTree-AST.shot | 124 + .../snapshots/2-TSESTree-Tokens.shot | 146 + .../snapshots/3-Babel-AST.shot | 124 + .../snapshots/4-Babel-Tokens.shot | 146 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/class-decorator/fixture.ts | 4 + .../snapshots/1-TSESTree-AST.shot | 67 + .../snapshots/2-TSESTree-Tokens.shot | 66 + .../snapshots/3-Babel-AST.shot | 67 + .../snapshots/4-Babel-Tokens.shot | 66 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../class-parameter-property/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 154 + .../snapshots/2-TSESTree-Tokens.shot | 156 + .../snapshots/3-Babel-AST.shot | 153 + .../snapshots/4-Babel-Tokens.shot | 156 + .../snapshots/5-AST-Alignment-AST.shot | 160 + .../snapshots/6-AST-Alignment-Tokens.shot | 162 + .../export-default-class-decorator/fixture.ts | 4 + .../snapshots/1-TSESTree-AST.shot | 77 + .../snapshots/2-TSESTree-Tokens.shot | 86 + .../snapshots/3-Babel-AST.shot | 77 + .../snapshots/4-Babel-Tokens.shot | 86 + .../snapshots/5-AST-Alignment-AST.shot | 85 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../export-named-class-decorator/fixture.ts | 4 + .../snapshots/1-TSESTree-AST.shot | 80 + .../snapshots/2-TSESTree-Tokens.shot | 76 + .../snapshots/3-Babel-AST.shot | 80 + .../snapshots/4-Babel-Tokens.shot | 76 + .../snapshots/5-AST-Alignment-AST.shot | 88 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../type-assertion-regression-test/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 85 + .../snapshots/2-TSESTree-Tokens.shot | 86 + .../snapshots/3-Babel-AST.shot | 85 + .../snapshots/4-Babel-Tokens.shot | 86 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/abstract-class/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 48 + .../snapshots/2-TSESTree-Tokens.shot | 66 + .../abstract-class/snapshots/3-Babel-AST.shot | 48 + .../snapshots/4-Babel-Tokens.shot | 66 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../declare/fixtures/class/fixture.ts | 3 + .../class/snapshots/1-TSESTree-AST.shot | 47 + .../class/snapshots/2-TSESTree-Tokens.shot | 56 + .../fixtures/class/snapshots/3-Babel-AST.shot | 47 + .../class/snapshots/4-Babel-Tokens.shot | 56 + .../class/snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../declare/fixtures/enum/fixture.ts | 6 + .../enum/snapshots/1-TSESTree-AST.shot | 76 + .../enum/snapshots/2-TSESTree-Tokens.shot | 96 + .../fixtures/enum/snapshots/3-Babel-AST.shot | 76 + .../enum/snapshots/4-Babel-Tokens.shot | 96 + .../enum/snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 102 + .../declare/fixtures/function/fixture.ts | 3 + .../function/snapshots/1-TSESTree-AST.shot | 58 + .../function/snapshots/2-TSESTree-Tokens.shot | 86 + .../function/snapshots/3-Babel-AST.shot | 58 + .../function/snapshots/4-Babel-Tokens.shot | 86 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../declare/fixtures/interface/fixture.ts | 3 + .../interface/snapshots/1-TSESTree-AST.shot | 46 + .../snapshots/2-TSESTree-Tokens.shot | 56 + .../interface/snapshots/3-Babel-AST.shot | 46 + .../interface/snapshots/4-Babel-Tokens.shot | 56 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 62 + .../declare/fixtures/module/fixture.ts | 3 + .../module/snapshots/1-TSESTree-AST.shot | 46 + .../module/snapshots/2-TSESTree-Tokens.shot | 56 + .../module/snapshots/3-Babel-AST.shot | 46 + .../module/snapshots/4-Babel-Tokens.shot | 56 + .../module/snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../declare/fixtures/namespace/fixture.ts | 3 + .../namespace/snapshots/1-TSESTree-AST.shot | 46 + .../snapshots/2-TSESTree-Tokens.shot | 56 + .../namespace/snapshots/3-Babel-AST.shot | 46 + .../namespace/snapshots/4-Babel-Tokens.shot | 56 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../declare/fixtures/type-alias/fixture.ts | 3 + .../type-alias/snapshots/1-TSESTree-AST.shot | 45 + .../snapshots/2-TSESTree-Tokens.shot | 66 + .../type-alias/snapshots/3-Babel-AST.shot | 45 + .../type-alias/snapshots/4-Babel-Tokens.shot | 66 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../declare/fixtures/variable/fixture.ts | 3 + .../variable/snapshots/1-TSESTree-AST.shot | 67 + .../variable/snapshots/2-TSESTree-Tokens.shot | 66 + .../variable/snapshots/3-Babel-AST.shot | 67 + .../variable/snapshots/4-Babel-Tokens.shot | 66 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../class-empty-extends-implements/fixture.ts | 5 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../_error_/class-empty-extends/fixture.ts | 5 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../class-extends-empty-implements/fixture.ts | 5 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../class-multiple-implements/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../decorator-on-enum-declaration/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../_error_/decorator-on-function/fixture.ts | 4 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 4 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../_error_/decorator-on-variable/fixture.ts | 4 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../_error_/empty-type-arguments/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../_error_/empty-type-parameters/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../_error_/enum-with-keywords/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../index-signature-parameters/fixture.ts | 5 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../interface-empty-extends/fixture.ts | 5 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../_error_/interface-implements/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 6 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 6 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 6 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 6 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 6 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../interface-method-export/fixture.ts | 6 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../interface-method-private/fixture.ts | 6 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../interface-method-protected/fixture.ts | 6 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../interface-method-public/fixture.ts | 6 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../interface-method-readonly/fixture.ts | 5 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../interface-method-static/fixture.ts | 6 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../interface-multiple-extends/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../interface-property-export/fixture.ts | 6 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../interface-property-private/fixture.ts | 6 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../interface-property-protected/fixture.ts | 6 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../interface-property-public/fixture.ts | 6 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../interface-property-static/fixture.ts | 6 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../_error_/interface-with-no-body/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../object-assertion-not-allowed/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../object-optional-not-allowed/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixtures/_error_/solo-const/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 3 + .../solo-const/snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../instantiation-expression/fixture.ts | 9 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../call-expression-type-arguments/fixture.ts | 4 + .../snapshots/1-TSESTree-AST.shot | 126 + .../snapshots/2-TSESTree-Tokens.shot | 146 + .../snapshots/3-Babel-AST.shot | 126 + .../snapshots/4-Babel-Tokens.shot | 146 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../new-expression-type-arguments/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 97 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 97 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 4 + .../snapshots/1-TSESTree-AST.shot | 186 ++ .../snapshots/2-TSESTree-Tokens.shot | 186 ++ .../snapshots/3-Babel-AST.shot | 186 ++ .../snapshots/4-Babel-Tokens.shot | 186 ++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 100 + .../snapshots/2-TSESTree-Tokens.shot | 66 + .../snapshots/3-Babel-AST.shot | 100 + .../snapshots/4-Babel-Tokens.shot | 66 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 6 + .../snapshots/1-TSESTree-AST.shot | 138 + .../snapshots/2-TSESTree-Tokens.shot | 146 + .../snapshots/3-Babel-AST.shot | 137 + .../snapshots/4-Babel-Tokens.shot | 146 + .../snapshots/5-AST-Alignment-AST.shot | 142 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 6 + .../snapshots/1-TSESTree-AST.shot | 138 + .../snapshots/2-TSESTree-Tokens.shot | 156 + .../snapshots/3-Babel-AST.shot | 137 + .../snapshots/4-Babel-Tokens.shot | 156 + .../snapshots/5-AST-Alignment-AST.shot | 142 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 6 + .../snapshots/1-TSESTree-AST.shot | 115 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 114 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 119 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../method-decorator-static-member/fixture.ts | 6 + .../snapshots/1-TSESTree-AST.shot | 115 + .../snapshots/2-TSESTree-Tokens.shot | 126 + .../snapshots/3-Babel-AST.shot | 114 + .../snapshots/4-Babel-Tokens.shot | 126 + .../snapshots/5-AST-Alignment-AST.shot | 119 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 91 + .../snapshots/2-TSESTree-Tokens.shot | 106 + .../snapshots/3-Babel-AST.shot | 91 + .../snapshots/4-Babel-Tokens.shot | 106 + .../snapshots/5-AST-Alignment-AST.shot | 96 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 160 + .../snapshots/2-TSESTree-Tokens.shot | 196 ++ .../snapshots/3-Babel-AST.shot | 160 + .../snapshots/4-Babel-Tokens.shot | 196 ++ .../snapshots/5-AST-Alignment-AST.shot | 165 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../global-module-declaration/fixture.ts | 6 + .../snapshots/1-TSESTree-AST.shot | 108 + .../snapshots/2-TSESTree-Tokens.shot | 146 + .../snapshots/3-Babel-AST.shot | 108 + .../snapshots/4-Babel-Tokens.shot | 146 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../module-with-default-exports/fixture.ts | 8 + .../snapshots/1-TSESTree-AST.shot | 206 ++ .../snapshots/2-TSESTree-Tokens.shot | 256 ++ .../snapshots/3-Babel-AST.shot | 205 ++ .../snapshots/4-Babel-Tokens.shot | 256 ++ .../snapshots/5-AST-Alignment-AST.shot | 211 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../nested-internal-module/fixture.ts | 13 + .../snapshots/1-TSESTree-AST.shot | 393 +++ .../snapshots/2-TSESTree-Tokens.shot | 436 +++ .../snapshots/3-Babel-AST.shot | 392 +++ .../snapshots/4-Babel-Tokens.shot | 436 +++ .../snapshots/5-AST-Alignment-AST.shot | 398 +++ .../snapshots/6-AST-Alignment-Tokens.shot | 446 +++ .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 37 + .../snapshots/2-TSESTree-Tokens.shot | 46 + .../snapshots/3-Babel-AST.shot | 37 + .../snapshots/4-Babel-Tokens.shot | 46 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixture.ts | 7 + .../snapshots/1-TSESTree-AST.shot | 257 ++ .../snapshots/2-TSESTree-Tokens.shot | 256 ++ .../snapshots/3-Babel-AST.shot | 256 ++ .../snapshots/4-Babel-Tokens.shot | 256 ++ .../snapshots/5-AST-Alignment-AST.shot | 261 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 167 + .../snapshots/2-TSESTree-Tokens.shot | 176 ++ .../snapshots/3-Babel-AST.shot | 166 + .../snapshots/4-Babel-Tokens.shot | 176 ++ .../snapshots/5-AST-Alignment-AST.shot | 171 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 167 + .../snapshots/2-TSESTree-Tokens.shot | 186 ++ .../snapshots/3-Babel-AST.shot | 166 + .../snapshots/4-Babel-Tokens.shot | 186 ++ .../snapshots/5-AST-Alignment-AST.shot | 171 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 7 + .../snapshots/1-TSESTree-AST.shot | 206 ++ .../snapshots/2-TSESTree-Tokens.shot | 216 ++ .../snapshots/3-Babel-AST.shot | 205 ++ .../snapshots/4-Babel-Tokens.shot | 216 ++ .../snapshots/5-AST-Alignment-AST.shot | 210 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 7 + .../snapshots/1-TSESTree-AST.shot | 206 ++ .../snapshots/2-TSESTree-Tokens.shot | 226 ++ .../snapshots/3-Babel-AST.shot | 205 ++ .../snapshots/4-Babel-Tokens.shot | 226 ++ .../snapshots/5-AST-Alignment-AST.shot | 210 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 201 ++ .../snapshots/2-TSESTree-Tokens.shot | 196 ++ .../snapshots/3-Babel-AST.shot | 200 ++ .../snapshots/4-Babel-Tokens.shot | 196 ++ .../snapshots/5-AST-Alignment-AST.shot | 205 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 7 + .../snapshots/1-TSESTree-AST.shot | 178 ++ .../snapshots/2-TSESTree-Tokens.shot | 216 ++ .../snapshots/3-Babel-AST.shot | 174 ++ .../snapshots/4-Babel-Tokens.shot | 216 ++ .../snapshots/5-AST-Alignment-AST.shot | 182 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 8 + .../snapshots/1-TSESTree-AST.shot | 183 ++ .../snapshots/2-TSESTree-Tokens.shot | 206 ++ .../snapshots/3-Babel-AST.shot | 179 ++ .../snapshots/4-Babel-Tokens.shot | 206 ++ .../snapshots/5-AST-Alignment-AST.shot | 187 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 7 + .../snapshots/1-TSESTree-AST.shot | 137 + .../snapshots/2-TSESTree-Tokens.shot | 126 + .../snapshots/3-Babel-AST.shot | 133 + .../snapshots/4-Babel-Tokens.shot | 126 + .../snapshots/5-AST-Alignment-AST.shot | 141 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 7 + .../snapshots/1-TSESTree-AST.shot | 137 + .../snapshots/2-TSESTree-Tokens.shot | 146 + .../snapshots/3-Babel-AST.shot | 133 + .../snapshots/4-Babel-Tokens.shot | 146 + .../snapshots/5-AST-Alignment-AST.shot | 141 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../types/fixtures/array-type/fixture.ts | 3 + .../array-type/snapshots/1-TSESTree-AST.shot | 53 + .../snapshots/2-TSESTree-Tokens.shot | 76 + .../array-type/snapshots/3-Babel-AST.shot | 53 + .../array-type/snapshots/4-Babel-Tokens.shot | 76 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../conditional-infer-nested/fixture.ts | 9 + .../snapshots/1-TSESTree-AST.shot | 356 +++ .../snapshots/2-TSESTree-Tokens.shot | 366 +++ .../snapshots/3-Babel-AST.shot | 321 ++ .../snapshots/4-Babel-Tokens.shot | 366 +++ .../snapshots/5-AST-Alignment-AST.shot | 374 +++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../conditional-infer-simple/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 252 ++ .../snapshots/2-TSESTree-Tokens.shot | 246 ++ .../snapshots/3-Babel-AST.shot | 219 ++ .../snapshots/4-Babel-Tokens.shot | 246 ++ .../snapshots/5-AST-Alignment-AST.shot | 259 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 15 + .../snapshots/1-TSESTree-AST.shot | 1059 +++++++ .../snapshots/2-TSESTree-Tokens.shot | 1236 ++++++++ .../snapshots/3-Babel-AST.shot | 905 ++++++ .../snapshots/4-Babel-Tokens.shot | 1236 ++++++++ .../snapshots/5-AST-Alignment-AST.shot | 1077 +++++++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/conditional-infer/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 172 + .../snapshots/2-TSESTree-Tokens.shot | 196 ++ .../snapshots/3-Babel-AST.shot | 159 + .../snapshots/4-Babel-Tokens.shot | 196 ++ .../snapshots/5-AST-Alignment-AST.shot | 188 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/conditional-with-null/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 102 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 102 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 124 + .../types/fixtures/conditional/fixture.ts | 3 + .../conditional/snapshots/1-TSESTree-AST.shot | 102 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../conditional/snapshots/3-Babel-AST.shot | 102 + .../conditional/snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 122 + .../fixtures/constructor-abstract/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 86 + .../snapshots/2-TSESTree-Tokens.shot | 106 + .../snapshots/3-Babel-AST.shot | 86 + .../snapshots/4-Babel-Tokens.shot | 106 + .../snapshots/5-AST-Alignment-AST.shot | 92 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/constructor-empty/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 86 + .../snapshots/2-TSESTree-Tokens.shot | 96 + .../snapshots/3-Babel-AST.shot | 86 + .../snapshots/4-Babel-Tokens.shot | 96 + .../snapshots/5-AST-Alignment-AST.shot | 92 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/constructor-generic/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 167 + .../snapshots/2-TSESTree-Tokens.shot | 156 + .../snapshots/3-Babel-AST.shot | 156 + .../snapshots/4-Babel-Tokens.shot | 156 + .../snapshots/5-AST-Alignment-AST.shot | 174 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 162 + .../constructor-in-generic/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 116 + .../snapshots/2-TSESTree-Tokens.shot | 126 + .../snapshots/3-Babel-AST.shot | 116 + .../snapshots/4-Babel-Tokens.shot | 126 + .../snapshots/5-AST-Alignment-AST.shot | 122 + .../snapshots/6-AST-Alignment-Tokens.shot | 132 + .../fixtures/constructor-with-rest/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 133 + .../snapshots/2-TSESTree-Tokens.shot | 156 + .../snapshots/3-Babel-AST.shot | 133 + .../snapshots/4-Babel-Tokens.shot | 156 + .../snapshots/5-AST-Alignment-AST.shot | 139 + .../snapshots/6-AST-Alignment-Tokens.shot | 162 + .../types/fixtures/constructor/fixture.ts | 3 + .../constructor/snapshots/1-TSESTree-AST.shot | 144 + .../snapshots/2-TSESTree-Tokens.shot | 176 ++ .../constructor/snapshots/3-Babel-AST.shot | 144 + .../constructor/snapshots/4-Babel-Tokens.shot | 176 ++ .../snapshots/5-AST-Alignment-AST.shot | 150 + .../snapshots/6-AST-Alignment-Tokens.shot | 182 ++ .../fixtures/function-generic/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 166 + .../snapshots/2-TSESTree-Tokens.shot | 146 + .../snapshots/3-Babel-AST.shot | 155 + .../snapshots/4-Babel-Tokens.shot | 146 + .../snapshots/5-AST-Alignment-AST.shot | 173 + .../snapshots/6-AST-Alignment-Tokens.shot | 152 + .../fixtures/function-in-generic/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 115 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 115 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 121 + .../snapshots/6-AST-Alignment-Tokens.shot | 122 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 103 + .../snapshots/2-TSESTree-Tokens.shot | 136 + .../snapshots/3-Babel-AST.shot | 103 + .../snapshots/4-Babel-Tokens.shot | 136 + .../snapshots/5-AST-Alignment-AST.shot | 109 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 126 + .../snapshots/2-TSESTree-Tokens.shot | 136 + .../snapshots/3-Babel-AST.shot | 126 + .../snapshots/4-Babel-Tokens.shot | 136 + .../snapshots/5-AST-Alignment-AST.shot | 132 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/function-with-rest/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 132 + .../snapshots/2-TSESTree-Tokens.shot | 146 + .../snapshots/3-Babel-AST.shot | 132 + .../snapshots/4-Babel-Tokens.shot | 146 + .../snapshots/5-AST-Alignment-AST.shot | 138 + .../snapshots/6-AST-Alignment-Tokens.shot | 152 + .../fixtures/function-with-this/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 114 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 114 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 120 + .../snapshots/6-AST-Alignment-Tokens.shot | 124 + .../types/fixtures/function/fixture.ts | 3 + .../function/snapshots/1-TSESTree-AST.shot | 143 + .../function/snapshots/2-TSESTree-Tokens.shot | 166 + .../function/snapshots/3-Babel-AST.shot | 143 + .../function/snapshots/4-Babel-Tokens.shot | 166 + .../snapshots/5-AST-Alignment-AST.shot | 149 + .../snapshots/6-AST-Alignment-Tokens.shot | 172 + .../index-signature-readonly/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 104 + .../snapshots/2-TSESTree-Tokens.shot | 156 + .../snapshots/3-Babel-AST.shot | 104 + .../snapshots/4-Babel-Tokens.shot | 156 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../index-signature-without-type/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 85 + .../snapshots/2-TSESTree-Tokens.shot | 126 + .../snapshots/3-Babel-AST.shot | 85 + .../snapshots/4-Babel-Tokens.shot | 126 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../types/fixtures/index-signature/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 103 + .../snapshots/2-TSESTree-Tokens.shot | 146 + .../snapshots/3-Babel-AST.shot | 103 + .../snapshots/4-Babel-Tokens.shot | 146 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../types/fixtures/indexed/fixture.ts | 3 + .../indexed/snapshots/1-TSESTree-AST.shot | 104 + .../indexed/snapshots/2-TSESTree-Tokens.shot | 86 + .../indexed/snapshots/3-Babel-AST.shot | 104 + .../indexed/snapshots/4-Babel-Tokens.shot | 86 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 92 + .../interface-with-accessors/fixture.ts | 6 + .../snapshots/1-TSESTree-AST.shot | 166 + .../snapshots/2-TSESTree-Tokens.shot | 236 ++ .../snapshots/3-Babel-AST.shot | 166 + .../snapshots/4-Babel-Tokens.shot | 236 ++ .../snapshots/5-AST-Alignment-AST.shot | 173 + .../snapshots/6-AST-Alignment-Tokens.shot | 242 ++ .../fixtures/intersection-type/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 186 ++ .../snapshots/2-TSESTree-Tokens.shot | 176 ++ .../snapshots/3-Babel-AST.shot | 175 ++ .../snapshots/4-Babel-Tokens.shot | 176 ++ .../snapshots/5-AST-Alignment-AST.shot | 191 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../literal-number-negative/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 88 + .../snapshots/2-TSESTree-Tokens.shot | 66 + .../snapshots/3-Babel-AST.shot | 88 + .../snapshots/4-Babel-Tokens.shot | 66 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 72 + .../types/fixtures/literal-number/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 77 + .../snapshots/2-TSESTree-Tokens.shot | 56 + .../literal-number/snapshots/3-Babel-AST.shot | 77 + .../snapshots/4-Babel-Tokens.shot | 56 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 62 + .../types/fixtures/literal-string/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 77 + .../snapshots/2-TSESTree-Tokens.shot | 56 + .../literal-string/snapshots/3-Babel-AST.shot | 77 + .../snapshots/4-Babel-Tokens.shot | 56 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 62 + .../fixtures/mapped-named-type/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 193 ++ .../snapshots/2-TSESTree-Tokens.shot | 236 ++ .../snapshots/3-Babel-AST.shot | 171 + .../snapshots/4-Babel-Tokens.shot | 236 ++ .../snapshots/5-AST-Alignment-AST.shot | 199 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/mapped-readonly-minus/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 108 + .../snapshots/2-TSESTree-Tokens.shot | 176 ++ .../snapshots/3-Babel-AST.shot | 97 + .../snapshots/4-Babel-Tokens.shot | 176 ++ .../snapshots/5-AST-Alignment-AST.shot | 113 + .../snapshots/6-AST-Alignment-Tokens.shot | 182 ++ .../fixtures/mapped-readonly-plus/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 108 + .../snapshots/2-TSESTree-Tokens.shot | 176 ++ .../snapshots/3-Babel-AST.shot | 97 + .../snapshots/4-Babel-Tokens.shot | 176 ++ .../snapshots/5-AST-Alignment-AST.shot | 113 + .../snapshots/6-AST-Alignment-Tokens.shot | 182 ++ .../types/fixtures/mapped-readonly/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 108 + .../snapshots/2-TSESTree-Tokens.shot | 156 + .../snapshots/3-Babel-AST.shot | 97 + .../snapshots/4-Babel-Tokens.shot | 156 + .../snapshots/5-AST-Alignment-AST.shot | 113 + .../snapshots/6-AST-Alignment-Tokens.shot | 162 + .../types/fixtures/mapped-untypped/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 97 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 86 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 102 + .../snapshots/6-AST-Alignment-Tokens.shot | 122 + .../types/fixtures/mapped/fixture.ts | 3 + .../mapped/snapshots/1-TSESTree-AST.shot | 106 + .../mapped/snapshots/2-TSESTree-Tokens.shot | 136 + .../mapped/snapshots/3-Babel-AST.shot | 95 + .../mapped/snapshots/4-Babel-Tokens.shot | 136 + .../mapped/snapshots/5-AST-Alignment-AST.shot | 111 + .../snapshots/6-AST-Alignment-Tokens.shot | 142 + .../types/fixtures/nested-types/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 222 ++ .../snapshots/2-TSESTree-Tokens.shot | 376 +++ .../nested-types/snapshots/3-Babel-AST.shot | 240 ++ .../snapshots/4-Babel-Tokens.shot | 376 +++ .../snapshots/5-AST-Alignment-AST.shot | 333 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 382 +++ .../fixture.ts | 6 + .../snapshots/1-TSESTree-AST.shot | 166 + .../snapshots/2-TSESTree-Tokens.shot | 256 ++ .../snapshots/3-Babel-AST.shot | 166 + .../snapshots/4-Babel-Tokens.shot | 256 ++ .../snapshots/5-AST-Alignment-AST.shot | 173 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../optional-variance-in-and-out/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 165 + .../snapshots/2-TSESTree-Tokens.shot | 186 ++ .../snapshots/3-Babel-AST.shot | 145 + .../snapshots/4-Babel-Tokens.shot | 186 ++ .../snapshots/5-AST-Alignment-AST.shot | 173 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../optional-variance-in-out/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 144 + .../snapshots/2-TSESTree-Tokens.shot | 166 + .../snapshots/3-Babel-AST.shot | 135 + .../snapshots/4-Babel-Tokens.shot | 166 + .../snapshots/5-AST-Alignment-AST.shot | 151 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/optional-variance-in/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 134 + .../snapshots/2-TSESTree-Tokens.shot | 156 + .../snapshots/3-Babel-AST.shot | 124 + .../snapshots/4-Babel-Tokens.shot | 156 + .../snapshots/5-AST-Alignment-AST.shot | 141 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/optional-variance-out/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 105 + .../snapshots/2-TSESTree-Tokens.shot | 126 + .../snapshots/3-Babel-AST.shot | 95 + .../snapshots/4-Babel-Tokens.shot | 126 + .../snapshots/5-AST-Alignment-AST.shot | 112 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/parenthesized-type/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 64 + .../snapshots/2-TSESTree-Tokens.shot | 76 + .../snapshots/3-Babel-AST.shot | 64 + .../snapshots/4-Babel-Tokens.shot | 76 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../reference-generic-nested/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 126 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 126 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 122 + .../fixtures/reference-generic/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 96 + .../snapshots/2-TSESTree-Tokens.shot | 86 + .../snapshots/3-Babel-AST.shot | 96 + .../snapshots/4-Babel-Tokens.shot | 86 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 92 + .../types/fixtures/reference/fixture.ts | 3 + .../reference/snapshots/1-TSESTree-AST.shot | 76 + .../snapshots/2-TSESTree-Tokens.shot | 56 + .../reference/snapshots/3-Babel-AST.shot | 76 + .../reference/snapshots/4-Babel-Tokens.shot | 56 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 62 + .../template-literal-type-1/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 70 + .../snapshots/2-TSESTree-Tokens.shot | 56 + .../snapshots/3-Babel-AST.shot | 70 + .../snapshots/4-Babel-Tokens.shot | 56 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../template-literal-type-2/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 96 + .../snapshots/2-TSESTree-Tokens.shot | 76 + .../snapshots/3-Babel-AST.shot | 105 + .../snapshots/4-Babel-Tokens.shot | 76 + .../snapshots/5-AST-Alignment-AST.shot | 152 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../template-literal-type-3/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 265 ++ .../snapshots/2-TSESTree-Tokens.shot | 236 ++ .../snapshots/3-Babel-AST.shot | 274 ++ .../snapshots/4-Babel-Tokens.shot | 236 ++ .../snapshots/5-AST-Alignment-AST.shot | 340 ++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../template-literal-type-4/fixture.ts | 5 + .../snapshots/1-TSESTree-AST.shot | 424 +++ .../snapshots/2-TSESTree-Tokens.shot | 386 +++ .../snapshots/3-Babel-AST.shot | 422 +++ .../snapshots/4-Babel-Tokens.shot | 386 +++ .../snapshots/5-AST-Alignment-AST.shot | 643 ++++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/this-type-expanded/fixture.ts | 31 + .../snapshots/1-TSESTree-AST.shot | 1060 +++++++ .../snapshots/2-TSESTree-Tokens.shot | 1246 ++++++++ .../snapshots/3-Babel-AST.shot | 1052 +++++++ .../snapshots/4-Babel-Tokens.shot | 1246 ++++++++ .../snapshots/5-AST-Alignment-AST.shot | 1064 +++++++ .../snapshots/6-AST-Alignment-Tokens.shot | 1274 ++++++++ .../types/fixtures/this-type/fixture.ts | 7 + .../this-type/snapshots/1-TSESTree-AST.shot | 131 + .../snapshots/2-TSESTree-Tokens.shot | 146 + .../this-type/snapshots/3-Babel-AST.shot | 130 + .../this-type/snapshots/4-Babel-Tokens.shot | 146 + .../snapshots/5-AST-Alignment-AST.shot | 135 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../types/fixtures/tuple-empty/fixture.ts | 3 + .../tuple-empty/snapshots/1-TSESTree-AST.shot | 67 + .../snapshots/2-TSESTree-Tokens.shot | 66 + .../tuple-empty/snapshots/3-Babel-AST.shot | 67 + .../tuple-empty/snapshots/4-Babel-Tokens.shot | 66 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 72 + .../fixtures/tuple-named-optional/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 175 ++ .../snapshots/2-TSESTree-Tokens.shot | 216 ++ .../snapshots/3-Babel-AST.shot | 175 ++ .../snapshots/4-Babel-Tokens.shot | 216 ++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 222 ++ .../fixtures/tuple-named-rest/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 144 + .../snapshots/2-TSESTree-Tokens.shot | 166 + .../snapshots/3-Babel-AST.shot | 144 + .../snapshots/4-Babel-Tokens.shot | 166 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 172 + .../fixtures/tuple-named-type/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 104 + .../snapshots/2-TSESTree-Tokens.shot | 146 + .../snapshots/3-Babel-AST.shot | 104 + .../snapshots/4-Babel-Tokens.shot | 146 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../types/fixtures/tuple-named/fixture.ts | 3 + .../tuple-named/snapshots/1-TSESTree-AST.shot | 155 + .../snapshots/2-TSESTree-Tokens.shot | 176 ++ .../tuple-named/snapshots/3-Babel-AST.shot | 155 + .../tuple-named/snapshots/4-Babel-Tokens.shot | 176 ++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 182 ++ .../types/fixtures/tuple-optional/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 133 + .../snapshots/2-TSESTree-Tokens.shot | 176 ++ .../tuple-optional/snapshots/3-Babel-AST.shot | 142 + .../snapshots/4-Babel-Tokens.shot | 176 ++ .../snapshots/5-AST-Alignment-AST.shot | 166 + .../snapshots/6-AST-Alignment-Tokens.shot | 182 ++ .../types/fixtures/tuple-rest/fixture.ts | 3 + .../tuple-rest/snapshots/1-TSESTree-AST.shot | 104 + .../snapshots/2-TSESTree-Tokens.shot | 126 + .../tuple-rest/snapshots/3-Babel-AST.shot | 104 + .../tuple-rest/snapshots/4-Babel-Tokens.shot | 126 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 132 + .../types/fixtures/tuple-type/fixture.ts | 3 + .../tuple-type/snapshots/1-TSESTree-AST.shot | 73 + .../snapshots/2-TSESTree-Tokens.shot | 106 + .../tuple-type/snapshots/3-Babel-AST.shot | 73 + .../tuple-type/snapshots/4-Babel-Tokens.shot | 106 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../types/fixtures/tuple/fixture.ts | 3 + .../tuple/snapshots/1-TSESTree-AST.shot | 95 + .../tuple/snapshots/2-TSESTree-Tokens.shot | 116 + .../fixtures/tuple/snapshots/3-Babel-AST.shot | 95 + .../tuple/snapshots/4-Babel-Tokens.shot | 116 + .../tuple/snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 122 + .../types/fixtures/type-literal/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 106 + .../snapshots/2-TSESTree-Tokens.shot | 96 + .../type-literal/snapshots/3-Babel-AST.shot | 106 + .../snapshots/4-Babel-Tokens.shot | 96 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 102 + .../types/fixtures/type-operator/fixture.ts | 4 + .../snapshots/1-TSESTree-AST.shot | 146 + .../snapshots/2-TSESTree-Tokens.shot | 126 + .../type-operator/snapshots/3-Babel-AST.shot | 146 + .../snapshots/4-Babel-Tokens.shot | 126 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 134 + .../types/fixtures/typeof-this/fixture.ts | 4 + .../typeof-this/snapshots/1-TSESTree-AST.shot | 153 + .../snapshots/2-TSESTree-Tokens.shot | 146 + .../typeof-this/snapshots/3-Babel-AST.shot | 155 + .../typeof-this/snapshots/4-Babel-Tokens.shot | 146 + .../snapshots/5-AST-Alignment-AST.shot | 163 + .../snapshots/6-AST-Alignment-Tokens.shot | 158 + .../typeof-with-type-parameters/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 125 + .../snapshots/2-TSESTree-Tokens.shot | 116 + .../snapshots/3-Babel-AST.shot | 125 + .../snapshots/4-Babel-Tokens.shot | 116 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 122 + .../types/fixtures/typeof/fixture.ts | 3 + .../typeof/snapshots/1-TSESTree-AST.shot | 95 + .../typeof/snapshots/2-TSESTree-Tokens.shot | 86 + .../typeof/snapshots/3-Babel-AST.shot | 95 + .../typeof/snapshots/4-Babel-Tokens.shot | 86 + .../typeof/snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 92 + .../fixtures/union-intersection/fixture.ts | 6 + .../snapshots/1-TSESTree-AST.shot | 345 ++ .../snapshots/2-TSESTree-Tokens.shot | 386 +++ .../snapshots/3-Babel-AST.shot | 363 +++ .../snapshots/4-Babel-Tokens.shot | 386 +++ .../snapshots/5-AST-Alignment-AST.shot | 407 +++ .../snapshots/6-AST-Alignment-Tokens.shot | 400 +++ .../types/fixtures/union-type/fixture.ts | 3 + .../union-type/snapshots/1-TSESTree-AST.shot | 64 + .../snapshots/2-TSESTree-Tokens.shot | 76 + .../union-type/snapshots/3-Babel-AST.shot | 64 + .../union-type/snapshots/4-Babel-Tokens.shot | 76 + .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../tests/fixtures-with-differences-ast.shot | 175 ++ .../fixtures-with-differences-errors.shot | 66 + .../fixtures-with-differences-tokens.shot | 98 + packages/shared-fixtures/CHANGELOG.md | 986 ------ packages/shared-fixtures/README.md | 10 - .../comments/block-trailing-comment.src.js | 4 - .../comments/comment-within-condition.src.js | 2 - .../export-default-anonymous-class.src.js | 10 - .../fixtures/comments/jsdoc-comment.src.js | 8 - .../jsx-attr-and-text-with-url.src.js | 1 - .../comments/jsx-block-comment.src.js | 7 - .../comments/jsx-comment-after-jsx.src.js | 5 - .../jsx-comment-after-self-closing-jsx.src.js | 5 - .../jsx-generic-with-comment-in-tag.src.js | 25 - .../jsx-tag-comment-after-prop.src.js | 11 - .../fixtures/comments/jsx-tag-comments.src.js | 10 - ...jsx-text-with-multiline-non-comment.src.js | 9 - .../comments/jsx-text-with-url.src.js | 9 - .../comments/jsx-with-greather-than.src.js | 4 - .../comments/jsx-with-operators.src.js | 4 - .../line-comment-with-block-syntax.src.js | 1 - .../mix-line-and-block-comments.src.js | 3 - .../fixtures/comments/no-comment-regex.src.js | 1 - .../comments/no-comment-template.src.js | 1 - .../comments/surrounding-call-comments.src.js | 5 - .../surrounding-debugger-comments.src.js | 5 - .../surrounding-return-comments.src.js | 5 - .../surrounding-throw-comments.src.js | 5 - .../surrounding-while-loop-comments.src.js | 1 - ...tch-fallthrough-comment-in-function.src.js | 9 - .../switch-fallthrough-comment.src.js | 7 - ...itch-no-default-comment-in-function.src.js | 9 - ...default-comment-in-nested-functions.src.js | 12 - .../comments/switch-no-default-comment.src.js | 5 - .../comments/template-string-block.src.js | 5 - .../type-assertion-regression-test.src.ts | 2 - .../arrayLiteral/array-literal-in-lhs.src.js | 1 - .../array-literals-in-binary-expr.src.js | 1 - .../as-param-with-params.src.js | 1 - .../javascript/arrowFunctions/as-param.src.js | 1 - .../basic-in-binary-expression.src.js | 2 - .../javascript/arrowFunctions/basic.src.js | 1 - .../block-body-not-object.src.js | 1 - .../arrowFunctions/block-body.src.js | 1 - .../arrowFunctions/error-dup-params.src.js | 1 - .../arrowFunctions/error-missing-paren.src.js | 1 - .../arrowFunctions/error-not-arrow.src.js | 1 - .../error-numeric-param-multi.src.js | 1 - .../arrowFunctions/error-numeric-param.src.js | 1 - .../arrowFunctions/error-reverse-arrow.src.js | 1 - .../error-strict-default-param-eval.src.js | 1 - .../error-strict-dup-params.src.js | 1 - .../error-strict-eval-return.src.js | 1 - .../arrowFunctions/error-strict-eval.src.js | 1 - .../arrowFunctions/error-strict-octal.src.js | 1 - .../error-strict-param-arguments.src.js | 1 - .../error-strict-param-eval.src.js | 1 - .../error-strict-param-names.src.js | 1 - ...ror-strict-param-no-paren-arguments.src.js | 1 - .../error-strict-param-no-paren-eval.src.js | 1 - .../arrowFunctions/error-two-lines.src.js | 2 - .../arrowFunctions/error-wrapped-param.src.js | 1 - .../arrowFunctions/expression.src.js | 1 - .../javascript/arrowFunctions/iife.src.js | 1 - .../arrowFunctions/multiple-params.src.js | 1 - .../arrowFunctions/no-auto-return.src.js | 1 - .../not-strict-arguments.src.js | 1 - .../not-strict-eval-params.src.js | 1 - .../arrowFunctions/not-strict-eval.src.js | 1 - .../arrowFunctions/not-strict-octal.src.js | 1 - .../return-arrow-function.src.js | 1 - .../arrowFunctions/return-sequence.src.js | 1 - .../arrowFunctions/single-param-parens.src.js | 1 - .../single-param-return-identifier.src.js | 1 - .../arrowFunctions/single-param.src.js | 1 - .../basics/and-operator-array-object.src.js | 4 - .../basics/delete-expression.src.js | 1 - .../basics/do-while-statements.src.js | 6 - .../identifiers-double-underscore.src.js | 9 - .../javascript/basics/instanceof.src.js | 1 - .../basics/new-with-member-expression.src.js | 1 - .../basics/new-without-parens.src.js | 2 - .../basics/or-operator-array-object.src.js | 4 - .../basics/typeof-expression.src.js | 1 - .../basics/update-expression.src.js | 5 - .../javascript/basics/void-expression.src.js | 2 - .../javascript/bigIntLiterals/binary.src.js | 1 - .../javascript/bigIntLiterals/decimal.src.js | 1 - .../javascript/bigIntLiterals/hex.src.js | 1 - .../bigIntLiterals/numeric-separator.src.js | 1 - .../javascript/bigIntLiterals/octal.src.js | 1 - .../javascript/binaryLiterals/invalid.src.js | 1 - .../binaryLiterals/lowercase.src.js | 1 - .../binaryLiterals/uppercase.src.js | 1 - .../javascript/blockBindings/const.src.js | 1 - .../blockBindings/let-in-switchcase.src.js | 1 - .../javascript/blockBindings/let.src.js | 1 - .../call-expression-with-array.src.js | 1 - .../call-expression-with-object.src.js | 1 - .../callExpression/mixed-expression.src.js | 5 - .../new-expression-with-array.src.js | 2 - .../new-expression-with-object.src.js | 2 - .../classes/class-accessor-properties.src.js | 1 - .../class-computed-static-method.src.js | 1 - .../classes/class-expression.src.js | 1 - .../class-method-named-prototype.src.js | 1 - .../classes/class-method-named-static.src.js | 1 - .../class-method-named-with-space.src.js | 1 - .../classes/class-one-method-super.src.js | 5 - .../classes/class-one-method.src.js | 3 - .../class-private-identifier-accessor.src.js | 8 - .../class-private-identifier-field.src.js | 8 - .../class-private-identifier-method.src.js | 7 - ...class-static-method-named-prototype.src.js | 1 - .../class-static-method-named-static.src.js | 1 - .../classes/class-static-method.src.js | 1 - ...tic-methods-and-accessor-properties.src.js | 1 - .../class-two-computed-static-methods.src.js | 1 - ...ss-two-methods-computed-constructor.src.js | 1 - .../classes/class-two-methods-semi.src.js | 1 - .../class-two-methods-three-semi.src.js | 1 - .../classes/class-two-methods-two-semi.src.js | 1 - .../classes/class-two-methods.src.js | 1 - ...wo-static-methods-named-constructor.src.js | 1 - .../class-with-constructor-parameters.src.js | 1 - .../class-with-constructor-with-space.src.js | 1 - .../classes/class-with-constructor.src.js | 1 - .../classes/class-with-no-body.src.js | 1 - .../derived-class-assign-to-var.src.js | 1 - .../classes/derived-class-expression.src.js | 1 - .../classes/empty-class-double-semi.src.js | 1 - .../classes/empty-class-semi.src.js | 1 - .../javascript/classes/empty-class.src.js | 1 - .../empty-literal-derived-class.src.js | 1 - .../classes/invalid-class-declaration.src.js | 1 - .../invalid-class-setter-declaration.src.js | 1 - .../invalid-class-two-super-classes.src.js | 1 - .../classes/named-class-expression.src.js | 1 - .../named-derived-class-expression.src.js | 1 - .../comma-operator-conditional.src.js | 1 - .../commaOperator/comma-operator-multi.src.js | 1 - .../comma-operator-nested.src.js | 1 - .../comma-operator-return.src.js | 4 - .../comma-operator-simple-nested.src.js | 1 - .../comma-operator-simple.src.js | 1 - .../defaultParams/class-constructor.src.js | 4 - .../defaultParams/class-method.src.js | 4 - .../defaultParams/declaration.src.js | 1 - .../defaultParams/expression.src.js | 1 - .../javascript/defaultParams/method.src.js | 1 - .../defaultParams/not-all-params.src.js | 1 - .../arrow-param-array.src.js | 1 - .../arrow-param-nested-array.src.js | 1 - .../arrow-param-nested-object-named.src.js | 1 - .../arrow-param-nested-object.src.js | 1 - .../arrow-param-object.src.js | 1 - .../param-defaults-array.src.js | 1 - .../param-defaults-object-nested.src.js | 1 - .../param-defaults-object.src.js | 1 - .../array-const-undefined.src.js | 1 - .../array-let-undefined.src.js | 1 - .../object-const-named.src.js | 1 - .../object-const-undefined.src.js | 1 - .../object-let-named.src.js | 1 - .../object-let-undefined.src.js | 1 - .../param-array.src.js | 1 - .../param-object-short.src.js | 1 - .../param-object-wrapped.src.js | 1 - .../param-object.src.js | 1 - .../destructuring-and-forOf/loop.src.js | 1 - .../complex-destructured.src.js | 1 - .../destructured-array-literal.src.js | 1 - .../destructuring-param.src.js | 1 - ...r-complex-destructured-spread-first.src.js | 1 - .../invalid-not-final-array-empty.src.js | 1 - .../multi-destructured.src.js | 1 - .../not-final-array.src.js | 1 - .../single-destructured.src.js | 1 - .../var-complex-destructured.src.js | 1 - .../var-destructured-array-literal.src.js | 1 - .../var-multi-destructured.src.js | 1 - .../var-single-destructured.src.js | 1 - .../destructuring/array-member.src.js | 1 - .../destructuring/array-to-array.src.js | 1 - .../destructuring/array-var-undefined.src.js | 1 - .../call-expression-destruction-array.src.js | 1 - .../call-expression-destruction-object.src.js | 1 - .../class-constructor-params-array.src.js | 4 - ...s-constructor-params-defaults-array.src.js | 4 - ...-constructor-params-defaults-object.src.js | 4 - .../class-constructor-params-object.src.js | 4 - .../class-method-params-array.src.js | 4 - .../class-method-params-defaults-array.src.js | 4 - ...class-method-params-defaults-object.src.js | 4 - .../class-method-params-object.src.js | 4 - .../destructuring/defaults-array-all.src.js | 1 - ...efaults-array-longform-nested-multi.src.js | 1 - .../destructuring/defaults-array-multi.src.js | 1 - .../defaults-array-nested-all.src.js | 1 - .../defaults-array-nested-multi.src.js | 1 - .../destructuring/defaults-array.src.js | 1 - .../destructuring/defaults-object-all.src.js | 1 - .../defaults-object-assign.src.js | 1 - .../defaults-object-longform-all.src.js | 1 - .../defaults-object-longform-multi.src.js | 1 - .../defaults-object-longform.src.js | 1 - .../defaults-object-mixed-multi.src.js | 1 - .../defaults-object-multi.src.js | 1 - .../defaults-object-nested-all.src.js | 1 - .../defaults-object-nested-multi.src.js | 1 - .../destructuring/defaults-object.src.js | 1 - .../destructured-array-catch.src.js | 7 - .../destructured-object-catch.src.js | 7 - .../invalid-defaults-object-assign.src.js | 1 - .../destructuring/named-param.src.js | 1 - .../destructuring/nested-array.src.js | 1 - .../destructuring/nested-object.src.js | 1 - .../destructuring/object-var-named.src.js | 1 - .../destructuring/object-var-undefined.src.js | 1 - .../destructuring/param-defaults-array.src.js | 1 - .../param-defaults-object-nested.src.js | 1 - .../param-defaults-object.src.js | 1 - .../destructuring/params-array-wrapped.src.js | 1 - .../destructuring/params-array.src.js | 1 - .../destructuring/params-multi-object.src.js | 1 - .../destructuring/params-nested-array.src.js | 1 - .../destructuring/params-nested-object.src.js | 1 - .../params-object-wrapped.src.js | 1 - .../destructuring/params-object.src.js | 1 - .../destructuring/sparse-array.src.js | 1 - .../javascript/directives/block.src.js | 5 - .../directives/directive-in-class.src.js | 19 - .../directives/first-expression.src.js | 4 - .../directives/function-non-strict.src.js | 4 - .../directives/non-directive-string.src.js | 16 - .../directives/non-unique-directive.src.js | 3 - .../directives/program-order.src.js | 3 - .../javascript/directives/program.src.js | 3 - .../fixtures/javascript/directives/raw.src.js | 1 - .../async-generators.src.js | 3 - .../async-iterator.src.js | 5 - .../dynamic-import.src.js | 1 - .../error-dynamic-import-params.src.js | 1 - .../arg-spread.src.js | 1 - .../destructuring-assign-mirror.src.js | 1 - .../function-parameter-object-spread.src.js | 1 - .../invalid-rest-trailing-comma.src.js | 1 - .../invalid-rest.src.js | 1 - .../object-rest.src.js | 1 - .../property-spread.src.js | 9 - .../shorthand-method-args.src.js | 5 - .../shorthand-methods.src.js | 5 - .../shorthand-properties.src.js | 9 - .../single-spread.src.js | 9 - .../spread-trailing-comma.src.js | 1 - .../two-spread.src.js | 9 - .../optional-catch-binding-finally.src.js | 1 - .../optional-catch-binding.src.js | 1 - .../exponential-operators.src.js | 2 - .../fixtures/javascript/for/for-empty.src.js | 1 - .../fixtures/javascript/for/for-loop.src.js | 1 - .../javascript/for/for-with-coma.src.js | 4 - .../javascript/for/for-with-const.src.js | 3 - .../javascript/for/for-with-function.src.js | 1 - .../javascript/for/for-with-let.src.js | 3 - .../javascript/forIn/for-in-array.src.js | 1 - .../forIn/for-in-bare-nonstrict.src.js | 6 - .../forIn/for-in-destruction-object.src.js | 1 - .../forIn/for-in-destruction.src.js | 1 - .../forIn/for-in-object-with-body.src.js | 1 - .../javascript/forIn/for-in-object.src.js | 1 - .../forIn/for-in-with-assigment.src.js | 1 - .../forIn/for-in-with-bare-assigment.src.js | 1 - .../javascript/forIn/for-in-with-const.src.js | 1 - .../forIn/for-in-with-milti-asigment.src.js | 1 - .../javascript/forIn/for-in-with-rest.src.js | 2 - .../javascript/forIn/for-in-with-var.src.js | 1 - .../javascript/forOf/for-of-array.src.js | 2 - .../forOf/for-of-destruction-object.src.js | 1 - .../forOf/for-of-destruction.src.js | 1 - .../javascript/forOf/for-of-object.src.js | 2 - .../for-of-with-function-initializer.src.js | 1 - .../javascript/forOf/for-of-with-rest.src.js | 2 - .../forOf/for-of-with-var-and-braces.src.js | 3 - .../for-of-with-var-and-no-braces.src.js | 2 - ...lid-for-of-with-const-and-no-braces.src.js | 2 - ...valid-for-of-with-let-and-no-braces.src.js | 2 - .../function/function-with-return.js | 3 - .../function/return-multiline-sequence.src.js | 7 - .../function/return-sequence.src.js | 3 - .../generators/anonymous-generator.src.js | 1 - .../async-generator-function.src.js | 4 - .../generators/async-generator-method.src.js | 5 - .../javascript/generators/double-yield.src.js | 1 - .../empty-generator-declaration.src.js | 1 - .../generators/generator-declaration.src.js | 1 - .../generators/yield-delegation.src.js | 1 - .../yield-without-value-in-call.src.js | 1 - .../yield-without-value-no-semi.src.js | 1 - .../generators/yield-without-value.src.js | 1 - .../globalReturn/return-identifier.src.js | 1 - .../globalReturn/return-no-arg.src.js | 1 - .../globalReturn/return-true.src.js | 1 - .../javascript/hexLiterals/invalid.src.js | 1 - .../javascript/hexLiterals/lowercase.src.js | 1 - .../javascript/hexLiterals/uppercase.src.js | 1 - .../importMeta/simple-import-meta.src.js | 1 - .../javascript/labels/label-break.src.js | 5 - .../javascript/labels/label-continue.src.js | 5 - .../javascript/modules/error-delete.src.js | 2 - .../javascript/modules/error-function.src.js | 4 - .../javascript/modules/error-strict.src.js | 5 - .../export-async-named-function.src.js | 1 - .../javascript/modules/export-const.src.js | 1 - .../modules/export-default-array.src.js | 1 - ...export-default-async-named-function.src.js | 1 - .../modules/export-default-class.src.js | 3 - .../modules/export-default-expression.src.js | 1 - .../modules/export-default-function.src.js | 1 - .../modules/export-default-named-class.src.js | 3 - .../export-default-named-function.src.js | 1 - .../modules/export-default-number.src.js | 1 - .../modules/export-default-object.src.js | 1 - .../modules/export-default-value.src.js | 1 - .../modules/export-from-batch.src.js | 1 - .../modules/export-from-default.src.js | 1 - .../export-from-named-as-default.src.js | 1 - .../export-from-named-as-specifier.src.js | 1 - .../export-from-named-as-specifiers.src.js | 1 - .../modules/export-from-specifier.src.js | 1 - .../modules/export-from-specifiers.src.js | 1 - .../javascript/modules/export-function.src.js | 1 - .../javascript/modules/export-let.src.js | 1 - .../modules/export-named-as-default.src.js | 1 - .../modules/export-named-as-specifier.src.js | 1 - .../modules/export-named-as-specifiers.src.js | 1 - .../modules/export-named-class.src.js | 3 - .../modules/export-named-empty.src.js | 1 - .../modules/export-named-specifier.src.js | 1 - .../export-named-specifiers-comma.src.js | 1 - .../modules/export-named-specifiers.src.js | 1 - .../export-var-anonymous-function.src.js | 1 - .../modules/export-var-number.src.js | 1 - .../javascript/modules/export-var.src.js | 1 - ...import-default-and-named-specifiers.src.js | 1 - ...rt-default-and-namespace-specifiers.src.js | 1 - .../modules/import-default-as.src.js | 1 - .../javascript/modules/import-default.src.js | 1 - .../javascript/modules/import-jquery.src.js | 1 - .../javascript/modules/import-module.src.js | 1 - .../modules/import-named-as-specifier.src.js | 1 - .../modules/import-named-as-specifiers.src.js | 1 - .../modules/import-named-empty.src.js | 1 - .../modules/import-named-specifier.src.js | 1 - .../import-named-specifiers-comma.src.js | 1 - .../modules/import-named-specifiers.src.js | 1 - .../modules/import-namespace-specifier.src.js | 1 - .../modules/import-null-as-nil.src.js | 1 - .../javascript/modules/invalid-await.src.js | 1 - .../javascript/modules/invalid-class.src.js | 1 - ...id-export-batch-missing-from-clause.src.js | 1 - .../modules/invalid-export-batch-token.src.js | 1 - .../invalid-export-default-equal.src.js | 1 - .../invalid-export-default-token.src.js | 1 - .../modules/invalid-export-default.src.js | 1 - .../invalid-export-module-specifier.src.js | 1 - .../invalid-export-named-default.src.js | 1 - .../invalid-export-named-extra-comma.src.js | 1 - .../invalid-export-named-middle-comma.src.js | 1 - ...t-default-after-named-after-default.src.js | 1 - .../invalid-import-default-after-named.src.js | 1 - ...rt-default-missing-module-specifier.src.js | 1 - ...lid-import-default-module-specifier.src.js | 1 - .../modules/invalid-import-default.src.js | 1 - ...lid-import-missing-module-specifier.src.js | 1 - .../invalid-import-module-specifier.src.js | 1 - .../invalid-import-named-after-named.src.js | 1 - ...nvalid-import-named-after-namespace.src.js | 1 - ...nvalid-import-named-as-missing-from.src.js | 1 - .../invalid-import-named-extra-comma.src.js | 1 - .../invalid-import-named-middle-comma.src.js | 1 - ...nvalid-import-namespace-after-named.src.js | 1 - ...invalid-import-namespace-missing-as.src.js | 1 - .../newTarget/invalid-new-target.src.js | 1 - .../newTarget/invalid-unknown-property.src.js | 1 - .../newTarget/simple-new-target.src.js | 3 - .../object-literal-in-lhs.src.js | 1 - .../computed-addition-property.src.js | 3 - .../computed-and-identifier.src.js | 1 - .../computed-getter-and-setter.src.js | 1 - .../computed-string-property.src.js | 3 - .../computed-variable-property.src.js | 3 - .../invalid-computed-variable-property.src.js | 3 - ...andalone-computed-variable-property.src.js | 1 - ...standalone-expression-with-addition.src.js | 1 - .../standalone-expression-with-method.src.js | 1 - .../standalone-expression.src.js | 1 - .../error-proto-property.src.js | 8 - .../error-proto-string-property.src.js | 8 - .../strict-duplicate-properties.src.js | 6 - .../strict-duplicate-string-properties.src.js | 6 - .../invalid-method-no-braces.src.js | 3 - .../method-property.src.js | 5 - .../simple-method-named-get.src.js | 4 - .../simple-method-named-set.src.js | 4 - .../simple-method-with-argument.src.js | 5 - .../simple-method-with-string-name.src.js | 4 - .../simple-method.src.js | 4 - .../string-name-method-property.src.js | 5 - .../shorthand-properties.src.js | 9 - .../javascript/octalLiterals/invalid.src.js | 1 - .../javascript/octalLiterals/legacy.src.js | 1 - .../javascript/octalLiterals/lowercase.src.js | 1 - .../octalLiterals/strict-uppercase.src.js | 2 - .../javascript/octalLiterals/uppercase.src.js | 1 - .../javascript/regex/regexp-simple.src.js | 1 - .../regexUFlag/regex-u-extended-escape.src.js | 1 - .../regex-u-invalid-extended-escape.src.js | 1 - .../regexUFlag/regex-u-simple.src.js | 1 - .../regexYFlag/regexp-y-simple.src.js | 1 - .../javascript/restParams/basic-rest.src.js | 1 - .../restParams/class-constructor.src.js | 4 - .../javascript/restParams/class-method.src.js | 4 - .../restParams/error-no-default.src.js | 1 - .../restParams/error-not-last.src.js | 1 - .../restParams/func-expression-multi.src.js | 1 - .../restParams/func-expression.src.js | 1 - .../restParams/invalid-rest-param.src.js | 1 - .../javascript/restParams/single-rest.src.js | 1 - .../literal-float-negative.src.js | 1 - .../simple-literals/literal-float.src.js | 1 - .../simple-literals/literal-null.src.js | 1 - .../literal-number-negative.src.js | 1 - .../simple-literals/literal-number.src.js | 1 - .../simple-literals/literal-string.src.js | 1 - .../simple-literals/literal-undefined.src.js | 1 - .../javascript/spread/complex-spread.src.js | 1 - .../javascript/spread/error-invalid-if.src.js | 1 - .../spread/error-invalid-sequence.src.js | 1 - .../spread/multi-function-call.src.js | 1 - .../javascript/spread/not-final-param.src.js | 1 - .../spread/simple-function-call.src.js | 1 - .../templateStrings/deeply-nested.src.js | 1 - .../error-octal-literal.src.js | 1 - .../templateStrings/escape-characters.src.js | 1 - .../templateStrings/expressions.src.js | 4 - .../multi-line-template-string.src.js | 6 - .../simple-template-string.src.js | 1 - .../templateStrings/single-dollar-sign.src.js | 1 - .../tagged-no-placeholders.src.js | 1 - .../tagged-template-string.src.js | 4 - .../basic-string-literal.src.js | 1 - .../complex-string-literal.src.js | 1 - .../unicodeCodePointEscapes/ignored.src.js | 9 - .../invalid-empty-escape.src.js | 1 - .../invalid-too-large-escape.src.js | 1 - .../self-closing-tag-inside-tag.src.js | 3 - .../jsx-useJSXTextNode/test-content.src.js | 1 - .../fixtures/jsx/attributes.src.js | 1 - .../fixtures/jsx/element-keyword-name.src.js | 5 - .../fixtures/jsx/embedded-comment.src.js | 1 - .../fixtures/jsx/embedded-conditional.src.js | 1 - .../jsx/embedded-invalid-js-identifier.src.js | 1 - .../fixtures/jsx/embedded-tags.src.js | 1 - .../fixtures/jsx/empty-placeholder.src.js | 1 - .../jsx/escape-patterns-ignored.src.js | 9 - .../jsx/escape-patterns-unknown.src.js | 6 - .../fixtures/jsx/escape-patterns-valid.src.js | 3 - .../fixtures/jsx/escape-patters-multi.src.js | 1 - .../invalid-attribute-missing-equals.src.js | 1 - .../fixtures/jsx/invalid-attribute.src.js | 1 - .../fixtures/jsx/invalid-broken-tag.src.js | 1 - .../jsx/invalid-computed-end-tag-name.src.js | 1 - ...nvalid-computed-string-end-tag-name.src.js | 1 - .../jsx/invalid-embedded-expression.src.js | 1 - .../jsx/invalid-leading-dot-tag-name.src.js | 1 - ...matching-placeholder-in-closing-tag.src.js | 1 - .../jsx/invalid-mismatched-closing-tag.src.js | 1 - .../invalid-mismatched-closing-tags.src.js | 1 - .../invalid-mismatched-dot-tag-name.src.js | 1 - .../invalid-mismatched-namespace-tag.src.js | 1 - ...g-closing-tag-attribute-placeholder.src.js | 1 - .../jsx/invalid-missing-closing-tag.src.js | 1 - .../jsx/invalid-missing-namespace-name.src.js | 1 - .../invalid-missing-namespace-value.src.js | 1 - .../invalid-missing-spread-operator.src.js | 1 - .../invalid-namespace-name-with-docts.src.js | 1 - .../invalid-namespace-value-with-dots.src.js | 1 - ...valid-no-common-parent-with-comment.src.js | 1 - .../jsx/invalid-no-common-parent.src.js | 1 - .../fixtures/jsx/invalid-no-tag-name.src.js | 1 - .../invalid-placeholder-in-closing-tag.src.js | 1 - ...valid-shorthand-fragment-no-closing.src.js | 1 - .../jsx/invalid-trailing-dot-tag-name.src.js | 1 - .../jsx/invalid-unexpected-comma.src.js | 1 - .../fixtures/jsx/japanese-characters.src.js | 1 - .../fixtures/jsx/less-than-operator.src.js | 1 - .../jsx/member-expression-private.src.js | 1 - .../jsx/member-expression-this.src.js | 2 - .../fixtures/jsx/member-expression.src.js | 1 - .../fixtures/jsx/multiple-blank-spaces.src.js | 1 - .../fixtures/jsx/namespace-this-name.src.js | 1 - ...spaced-attribute-and-value-inserted.src.js | 1 - .../jsx/namespaced-name-and-attribute.src.js | 1 - .../jsx/newslines-and-entities.src.js | 1 - .../jsx/self-closing-tag-inside-tag.src.js | 3 - .../jsx/self-closing-tag-with-newline.src.js | 1 - .../fixtures/jsx/self-closing-tag.src.js | 1 - .../jsx/shorthand-fragment-with-child.src.js | 1 - .../fixtures/jsx/shorthand-fragment.src.js | 1 - .../fixtures/jsx/spread-child.src.js | 1 - ...tor-attribute-and-regular-attribute.src.js | 1 - .../jsx/spread-operator-attributes.src.js | 1 - .../fixtures/jsx/tag-names-with-dots.src.js | 1 - .../tag-names-with-multi-dots-multi.src.js | 3 - .../jsx/tag-names-with-multi-dots.src.js | 1 - .../fixtures/jsx/test-content.src.js | 1 - .../trailing-spread-operator-attribute.src.js | 1 - .../fixtures/tsx/generic-jsx-element.src.tsx | 1 - ...eric-jsx-member-expression-private.src.tsx | 1 - .../tsx/generic-jsx-opening-element.src.tsx | 1 - .../fixtures/tsx/react-typed-props.src.tsx | 12 - .../type-parameter-whitespace-loc.src.ts | 1 - .../type-parameters.src.ts | 1 - ...act-class-with-abstract-constructor.src.ts | 3 - ...abstract-class-with-abstract-method.src.ts | 3 - ...ract-class-with-abstract-properties.src.ts | 4 - ...ass-with-abstract-readonly-property.src.ts | 3 - ...ss-with-abstract-static-constructor.src.ts | 3 - ...tract-class-with-declare-properties.src.ts | 7 - ...abstract-class-with-optional-method.src.ts | 3 - ...abstract-class-with-override-method.src.ts | 3 - ...stract-class-with-override-property.src.ts | 3 - .../basics/abstract-interface.src.ts | 2 - ...acket-type-assertion-arrow-function.src.ts | 1 - .../angle-bracket-type-assertion.src.ts | 1 - ...ow-function-with-optional-parameter.src.ts | 1 - ...arrow-function-with-type-parameters.src.ts | 3 - .../basics/async-function-expression.src.ts | 2 - ...async-function-with-var-declaration.src.ts | 5 - .../await-without-async-function.src.ts | 4 - .../call-signatures-with-generics.src.ts | 4 - .../typescript/basics/call-signatures.src.ts | 4 - .../basics/cast-as-expression.src.ts | 1 - .../basics/cast-as-multi-assign.src.ts | 1 - .../typescript/basics/cast-as-multi.src.ts | 1 - .../typescript/basics/cast-as-operator.src.ts | 1 - .../typescript/basics/cast-as-simple.src.ts | 1 - .../catch-clause-with-annotation.src.ts | 11 - ...atch-clause-with-invalid-annotation.src.ts | 5 - .../class-multi-line-keyword-abstract.src.ts | 2 - .../class-multi-line-keyword-declare.src.ts | 2 - ...fier-field-with-accessibility-error.src.ts | 5 - ...te-identifier-field-with-annotation.src.ts | 8 - ...s-private-identifier-readonly-field.src.ts | 3 - .../basics/class-static-blocks.src.ts | 8 - .../class-with-accessibility-modifiers.src.ts | 10 - ...class-with-constructor-and-modifier.src.ts | 5 - ...d-parameter-property-with-modifiers.src.ts | 3 - ...ter-proptery-with-override-modifier.src.ts | 5 - ...ss-with-constructor-and-return-type.src.ts | 5 - ...ith-constructor-and-type-parameters.src.ts | 5 - .../class-with-declare-properties.src.ts | 9 - .../class-with-definite-assignment.src.ts | 3 - ...ss-with-export-parameter-properties.src.ts | 6 - .../class-with-extends-and-implements.src.ts | 1 - ...class-with-extends-generic-multiple.src.ts | 3 - .../basics/class-with-extends-generic.src.ts | 3 - .../class-with-generic-method-default.src.ts | 3 - .../basics/class-with-generic-method.src.ts | 3 - .../class-with-implements-and-extends.src.ts | 1 - ...ss-with-implements-generic-multiple.src.ts | 3 - .../class-with-implements-generic.src.ts | 3 - .../basics/class-with-implements.src.ts | 3 - .../basics/class-with-method.src.ts | 5 - .../basics/class-with-mixin-reference.src.ts | 2 - .../typescript/basics/class-with-mixin.src.ts | 9 - ...class-with-optional-computed-method.src.ts | 17 - ...ass-with-optional-computed-property.src.ts | 3 - .../basics/class-with-optional-methods.src.ts | 5 - .../class-with-optional-properties.src.ts | 13 - ...ss-with-optional-property-undefined.src.ts | 4 - .../basics/class-with-override-method.src.ts | 5 - .../class-with-override-property.src.ts | 3 - ...lass-with-private-optional-property.src.ts | 5 - ...s-with-private-parameter-properties.src.ts | 6 - .../class-with-property-function.src.ts | 4 - .../basics/class-with-property-values.src.ts | 7 - ...with-protected-parameter-properties.src.ts | 6 - ...ss-with-public-parameter-properties.src.ts | 6 - ...-with-readonly-parameter-properties.src.ts | 4 - .../class-with-readonly-property.src.ts | 3 - ...ss-with-static-parameter-properties.src.ts | 7 - ...th-two-methods-computed-constructor.src.ts | 7 - .../class-with-type-parameter-default.src.ts | 3 - ...lass-with-type-parameter-underscore.src.ts | 1 - .../basics/class-with-type-parameter.src.ts | 3 - .../typescript/basics/const-assertions.src.ts | 17 - .../typescript/basics/const-enum.src.ts | 4 - .../declare-class-with-optional-method.src.ts | 3 - .../typescript/basics/declare-function.src.ts | 1 - .../destructuring-assignment-nested.src.ts | 1 - .../destructuring-assignment-object.src.ts | 1 - .../destructuring-assignment-property.src.ts | 3 - .../basics/destructuring-assignment.src.ts | 1 - .../basics/directive-in-module.src.ts | 5 - .../basics/directive-in-namespace.src.ts | 5 - ...namic-import-with-import-assertions.src.ts | 1 - .../export-all-with-import-assertions.src.ts | 1 - .../basics/export-as-namespace.src.ts | 1 - .../basics/export-assignment.src.ts | 1 - .../export-declare-const-named-enum.src.ts | 4 - .../basics/export-declare-named-enum.src.ts | 4 - .../export-default-class-with-generic.src.ts | 3 - ...efault-class-with-multiple-generics.src.ts | 3 - .../basics/export-default-interface.src.ts | 3 - .../export-named-class-with-generic.src.ts | 3 - ...-named-class-with-multiple-generics.src.ts | 3 - .../export-named-enum-computed-number.src.ts | 3 - .../export-named-enum-computed-string.src.ts | 3 - .../export-named-enum-computed-var-ref.src.ts | 3 - .../basics/export-named-enum.src.ts | 4 - .../basics/export-star-as-ns-from.src.ts | 1 - .../typescript/basics/export-type-as.src.ts | 1 - .../basics/export-type-from-as.src.ts | 1 - .../typescript/basics/export-type-from.src.ts | 1 - .../basics/export-type-star-from.src.ts | 1 - .../typescript/basics/export-type.src.ts | 1 - .../export-with-import-assertions.src.ts | 1 - ...ction-anonymus-with-type-parameters.src.ts | 3 - .../function-anynomus-with-return-type.src.ts | 2 - .../basics/function-overloads.src.ts | 5 - .../basics/function-with-await.src.ts | 3 - ...bject-type-with-optional-properties.src.ts | 3 - ...with-object-type-without-annotation.src.ts | 3 - ...-type-parameters-that-have-comments.src.ts | 1 - ...ith-type-parameters-with-constraint.src.ts | 3 - .../function-with-type-parameters.src.ts | 3 - .../function-with-types-assignation.src.ts | 3 - .../basics/function-with-types.src.ts | 3 - .../typescript/basics/global-this.src.ts | 12 - .../basics/import-equal-declaration.src.ts | 1 - .../import-equal-type-declaration.src.ts | 1 - .../import-export-equal-declaration.src.ts | 1 - ...mport-export-equal-type-declaration.src.ts | 1 - .../basics/import-type-default.src.ts | 1 - .../basics/import-type-empty.src.ts | 2 - .../basics/import-type-error.src.ts | 1 - .../basics/import-type-named-as.src.ts | 1 - .../basics/import-type-named.src.ts | 1 - .../basics/import-type-star-as-ns.src.ts | 1 - .../import-with-import-assertions.src.ts | 1 - .../basics/interface-extends-multiple.src.ts | 3 - .../basics/interface-extends.src.ts | 3 - .../basics/interface-type-parameters.src.ts | 3 - .../interface-with-all-property-types.src.ts | 14 - ...nature-with-parameter-accessibility.src.ts | 3 - ...face-with-extends-member-expression.src.ts | 2 - ...erface-with-extends-type-parameters.src.ts | 3 - .../basics/interface-with-generic.src.ts | 2 - .../basics/interface-with-jsdoc.src.ts | 7 - .../basics/interface-with-method.src.ts | 4 - .../interface-with-optional-properties.src.ts | 5 - .../interface-without-type-annotation.src.ts | 3 - .../basics/intrinsic-keyword.src.ts | 4 - .../typescript/basics/keyof-operator.src.ts | 1 - .../basics/keyword-variables.src.ts | 77 - .../basics/nested-type-arguments.src.ts | 1 - .../typescript/basics/never-type-param.src.ts | 2 - .../new-target-in-arrow-function-body.src.ts | 1 - .../basics/non-null-assertion-operator.src.ts | 4 - ...null-and-undefined-type-annotations.src.ts | 2 - .../basics/nullish-coalescing.src.ts | 3 - .../object-with-escaped-properties.src.ts | 7 - .../basics/object-with-typed-methods.src.ts | 13 - ...-chain-call-with-non-null-assertion.src.ts | 8 - .../optional-chain-call-with-parens.src.ts | 13 - .../basics/optional-chain-call.src.ts | 13 - ...ment-access-with-non-null-assertion.src.ts | 8 - ...al-chain-element-access-with-parens.src.ts | 8 - .../optional-chain-element-access.src.ts | 8 - ...ional-chain-with-non-null-assertion.src.ts | 5 - .../basics/optional-chain-with-parens.src.ts | 8 - .../typescript/basics/optional-chain.src.ts | 7 - .../basics/parenthesized-use-strict.src.ts | 2 - .../basics/private-fields-in-in.src.ts | 6 - .../typescript/basics/readonly-arrays.src.ts | 9 - .../typescript/basics/readonly-tuples.src.ts | 4 - ...short-circuiting-assignment-and-and.src.ts | 1 - .../short-circuiting-assignment-or-or.src.ts | 1 - ...uiting-assignment-question-question.src.ts | 1 - .../basics/symbol-type-param.src.ts | 1 - ...as-declaration-export-function-type.src.ts | 1 - ...lias-declaration-export-object-type.src.ts | 3 - .../type-alias-declaration-export.src.ts | 1 - ...ion-with-constrained-type-parameter.src.ts | 1 - .../basics/type-alias-declaration.src.ts | 1 - ...ype-alias-object-without-annotation.src.ts | 1 - .../type-assertion-in-arrow-function.src.ts | 3 - .../basics/type-assertion-in-function.src.ts | 3 - .../basics/type-assertion-in-interface.src.ts | 3 - .../basics/type-assertion-in-method.src.ts | 8 - ...ertion-with-guard-in-arrow-function.src.ts | 3 - ...pe-assertion-with-guard-in-function.src.ts | 3 - ...e-assertion-with-guard-in-interface.src.ts | 3 - ...type-assertion-with-guard-in-method.src.ts | 8 - .../type-guard-in-arrow-function.src.ts | 3 - .../basics/type-guard-in-function.src.ts | 3 - .../basics/type-guard-in-interface.src.ts | 3 - .../basics/type-guard-in-method.src.ts | 8 - ...h-type-parameters-in-type-reference.src.ts | 1 - .../typescript/basics/type-import-type.src.ts | 2 - .../basics/type-only-export-specifiers.src.ts | 1 - .../basics/type-only-import-specifiers.src.ts | 1 - .../type-parameters-comments-heritage.src.ts | 4 - .../basics/type-parameters-comments.src.ts | 3 - .../basics/type-reference-comments.src.ts | 3 - .../basics/typed-keyword-bigint.src.ts | 1 - .../basics/typed-keyword-boolean.src.ts | 1 - .../basics/typed-keyword-false.src.ts | 1 - .../basics/typed-keyword-never.src.ts | 1 - .../basics/typed-keyword-null.src.ts | 1 - .../basics/typed-keyword-number.src.ts | 1 - .../basics/typed-keyword-object.src.ts | 1 - .../basics/typed-keyword-string.src.ts | 1 - .../basics/typed-keyword-symbol.src.ts | 1 - .../basics/typed-keyword-true.src.ts | 1 - .../basics/typed-keyword-undefined.src.ts | 1 - .../basics/typed-keyword-unknown.src.ts | 1 - .../basics/typed-keyword-void.src.ts | 1 - .../basics/typed-method-signature.src.ts | 4 - .../typescript/basics/typed-this.src.ts | 3 - .../basics/union-intersection.src.ts | 9 - .../typescript/basics/unique-symbol.src.ts | 1 - .../basics/unknown-type-annotation.src.ts | 1 - .../var-with-definite-assignment.src.ts | 3 - .../basics/var-with-dotted-type.src.ts | 1 - .../typescript/basics/var-with-type.src.ts | 2 - ...declaration-type-annotation-spacing.src.ts | 1 - .../typescript/declare/abstract-class.src.ts | 3 - .../fixtures/typescript/declare/class.src.ts | 3 - .../fixtures/typescript/declare/enum.src.ts | 4 - .../typescript/declare/function.src.ts | 1 - .../typescript/declare/interface.src.ts | 3 - .../fixtures/typescript/declare/module.src.ts | 3 - .../typescript/declare/namespace.src.ts | 3 - .../typescript/declare/type-alias.src.ts | 1 - .../typescript/declare/variable.src.ts | 1 - ...r-decorator-factory-instance-member.src.ts | 4 - ...sor-decorator-factory-static-member.src.ts | 4 - .../accessor-decorator-instance-member.src.ts | 4 - .../accessor-decorator-static-member.src.ts | 6 - .../class-decorator-factory.src.ts | 4 - .../class-decorators/class-decorator.src.ts | 2 - .../class-parameter-property.src.ts | 3 - .../export-default-class-decorator.src.ts | 2 - .../export-named-class-decorator.src.ts | 2 - ...d-decorator-factory-instance-member.src.ts | 4 - ...hod-decorator-factory-static-member.src.ts | 4 - .../method-decorator-instance-member.src.ts | 4 - .../method-decorator-static-member.src.ts | 4 - .../parameter-array-pattern-decorator.src.ts | 3 - .../parameter-decorator-constructor.src.ts | 5 - ...decorator-decorator-instance-member.src.ts | 3 - ...r-decorator-decorator-static-member.src.ts | 3 - ...parameter-decorator-instance-member.src.ts | 5 - .../parameter-decorator-static-member.src.ts | 5 - .../parameter-object-pattern-decorator.src.ts | 3 - .../parameter-rest-element-decorator.src.ts | 3 - ...y-decorator-factory-instance-member.src.ts | 5 - ...rty-decorator-factory-static-member.src.ts | 6 - .../property-decorator-instance-member.src.ts | 5 - .../property-decorator-static-member.src.ts | 5 - .../class-empty-extends-implements.src.ts | 3 - .../errorRecovery/class-empty-extends.src.ts | 3 - .../class-extends-empty-implements.src.ts | 3 - .../class-multiple-implements.src.ts | 1 - .../decorator-on-enum-declaration.src.ts | 1 - .../decorator-on-function.src.ts | 2 - .../decorator-on-interface-declaration.src.ts | 2 - .../decorator-on-variable.src.ts | 2 - ...y-type-arguments-in-call-expression.src.ts | 1 - ...ty-type-arguments-in-new-expression.src.ts | 1 - .../errorRecovery/empty-type-arguments.src.ts | 1 - ...y-type-parameters-in-arrow-function.src.ts | 1 - ...mpty-type-parameters-in-constructor.src.ts | 3 - ...e-parameters-in-function-expression.src.ts | 1 - ...type-parameters-in-method-signature.src.ts | 3 - .../empty-type-parameters-in-method.src.ts | 3 - .../empty-type-parameters.src.ts | 1 - .../errorRecovery/enum-with-keywords.src.ts | 1 - .../index-signature-parameters.src.ts | 3 - .../interface-empty-extends.src.ts | 3 - .../errorRecovery/interface-implements.src.ts | 1 - .../interface-index-signature-export.src.ts | 4 - .../interface-index-signature-private.src.ts | 4 - ...interface-index-signature-protected.src.ts | 4 - .../interface-index-signature-public.src.ts | 4 - .../interface-index-signature-static.src.ts | 4 - .../interface-method-export.src.ts | 4 - .../interface-method-private.src.ts | 4 - .../interface-method-protected.src.ts | 4 - .../interface-method-public.src.ts | 4 - .../interface-method-readonly.src.ts | 3 - .../interface-method-static.src.ts | 4 - .../interface-multiple-extends.src.ts | 1 - .../interface-property-export.src.ts | 4 - .../interface-property-private.src.ts | 4 - .../interface-property-protected.src.ts | 4 - .../interface-property-public.src.ts | 4 - .../interface-property-static.src.ts | 4 - ...terface-property-with-default-value.src.ts | 3 - .../interface-with-no-body.src.ts | 1 - ...rface-with-optional-index-signature.src.ts | 3 - .../object-assertion-not-allowed.src.ts | 1 - .../object-optional-not-allowed.src.ts | 1 - .../errorRecovery/solo-const.src.ts | 1 - .../call-expression-type-arguments.src.ts | 2 - .../instantiation-expression.src.ts | 7 - .../new-expression-type-arguments.src.ts | 1 - ...onal-call-expression-type-arguments.src.ts | 2 - ...-template-expression-type-arguments.src.ts | 1 - ...ient-module-declaration-with-import.src.ts | 3 - ...re-namespace-with-exported-function.src.ts | 3 - .../global-module-declaration.src.ts | 8 - .../module-with-default-exports.src.ts | 7 - .../nested-internal-module.src.ts | 12 - ...horthand-ambient-module-declaration.src.ts | 1 - .../typescript/types/array-type.src.ts | 1 - .../types/conditional-infer-nested.src.ts | 5 - .../types/conditional-infer-simple.src.ts | 1 - .../conditional-infer-with-constraint.src.ts | 5 - .../typescript/types/conditional-infer.src.ts | 1 - .../types/conditional-with-null.src.ts | 1 - .../typescript/types/conditional.src.ts | 1 - .../types/constructor-abstract.src.ts | 1 - .../typescript/types/constructor-empty.src.ts | 1 - .../types/constructor-generic.src.ts | 1 - .../types/constructor-in-generic.src.ts | 1 - .../types/constructor-with-rest.src.ts | 1 - .../typescript/types/constructor.src.ts | 1 - .../typescript/types/function-generic.src.ts | 1 - .../types/function-in-generic.src.ts | 1 - .../function-with-array-destruction.src.ts | 1 - .../function-with-object-destruction.src.ts | 1 - .../types/function-with-rest.src.ts | 1 - .../types/function-with-this.src.ts | 1 - .../fixtures/typescript/types/function.src.ts | 1 - .../types/index-signature-readonly.src.ts | 3 - .../types/index-signature-without-type.src.ts | 3 - .../typescript/types/index-signature.src.ts | 3 - .../fixtures/typescript/types/indexed.src.ts | 1 - .../types/interface-with-accessors.src.ts | 4 - .../typescript/types/intersection-type.src.ts | 1 - .../types/literal-number-negative.src.ts | 1 - .../typescript/types/literal-number.src.ts | 1 - .../typescript/types/literal-string.src.ts | 1 - .../typescript/types/mapped-named-type.src.ts | 3 - .../types/mapped-readonly-minus.src.ts | 1 - .../types/mapped-readonly-plus.src.ts | 1 - .../typescript/types/mapped-readonly.src.ts | 1 - .../typescript/types/mapped-untypped.src.ts | 1 - .../fixtures/typescript/types/mapped.src.ts | 1 - .../typescript/types/nested-types.src.ts | 1 - .../object-literal-type-with-accessors.src.ts | 4 - .../types/optional-variance-in-and-out.src.ts | 1 - .../types/optional-variance-in-out.src.ts | 1 - .../types/optional-variance-in.src.ts | 1 - .../types/optional-variance-out.src.ts | 1 - .../types/parenthesized-type.src.ts | 1 - .../types/reference-generic-nested.src.ts | 1 - .../typescript/types/reference-generic.src.ts | 1 - .../typescript/types/reference.src.ts | 1 - .../types/template-literal-type-1.src.ts | 1 - .../types/template-literal-type-2.src.ts | 1 - .../types/template-literal-type-3.src.ts | 3 - .../types/template-literal-type-4.src.ts | 2 - .../types/this-type-expanded.src.ts | 29 - .../typescript/types/this-type.src.ts | 5 - .../typescript/types/tuple-empty.src.ts | 1 - .../types/tuple-named-optional.src.ts | 1 - .../typescript/types/tuple-named-rest.src.ts | 1 - .../typescript/types/tuple-named-type.src.ts | 1 - .../typescript/types/tuple-named.src.ts | 1 - .../typescript/types/tuple-optional.src.ts | 1 - .../typescript/types/tuple-rest.src.ts | 1 - .../typescript/types/tuple-type.src.ts | 1 - .../fixtures/typescript/types/tuple.src.ts | 1 - .../typescript/types/type-literal.src.ts | 1 - .../typescript/types/type-operator.src.ts | 2 - .../typescript/types/typeof-this.src.ts | 2 - .../types/typeof-with-type-parameters.src.ts | 1 - .../fixtures/typescript/types/typeof.src.ts | 1 - .../types/union-intersection.src.ts | 4 - .../typescript/types/union-type.src.ts | 1 - packages/shared-fixtures/package.json | 6 - packages/shared-fixtures/project.json | 6 - packages/typescript-estree/package.json | 1 - .../tests/ast-alignment/fixtures-to-test.ts | 537 ---- .../tests/ast-alignment/parse.ts | 131 - .../tests/ast-alignment/spec.ts | 94 - .../tests/ast-alignment/utils.ts | 358 --- .../tests/ast-fixtures.test.ts | 119 - .../semantic-diagnostics-enabled.test.ts.snap | 2771 ++++++----------- .../lib/semantic-diagnostics-enabled.test.ts | 4 +- 3324 files changed, 284141 insertions(+), 6375 deletions(-) create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-type-star-from/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-type-star-from/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-type-star-from/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-type-star-from/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/fixture.ts create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/6-AST-Alignment-Tokens.shot delete mode 100644 packages/shared-fixtures/CHANGELOG.md delete mode 100644 packages/shared-fixtures/README.md delete mode 100644 packages/shared-fixtures/fixtures/comments/block-trailing-comment.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/comment-within-condition.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/export-default-anonymous-class.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/jsdoc-comment.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/jsx-attr-and-text-with-url.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/jsx-block-comment.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/jsx-comment-after-jsx.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/jsx-comment-after-self-closing-jsx.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/jsx-generic-with-comment-in-tag.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/jsx-tag-comment-after-prop.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/jsx-tag-comments.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/jsx-text-with-multiline-non-comment.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/jsx-text-with-url.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/jsx-with-greather-than.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/jsx-with-operators.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/line-comment-with-block-syntax.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/mix-line-and-block-comments.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/no-comment-regex.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/no-comment-template.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/surrounding-call-comments.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/surrounding-debugger-comments.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/surrounding-return-comments.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/surrounding-throw-comments.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/surrounding-while-loop-comments.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/switch-fallthrough-comment-in-function.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/switch-fallthrough-comment.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/switch-no-default-comment-in-function.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/switch-no-default-comment-in-nested-functions.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/switch-no-default-comment.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/template-string-block.src.js delete mode 100644 packages/shared-fixtures/fixtures/comments/type-assertion-regression-test.src.ts delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrayLiteral/array-literal-in-lhs.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrayLiteral/array-literals-in-binary-expr.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/as-param-with-params.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/as-param.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/basic-in-binary-expression.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/basic.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/block-body-not-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/block-body.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-dup-params.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-missing-paren.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-not-arrow.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-numeric-param-multi.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-numeric-param.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-reverse-arrow.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-default-param-eval.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-dup-params.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-eval-return.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-eval.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-octal.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-param-arguments.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-param-eval.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-param-names.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-param-no-paren-arguments.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-param-no-paren-eval.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-two-lines.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-wrapped-param.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/expression.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/iife.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/multiple-params.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/no-auto-return.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/not-strict-arguments.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/not-strict-eval-params.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/not-strict-eval.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/not-strict-octal.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/return-arrow-function.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/return-sequence.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/single-param-parens.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/single-param-return-identifier.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/arrowFunctions/single-param.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/basics/and-operator-array-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/basics/delete-expression.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/basics/do-while-statements.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/basics/identifiers-double-underscore.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/basics/instanceof.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/basics/new-with-member-expression.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/basics/new-without-parens.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/basics/or-operator-array-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/basics/typeof-expression.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/basics/update-expression.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/basics/void-expression.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/bigIntLiterals/binary.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/bigIntLiterals/decimal.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/bigIntLiterals/hex.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/bigIntLiterals/numeric-separator.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/bigIntLiterals/octal.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/binaryLiterals/invalid.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/binaryLiterals/lowercase.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/binaryLiterals/uppercase.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/blockBindings/const.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/blockBindings/let-in-switchcase.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/blockBindings/let.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/callExpression/call-expression-with-array.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/callExpression/call-expression-with-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/callExpression/mixed-expression.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/callExpression/new-expression-with-array.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/callExpression/new-expression-with-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-accessor-properties.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-computed-static-method.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-expression.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-method-named-prototype.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-method-named-static.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-method-named-with-space.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-one-method-super.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-one-method.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-private-identifier-accessor.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-private-identifier-field.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-private-identifier-method.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-static-method-named-prototype.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-static-method-named-static.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-static-method.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-static-methods-and-accessor-properties.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-two-computed-static-methods.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-two-methods-computed-constructor.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-two-methods-semi.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-two-methods-three-semi.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-two-methods-two-semi.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-two-methods.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-two-static-methods-named-constructor.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-with-constructor-parameters.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-with-constructor-with-space.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-with-constructor.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/class-with-no-body.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/derived-class-assign-to-var.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/derived-class-expression.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/empty-class-double-semi.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/empty-class-semi.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/empty-class.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/empty-literal-derived-class.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/invalid-class-declaration.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/invalid-class-setter-declaration.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/invalid-class-two-super-classes.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/named-class-expression.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/classes/named-derived-class-expression.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-conditional.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-multi.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-nested.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-return.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-simple-nested.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-simple.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/defaultParams/class-constructor.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/defaultParams/class-method.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/defaultParams/declaration.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/defaultParams/expression.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/defaultParams/method.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/defaultParams/not-all-params.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-array.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-array.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-array.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-object-nested.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/array-const-undefined.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/array-let-undefined.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/object-const-named.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/object-const-undefined.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/object-let-named.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/object-let-undefined.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-defaultParams/param-array.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-defaultParams/param-object-short.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-defaultParams/param-object-wrapped.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-defaultParams/param-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-forOf/loop.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/complex-destructured.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/destructured-array-literal.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/destructuring-param.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/error-complex-destructured-spread-first.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/invalid-not-final-array-empty.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/multi-destructured.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/not-final-array.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/single-destructured.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/var-complex-destructured.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/var-destructured-array-literal.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/var-multi-destructured.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/var-single-destructured.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/array-member.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/array-to-array.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/array-var-undefined.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/call-expression-destruction-array.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/call-expression-destruction-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/class-constructor-params-array.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/class-constructor-params-defaults-array.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/class-constructor-params-defaults-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/class-constructor-params-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/class-method-params-array.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/class-method-params-defaults-array.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/class-method-params-defaults-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/class-method-params-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array-all.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array-longform-nested-multi.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array-multi.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array-nested-all.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array-nested-multi.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-all.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-assign.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-longform-all.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-longform-multi.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-longform.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-mixed-multi.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-multi.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-nested-all.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-nested-multi.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/destructured-array-catch.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/destructured-object-catch.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/invalid-defaults-object-assign.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/named-param.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/nested-array.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/nested-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/object-var-named.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/object-var-undefined.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/param-defaults-array.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/param-defaults-object-nested.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/param-defaults-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/params-array-wrapped.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/params-array.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/params-multi-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/params-nested-array.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/params-nested-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/params-object-wrapped.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/params-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/destructuring/sparse-array.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/directives/block.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/directives/directive-in-class.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/directives/first-expression.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/directives/function-non-strict.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/directives/non-directive-string.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/directives/non-unique-directive.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/directives/program-order.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/directives/program.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/directives/raw.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/experimentalAsyncIteration/async-generators.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/experimentalAsyncIteration/async-iterator.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/experimentalDynamicImport/dynamic-import.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/experimentalDynamicImport/error-dynamic-import-params.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/arg-spread.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/destructuring-assign-mirror.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/function-parameter-object-spread.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/invalid-rest-trailing-comma.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/invalid-rest.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/object-rest.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/property-spread.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/shorthand-method-args.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/shorthand-methods.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/shorthand-properties.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/single-spread.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/spread-trailing-comma.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/two-spread.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/experimentalOptionalCatchBinding/optional-catch-binding-finally.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/experimentalOptionalCatchBinding/optional-catch-binding.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/exponentiationOperators/exponential-operators.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/for/for-empty.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/for/for-loop.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/for/for-with-coma.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/for/for-with-const.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/for/for-with-function.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/for/for-with-let.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/forIn/for-in-array.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/forIn/for-in-bare-nonstrict.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/forIn/for-in-destruction-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/forIn/for-in-destruction.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/forIn/for-in-object-with-body.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/forIn/for-in-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-assigment.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-bare-assigment.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-const.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-milti-asigment.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-rest.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-var.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/forOf/for-of-array.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/forOf/for-of-destruction-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/forOf/for-of-destruction.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/forOf/for-of-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/forOf/for-of-with-function-initializer.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/forOf/for-of-with-rest.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/forOf/for-of-with-var-and-braces.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/forOf/for-of-with-var-and-no-braces.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/forOf/invalid-for-of-with-const-and-no-braces.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/forOf/invalid-for-of-with-let-and-no-braces.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/function/function-with-return.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/function/return-multiline-sequence.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/function/return-sequence.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/generators/anonymous-generator.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/generators/async-generator-function.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/generators/async-generator-method.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/generators/double-yield.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/generators/empty-generator-declaration.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/generators/generator-declaration.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/generators/yield-delegation.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/generators/yield-without-value-in-call.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/generators/yield-without-value-no-semi.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/generators/yield-without-value.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/globalReturn/return-identifier.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/globalReturn/return-no-arg.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/globalReturn/return-true.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/hexLiterals/invalid.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/hexLiterals/lowercase.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/hexLiterals/uppercase.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/importMeta/simple-import-meta.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/labels/label-break.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/labels/label-continue.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/error-delete.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/error-function.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/error-strict.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-async-named-function.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-const.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-default-array.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-default-async-named-function.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-default-class.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-default-expression.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-default-function.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-default-named-class.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-default-named-function.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-default-number.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-default-object.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-default-value.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-from-batch.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-from-default.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-from-named-as-default.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-from-named-as-specifier.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-from-named-as-specifiers.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-from-specifier.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-from-specifiers.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-function.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-let.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-named-as-default.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-named-as-specifier.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-named-as-specifiers.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-named-class.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-named-empty.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-named-specifier.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-named-specifiers-comma.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-named-specifiers.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-var-anonymous-function.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-var-number.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/export-var.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/import-default-and-named-specifiers.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/import-default-and-namespace-specifiers.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/import-default-as.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/import-default.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/import-jquery.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/import-module.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/import-named-as-specifier.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/import-named-as-specifiers.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/import-named-empty.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/import-named-specifier.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/import-named-specifiers-comma.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/import-named-specifiers.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/import-namespace-specifier.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/import-null-as-nil.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-await.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-class.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-export-batch-missing-from-clause.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-export-batch-token.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-export-default-equal.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-export-default-token.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-export-default.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-export-module-specifier.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-export-named-default.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-export-named-extra-comma.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-export-named-middle-comma.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-import-default-after-named-after-default.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-import-default-after-named.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-import-default-missing-module-specifier.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-import-default-module-specifier.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-import-default.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-import-missing-module-specifier.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-import-module-specifier.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-import-named-after-named.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-import-named-after-namespace.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-import-named-as-missing-from.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-import-named-extra-comma.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-import-named-middle-comma.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-import-namespace-after-named.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/modules/invalid-import-namespace-missing-as.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/newTarget/invalid-new-target.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/newTarget/invalid-unknown-property.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/newTarget/simple-new-target.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteral/object-literal-in-lhs.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/computed-addition-property.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/computed-and-identifier.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/computed-getter-and-setter.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/computed-string-property.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/computed-variable-property.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/invalid-computed-variable-property.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/standalone-expression-with-addition.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/standalone-expression-with-method.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/standalone-expression.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteralDuplicateProperties/error-proto-property.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteralDuplicateProperties/error-proto-string-property.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteralDuplicateProperties/strict-duplicate-properties.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/invalid-method-no-braces.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/method-property.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/simple-method-named-get.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/simple-method-named-set.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/simple-method-with-argument.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/simple-method-with-string-name.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/simple-method.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/string-name-method-property.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandProperties/shorthand-properties.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/octalLiterals/invalid.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/octalLiterals/legacy.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/octalLiterals/lowercase.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/octalLiterals/strict-uppercase.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/octalLiterals/uppercase.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/regex/regexp-simple.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/regexUFlag/regex-u-extended-escape.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/regexUFlag/regex-u-invalid-extended-escape.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/regexUFlag/regex-u-simple.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/regexYFlag/regexp-y-simple.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/restParams/basic-rest.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/restParams/class-constructor.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/restParams/class-method.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/restParams/error-no-default.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/restParams/error-not-last.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/restParams/func-expression-multi.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/restParams/func-expression.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/restParams/invalid-rest-param.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/restParams/single-rest.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/simple-literals/literal-float-negative.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/simple-literals/literal-float.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/simple-literals/literal-null.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/simple-literals/literal-number-negative.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/simple-literals/literal-number.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/simple-literals/literal-string.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/simple-literals/literal-undefined.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/spread/complex-spread.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/spread/error-invalid-if.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/spread/error-invalid-sequence.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/spread/multi-function-call.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/spread/not-final-param.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/spread/simple-function-call.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/templateStrings/deeply-nested.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/templateStrings/error-octal-literal.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/templateStrings/escape-characters.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/templateStrings/expressions.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/templateStrings/multi-line-template-string.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/templateStrings/simple-template-string.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/templateStrings/single-dollar-sign.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/templateStrings/tagged-no-placeholders.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/templateStrings/tagged-template-string.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/unicodeCodePointEscapes/basic-string-literal.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/unicodeCodePointEscapes/complex-string-literal.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/unicodeCodePointEscapes/ignored.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/unicodeCodePointEscapes/invalid-empty-escape.src.js delete mode 100644 packages/shared-fixtures/fixtures/javascript/unicodeCodePointEscapes/invalid-too-large-escape.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx-useJSXTextNode/self-closing-tag-inside-tag.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx-useJSXTextNode/test-content.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/attributes.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/element-keyword-name.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/embedded-comment.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/embedded-conditional.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/embedded-invalid-js-identifier.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/embedded-tags.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/empty-placeholder.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/escape-patterns-ignored.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/escape-patterns-unknown.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/escape-patterns-valid.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/escape-patters-multi.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-attribute-missing-equals.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-attribute.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-broken-tag.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-computed-end-tag-name.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-computed-string-end-tag-name.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-embedded-expression.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-leading-dot-tag-name.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-matching-placeholder-in-closing-tag.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-mismatched-closing-tag.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-mismatched-closing-tags.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-mismatched-dot-tag-name.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-mismatched-namespace-tag.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-missing-closing-tag-attribute-placeholder.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-missing-closing-tag.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-missing-namespace-name.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-missing-namespace-value.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-missing-spread-operator.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-namespace-name-with-docts.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-namespace-value-with-dots.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-no-common-parent-with-comment.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-no-common-parent.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-no-tag-name.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-placeholder-in-closing-tag.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-shorthand-fragment-no-closing.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-trailing-dot-tag-name.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/invalid-unexpected-comma.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/japanese-characters.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/less-than-operator.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/member-expression-private.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/member-expression-this.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/member-expression.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/multiple-blank-spaces.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/namespace-this-name.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/namespaced-attribute-and-value-inserted.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/namespaced-name-and-attribute.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/newslines-and-entities.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/self-closing-tag-inside-tag.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/self-closing-tag-with-newline.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/self-closing-tag.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/shorthand-fragment-with-child.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/shorthand-fragment.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/spread-child.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/spread-operator-attribute-and-regular-attribute.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/spread-operator-attributes.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/tag-names-with-dots.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/tag-names-with-multi-dots-multi.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/tag-names-with-multi-dots.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/test-content.src.js delete mode 100644 packages/shared-fixtures/fixtures/jsx/trailing-spread-operator-attribute.src.js delete mode 100644 packages/shared-fixtures/fixtures/tsx/generic-jsx-element.src.tsx delete mode 100644 packages/shared-fixtures/fixtures/tsx/generic-jsx-member-expression-private.src.tsx delete mode 100644 packages/shared-fixtures/fixtures/tsx/generic-jsx-opening-element.src.tsx delete mode 100644 packages/shared-fixtures/fixtures/tsx/react-typed-props.src.tsx delete mode 100644 packages/shared-fixtures/fixtures/typescript/babylon-convergence/type-parameter-whitespace-loc.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/babylon-convergence/type-parameters.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-abstract-constructor.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-abstract-method.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-abstract-properties.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-abstract-readonly-property.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-abstract-static-constructor.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-declare-properties.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-optional-method.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-override-method.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-override-property.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/abstract-interface.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/angle-bracket-type-assertion-arrow-function.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/angle-bracket-type-assertion.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/arrow-function-with-optional-parameter.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/arrow-function-with-type-parameters.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/async-function-expression.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/async-function-with-var-declaration.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/await-without-async-function.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/call-signatures-with-generics.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/call-signatures.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/cast-as-expression.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/cast-as-multi-assign.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/cast-as-multi.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/cast-as-operator.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/cast-as-simple.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/catch-clause-with-annotation.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/catch-clause-with-invalid-annotation.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-multi-line-keyword-abstract.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-multi-line-keyword-declare.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-private-identifier-field-with-accessibility-error.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-private-identifier-field-with-annotation.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-private-identifier-readonly-field.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-static-blocks.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-accessibility-modifiers.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-constructor-and-modifier.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-constructor-and-parameter-property-with-modifiers.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-constructor-and-parameter-proptery-with-override-modifier.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-constructor-and-return-type.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-constructor-and-type-parameters.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-declare-properties.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-definite-assignment.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-export-parameter-properties.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-extends-and-implements.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-extends-generic-multiple.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-extends-generic.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-generic-method-default.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-generic-method.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-implements-and-extends.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-implements-generic-multiple.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-implements-generic.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-implements.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-method.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-mixin-reference.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-mixin.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-optional-computed-method.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-optional-computed-property.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-optional-methods.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-optional-properties.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-optional-property-undefined.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-override-method.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-override-property.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-private-optional-property.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-private-parameter-properties.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-property-function.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-property-values.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-protected-parameter-properties.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-public-parameter-properties.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-readonly-parameter-properties.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-readonly-property.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-static-parameter-properties.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-two-methods-computed-constructor.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-type-parameter-default.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-type-parameter-underscore.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/class-with-type-parameter.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/const-assertions.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/const-enum.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/declare-class-with-optional-method.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/declare-function.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/destructuring-assignment-nested.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/destructuring-assignment-object.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/destructuring-assignment-property.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/destructuring-assignment.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/directive-in-module.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/directive-in-namespace.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/dynamic-import-with-import-assertions.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/export-all-with-import-assertions.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/export-as-namespace.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/export-assignment.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/export-declare-const-named-enum.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/export-declare-named-enum.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/export-default-class-with-generic.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/export-default-class-with-multiple-generics.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/export-default-interface.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/export-named-class-with-generic.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/export-named-class-with-multiple-generics.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/export-named-enum-computed-number.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/export-named-enum-computed-string.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/export-named-enum-computed-var-ref.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/export-named-enum.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/export-star-as-ns-from.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/export-type-as.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/export-type-from-as.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/export-type-from.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/export-type-star-from.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/export-type.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/export-with-import-assertions.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/function-anonymus-with-type-parameters.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/function-anynomus-with-return-type.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/function-overloads.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/function-with-await.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/function-with-object-type-with-optional-properties.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/function-with-object-type-without-annotation.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/function-with-type-parameters-that-have-comments.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/function-with-type-parameters-with-constraint.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/function-with-type-parameters.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/function-with-types-assignation.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/function-with-types.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/global-this.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/import-equal-declaration.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/import-equal-type-declaration.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/import-export-equal-declaration.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/import-export-equal-type-declaration.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/import-type-default.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/import-type-empty.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/import-type-error.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/import-type-named-as.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/import-type-named.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/import-type-star-as-ns.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/import-with-import-assertions.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/interface-extends-multiple.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/interface-extends.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/interface-type-parameters.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/interface-with-all-property-types.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/interface-with-construct-signature-with-parameter-accessibility.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/interface-with-extends-member-expression.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/interface-with-extends-type-parameters.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/interface-with-generic.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/interface-with-jsdoc.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/interface-with-method.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/interface-with-optional-properties.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/interface-without-type-annotation.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/intrinsic-keyword.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/keyof-operator.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/keyword-variables.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/nested-type-arguments.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/never-type-param.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/new-target-in-arrow-function-body.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/non-null-assertion-operator.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/null-and-undefined-type-annotations.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/nullish-coalescing.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/object-with-escaped-properties.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/object-with-typed-methods.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/optional-chain-call-with-non-null-assertion.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/optional-chain-call-with-parens.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/optional-chain-call.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/optional-chain-element-access-with-non-null-assertion.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/optional-chain-element-access-with-parens.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/optional-chain-element-access.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/optional-chain-with-non-null-assertion.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/optional-chain-with-parens.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/optional-chain.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/parenthesized-use-strict.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/private-fields-in-in.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/readonly-arrays.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/readonly-tuples.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/short-circuiting-assignment-and-and.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/short-circuiting-assignment-or-or.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/short-circuiting-assignment-question-question.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/symbol-type-param.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-alias-declaration-export-function-type.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-alias-declaration-export-object-type.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-alias-declaration-export.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-alias-declaration-with-constrained-type-parameter.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-alias-declaration.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-alias-object-without-annotation.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-arrow-function.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-function.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-interface.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-method.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-arrow-function.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-function.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-interface.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-method.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-guard-in-arrow-function.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-guard-in-function.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-guard-in-interface.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-guard-in-method.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-import-type-with-type-parameters-in-type-reference.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-import-type.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-only-export-specifiers.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-only-import-specifiers.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-parameters-comments-heritage.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-parameters-comments.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/type-reference-comments.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-bigint.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-boolean.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-false.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-never.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-null.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-number.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-object.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-string.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-symbol.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-true.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-undefined.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-unknown.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-void.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/typed-method-signature.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/typed-this.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/union-intersection.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/unique-symbol.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/unknown-type-annotation.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/var-with-definite-assignment.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/var-with-dotted-type.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/var-with-type.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/basics/variable-declaration-type-annotation-spacing.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/declare/abstract-class.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/declare/class.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/declare/enum.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/declare/function.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/declare/interface.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/declare/module.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/declare/namespace.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/declare/type-alias.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/declare/variable.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-instance-member.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-static-member.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-instance-member.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-static-member.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/class-decorator-factory.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/class-decorator.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/class-parameter-property.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/export-default-class-decorator.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/export-named-class-decorator.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/method-decorators/method-decorator-factory-instance-member.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/method-decorators/method-decorator-factory-static-member.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/method-decorators/method-decorator-instance-member.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/method-decorators/method-decorator-static-member.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-array-pattern-decorator.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-constructor.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-instance-member.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-static-member.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-instance-member.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-static-member.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-object-pattern-decorator.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-rest-element-decorator.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/property-decorators/property-decorator-factory-instance-member.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/property-decorators/property-decorator-factory-static-member.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/property-decorators/property-decorator-instance-member.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/decorators/property-decorators/property-decorator-static-member.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/class-empty-extends-implements.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/class-empty-extends.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/class-extends-empty-implements.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/class-multiple-implements.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/decorator-on-enum-declaration.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/decorator-on-function.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/decorator-on-interface-declaration.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/decorator-on-variable.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-arguments-in-call-expression.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-arguments-in-new-expression.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-arguments.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters-in-arrow-function.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters-in-constructor.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters-in-function-expression.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters-in-method-signature.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters-in-method.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/enum-with-keywords.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/index-signature-parameters.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-empty-extends.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-implements.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-index-signature-export.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-index-signature-private.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-index-signature-protected.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-index-signature-public.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-index-signature-static.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-export.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-private.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-protected.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-public.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-readonly.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-static.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-multiple-extends.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-export.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-private.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-protected.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-public.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-static.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-with-default-value.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-with-no-body.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-with-optional-index-signature.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/object-assertion-not-allowed.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/object-optional-not-allowed.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/errorRecovery/solo-const.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/expressions/call-expression-type-arguments.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/expressions/instantiation-expression.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/expressions/new-expression-type-arguments.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/expressions/optional-call-expression-type-arguments.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/expressions/tagged-template-expression-type-arguments.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/ambient-module-declaration-with-import.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/declare-namespace-with-exported-function.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/global-module-declaration.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/module-with-default-exports.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/nested-internal-module.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/shorthand-ambient-module-declaration.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/array-type.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/conditional-infer-nested.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/conditional-infer-simple.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/conditional-infer-with-constraint.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/conditional-infer.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/conditional-with-null.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/conditional.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/constructor-abstract.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/constructor-empty.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/constructor-generic.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/constructor-in-generic.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/constructor-with-rest.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/constructor.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/function-generic.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/function-in-generic.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/function-with-array-destruction.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/function-with-object-destruction.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/function-with-rest.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/function-with-this.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/function.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/index-signature-readonly.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/index-signature-without-type.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/index-signature.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/indexed.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/interface-with-accessors.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/intersection-type.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/literal-number-negative.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/literal-number.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/literal-string.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/mapped-named-type.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/mapped-readonly-minus.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/mapped-readonly-plus.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/mapped-readonly.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/mapped-untypped.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/mapped.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/nested-types.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/object-literal-type-with-accessors.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/optional-variance-in-and-out.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/optional-variance-in-out.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/optional-variance-in.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/optional-variance-out.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/parenthesized-type.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/reference-generic-nested.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/reference-generic.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/reference.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/template-literal-type-1.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/template-literal-type-2.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/template-literal-type-3.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/template-literal-type-4.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/this-type-expanded.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/this-type.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/tuple-empty.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/tuple-named-optional.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/tuple-named-rest.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/tuple-named-type.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/tuple-named.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/tuple-optional.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/tuple-rest.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/tuple-type.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/tuple.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/type-literal.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/type-operator.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/typeof-this.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/typeof-with-type-parameters.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/typeof.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/union-intersection.src.ts delete mode 100644 packages/shared-fixtures/fixtures/typescript/types/union-type.src.ts delete mode 100644 packages/shared-fixtures/package.json delete mode 100644 packages/shared-fixtures/project.json delete mode 100644 packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts delete mode 100644 packages/typescript-estree/tests/ast-alignment/parse.ts delete mode 100644 packages/typescript-estree/tests/ast-alignment/spec.ts delete mode 100644 packages/typescript-estree/tests/ast-alignment/utils.ts delete mode 100644 packages/typescript-estree/tests/ast-fixtures.test.ts diff --git a/.eslintignore b/.eslintignore index b48d56cf8be3..1e5cc6e0083b 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,7 +2,6 @@ node_modules dist jest.config.js fixtures -shared-fixtures coverage __snapshots__ .docusaurus diff --git a/.prettierignore b/.prettierignore index edaa57ceac45..5e3434855df6 100644 --- a/.prettierignore +++ b/.prettierignore @@ -3,7 +3,6 @@ **/tests/fixture-project/**/* **/dist **/coverage -**/shared-fixtures **/.vscode **/.nyc_output **/.vs diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/fixture.ts b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/fixture.ts new file mode 100644 index 000000000000..3f5b9e3ec72e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/fixture.ts @@ -0,0 +1,8 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Point { + @configurable(false) + get x() { + return this._x; + } +} diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..0a2043175ad6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,178 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-factory-instance-member TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Literal { + type: "Literal", + raw: "false", + value: false, + + range: [103, 108], + loc: { + start: { column: 16, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "configurable", + + range: [90, 102], + loc: { + start: { column: 3, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + optional: false, + + range: [90, 109], + loc: { + start: { column: 3, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [89, 109], + loc: { + start: { column: 2, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "x", + + range: [116, 117], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + kind: "get", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [133, 137], + loc: { + start: { column: 11, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "_x", + + range: [138, 140], + loc: { + start: { column: 16, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + + range: [133, 140], + loc: { + start: { column: 11, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + + range: [126, 141], + loc: { + start: { column: 4, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + ], + + range: [120, 145], + loc: { + start: { column: 10, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [117, 145], + loc: { + start: { column: 7, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + + range: [89, 145], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 7 }, + }, + }, + ], + + range: [85, 147], + loc: { + start: { column: 12, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Point", + + range: [79, 84], + loc: { + start: { column: 6, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + superClass: null, + + range: [73, 147], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], + sourceType: "script", + + range: [73, 148], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..91bf13ad5f3f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,206 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-factory-instance-member TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Point", + + range: [79, 84], + loc: { + start: { column: 6, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [89, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "configurable", + + range: [90, 102], + loc: { + start: { column: 3, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [102, 103], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Boolean { + type: "Boolean", + value: "false", + + range: [103, 108], + loc: { + start: { column: 16, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [108, 109], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "get", + + range: [112, 115], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [116, 117], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [117, 118], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [118, 119], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [120, 121], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [126, 132], + loc: { + start: { column: 4, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [133, 137], + loc: { + start: { column: 11, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [137, 138], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "_x", + + range: [138, 140], + loc: { + start: { column: 16, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [140, 141], + loc: { + start: { column: 18, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [144, 145], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [146, 147], + loc: { + start: { column: 0, line: 8 }, + end: { column: 1, line: 8 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..75fbd90e9df7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/3-Babel-AST.shot @@ -0,0 +1,177 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-factory-instance-member Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Literal { + type: "Literal", + raw: "false", + value: false, + + range: [103, 108], + loc: { + start: { column: 16, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "configurable", + + range: [90, 102], + loc: { + start: { column: 3, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + optional: false, + + range: [90, 109], + loc: { + start: { column: 3, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [89, 109], + loc: { + start: { column: 2, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "x", + + range: [116, 117], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + kind: "get", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [133, 137], + loc: { + start: { column: 11, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "_x", + + range: [138, 140], + loc: { + start: { column: 16, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + + range: [133, 140], + loc: { + start: { column: 11, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + + range: [126, 141], + loc: { + start: { column: 4, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + ], + + range: [120, 145], + loc: { + start: { column: 10, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [117, 145], + loc: { + start: { column: 7, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + + range: [89, 145], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 7 }, + }, + }, + ], + + range: [85, 147], + loc: { + start: { column: 12, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Point", + + range: [79, 84], + loc: { + start: { column: 6, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + superClass: null, + + range: [73, 147], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], + sourceType: "script", + + range: [73, 148], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..8bef76d5f362 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,206 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-factory-instance-member Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Point", + + range: [79, 84], + loc: { + start: { column: 6, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [89, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "configurable", + + range: [90, 102], + loc: { + start: { column: 3, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [102, 103], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Boolean { + type: "Boolean", + value: "false", + + range: [103, 108], + loc: { + start: { column: 16, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [108, 109], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "get", + + range: [112, 115], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [116, 117], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [117, 118], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [118, 119], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [120, 121], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [126, 132], + loc: { + start: { column: 4, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [133, 137], + loc: { + start: { column: 11, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [137, 138], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "_x", + + range: [138, 140], + loc: { + start: { column: 16, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [140, 141], + loc: { + start: { column: 18, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [144, 145], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [146, 147], + loc: { + start: { column: 0, line: 8 }, + end: { column: 1, line: 8 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..ef60deece6e2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,182 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-factory-instance-member AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + decorators: Array [ + Decorator { + type: 'Decorator', + expression: CallExpression { + type: 'CallExpression', + arguments: Array [ + Literal { + type: 'Literal', + raw: 'false', + value: false, + + range: [103, 108], + loc: { + start: { column: 16, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + ], + callee: Identifier { + type: 'Identifier', + name: 'configurable', + + range: [90, 102], + loc: { + start: { column: 3, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + optional: false, + + range: [90, 109], + loc: { + start: { column: 3, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [89, 109], + loc: { + start: { column: 2, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + ], + key: Identifier { + type: 'Identifier', + name: 'x', + + range: [116, 117], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + kind: 'get', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: MemberExpression { + type: 'MemberExpression', + computed: false, + object: ThisExpression { + type: 'ThisExpression', + + range: [133, 137], + loc: { + start: { column: 11, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: 'Identifier', + name: '_x', + + range: [138, 140], + loc: { + start: { column: 16, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + + range: [133, 140], + loc: { + start: { column: 11, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + + range: [126, 141], + loc: { + start: { column: 4, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + ], + + range: [120, 145], + loc: { + start: { column: 10, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [117, 145], + loc: { + start: { column: 7, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + + range: [89, 145], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 7 }, + }, + }, + ], + + range: [85, 147], + loc: { + start: { column: 12, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Point', + + range: [79, 84], + loc: { + start: { column: 6, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + superClass: null, + + range: [73, 147], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 148], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..67721353bc5a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-factory-instance-member AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/fixture.ts b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/fixture.ts new file mode 100644 index 000000000000..9107959a52e4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/fixture.ts @@ -0,0 +1,8 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Other { + @foo({ baz: true }) + static get bar() { + return this._bar; + } +} diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..a80f43128bfc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,212 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-factory-static-member TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [96, 99], + loc: { + start: { column: 9, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: "true", + value: true, + + range: [101, 105], + loc: { + start: { column: 14, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [96, 105], + loc: { + start: { column: 9, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + ], + + range: [94, 107], + loc: { + start: { column: 7, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "foo", + + range: [90, 93], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + optional: false, + + range: [90, 108], + loc: { + start: { column: 3, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [89, 108], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "bar", + + range: [122, 125], + loc: { + start: { column: 13, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + kind: "get", + override: false, + static: true, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [141, 145], + loc: { + start: { column: 11, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "_bar", + + range: [146, 150], + loc: { + start: { column: 16, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + + range: [141, 150], + loc: { + start: { column: 11, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + + range: [134, 151], + loc: { + start: { column: 4, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, + ], + + range: [128, 155], + loc: { + start: { column: 19, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [125, 155], + loc: { + start: { column: 16, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + + range: [89, 155], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 7 }, + }, + }, + ], + + range: [85, 157], + loc: { + start: { column: 12, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Other", + + range: [79, 84], + loc: { + start: { column: 6, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + superClass: null, + + range: [73, 157], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], + sourceType: "script", + + range: [73, 158], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..177ab2ca46df --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,256 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-factory-static-member TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Other", + + range: [79, 84], + loc: { + start: { column: 6, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [89, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [90, 93], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [93, 94], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [94, 95], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [96, 99], + loc: { + start: { column: 9, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [99, 100], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Boolean { + type: "Boolean", + value: "true", + + range: [101, 105], + loc: { + start: { column: 14, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [106, 107], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [107, 108], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [111, 117], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "get", + + range: [118, 121], + loc: { + start: { column: 9, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [122, 125], + loc: { + start: { column: 13, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [125, 126], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [126, 127], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [128, 129], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [134, 140], + loc: { + start: { column: 4, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [141, 145], + loc: { + start: { column: 11, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [145, 146], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "_bar", + + range: [146, 150], + loc: { + start: { column: 16, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [150, 151], + loc: { + start: { column: 20, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [154, 155], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [156, 157], + loc: { + start: { column: 0, line: 8 }, + end: { column: 1, line: 8 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..f00879c61d30 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/3-Babel-AST.shot @@ -0,0 +1,211 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-factory-static-member Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [96, 99], + loc: { + start: { column: 9, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: "true", + value: true, + + range: [101, 105], + loc: { + start: { column: 14, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [96, 105], + loc: { + start: { column: 9, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + ], + + range: [94, 107], + loc: { + start: { column: 7, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "foo", + + range: [90, 93], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + optional: false, + + range: [90, 108], + loc: { + start: { column: 3, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [89, 108], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "bar", + + range: [122, 125], + loc: { + start: { column: 13, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + kind: "get", + static: true, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [141, 145], + loc: { + start: { column: 11, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "_bar", + + range: [146, 150], + loc: { + start: { column: 16, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + + range: [141, 150], + loc: { + start: { column: 11, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + + range: [134, 151], + loc: { + start: { column: 4, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, + ], + + range: [128, 155], + loc: { + start: { column: 19, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [125, 155], + loc: { + start: { column: 16, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + + range: [89, 155], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 7 }, + }, + }, + ], + + range: [85, 157], + loc: { + start: { column: 12, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Other", + + range: [79, 84], + loc: { + start: { column: 6, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + superClass: null, + + range: [73, 157], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], + sourceType: "script", + + range: [73, 158], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..899bdfd77f42 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,256 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-factory-static-member Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Other", + + range: [79, 84], + loc: { + start: { column: 6, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [89, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [90, 93], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [93, 94], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [94, 95], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [96, 99], + loc: { + start: { column: 9, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [99, 100], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Boolean { + type: "Boolean", + value: "true", + + range: [101, 105], + loc: { + start: { column: 14, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [106, 107], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [107, 108], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [111, 117], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "get", + + range: [118, 121], + loc: { + start: { column: 9, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [122, 125], + loc: { + start: { column: 13, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [125, 126], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [126, 127], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [128, 129], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [134, 140], + loc: { + start: { column: 4, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [141, 145], + loc: { + start: { column: 11, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [145, 146], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "_bar", + + range: [146, 150], + loc: { + start: { column: 16, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [150, 151], + loc: { + start: { column: 20, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [154, 155], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [156, 157], + loc: { + start: { column: 0, line: 8 }, + end: { column: 1, line: 8 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..3235fe1f39ee --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,216 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-factory-static-member AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + decorators: Array [ + Decorator { + type: 'Decorator', + expression: CallExpression { + type: 'CallExpression', + arguments: Array [ + ObjectExpression { + type: 'ObjectExpression', + properties: Array [ + Property { + type: 'Property', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'baz', + + range: [96, 99], + loc: { + start: { column: 9, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + kind: 'init', + method: false, + shorthand: false, + value: Literal { + type: 'Literal', + raw: 'true', + value: true, + + range: [101, 105], + loc: { + start: { column: 14, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [96, 105], + loc: { + start: { column: 9, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + ], + + range: [94, 107], + loc: { + start: { column: 7, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + callee: Identifier { + type: 'Identifier', + name: 'foo', + + range: [90, 93], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + optional: false, + + range: [90, 108], + loc: { + start: { column: 3, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [89, 108], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + ], + key: Identifier { + type: 'Identifier', + name: 'bar', + + range: [122, 125], + loc: { + start: { column: 13, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + kind: 'get', +- override: false, + static: true, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: MemberExpression { + type: 'MemberExpression', + computed: false, + object: ThisExpression { + type: 'ThisExpression', + + range: [141, 145], + loc: { + start: { column: 11, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: 'Identifier', + name: '_bar', + + range: [146, 150], + loc: { + start: { column: 16, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + + range: [141, 150], + loc: { + start: { column: 11, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + + range: [134, 151], + loc: { + start: { column: 4, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, + ], + + range: [128, 155], + loc: { + start: { column: 19, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [125, 155], + loc: { + start: { column: 16, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + + range: [89, 155], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 7 }, + }, + }, + ], + + range: [85, 157], + loc: { + start: { column: 12, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Other', + + range: [79, 84], + loc: { + start: { column: 6, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + superClass: null, + + range: [73, 157], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 158], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..20fa5734f7c8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-factory-static-member AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/fixture.ts b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/fixture.ts new file mode 100644 index 000000000000..a992d91218e7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/fixture.ts @@ -0,0 +1,8 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class P { + @hidden + get z() { + return this._z; + } +} diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..feac827e4851 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,155 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-instance-member TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "hidden", + + range: [86, 92], + loc: { + start: { column: 3, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [85, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "z", + + range: [99, 100], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + kind: "get", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [116, 120], + loc: { + start: { column: 11, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "_z", + + range: [121, 123], + loc: { + start: { column: 16, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + + range: [116, 123], + loc: { + start: { column: 11, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + + range: [109, 124], + loc: { + start: { column: 4, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + ], + + range: [103, 128], + loc: { + start: { column: 10, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [100, 128], + loc: { + start: { column: 7, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + + range: [85, 128], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 7 }, + }, + }, + ], + + range: [81, 130], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "P", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 130], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], + sourceType: "script", + + range: [73, 131], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..4a7a9ea04bef --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-instance-member TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "P", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [85, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "hidden", + + range: [86, 92], + loc: { + start: { column: 3, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "get", + + range: [95, 98], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "z", + + range: [99, 100], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [100, 101], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [101, 102], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [103, 104], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [109, 115], + loc: { + start: { column: 4, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [116, 120], + loc: { + start: { column: 11, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [120, 121], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "_z", + + range: [121, 123], + loc: { + start: { column: 16, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [123, 124], + loc: { + start: { column: 18, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [127, 128], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [129, 130], + loc: { + start: { column: 0, line: 8 }, + end: { column: 1, line: 8 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..a2b5a414d3c0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/3-Babel-AST.shot @@ -0,0 +1,154 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-instance-member Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "hidden", + + range: [86, 92], + loc: { + start: { column: 3, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [85, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "z", + + range: [99, 100], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + kind: "get", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [116, 120], + loc: { + start: { column: 11, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "_z", + + range: [121, 123], + loc: { + start: { column: 16, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + + range: [116, 123], + loc: { + start: { column: 11, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + + range: [109, 124], + loc: { + start: { column: 4, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + ], + + range: [103, 128], + loc: { + start: { column: 10, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [100, 128], + loc: { + start: { column: 7, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + + range: [85, 128], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 7 }, + }, + }, + ], + + range: [81, 130], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "P", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 130], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], + sourceType: "script", + + range: [73, 131], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..8d36b8ba2e7b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-instance-member Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "P", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [85, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "hidden", + + range: [86, 92], + loc: { + start: { column: 3, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "get", + + range: [95, 98], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "z", + + range: [99, 100], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [100, 101], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [101, 102], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [103, 104], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [109, 115], + loc: { + start: { column: 4, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [116, 120], + loc: { + start: { column: 11, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [120, 121], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "_z", + + range: [121, 123], + loc: { + start: { column: 16, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [123, 124], + loc: { + start: { column: 18, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [127, 128], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [129, 130], + loc: { + start: { column: 0, line: 8 }, + end: { column: 1, line: 8 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..41706b97b2e7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,159 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-instance-member AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + decorators: Array [ + Decorator { + type: 'Decorator', + expression: Identifier { + type: 'Identifier', + name: 'hidden', + + range: [86, 92], + loc: { + start: { column: 3, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [85, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + ], + key: Identifier { + type: 'Identifier', + name: 'z', + + range: [99, 100], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + kind: 'get', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: MemberExpression { + type: 'MemberExpression', + computed: false, + object: ThisExpression { + type: 'ThisExpression', + + range: [116, 120], + loc: { + start: { column: 11, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: 'Identifier', + name: '_z', + + range: [121, 123], + loc: { + start: { column: 16, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + + range: [116, 123], + loc: { + start: { column: 11, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + + range: [109, 124], + loc: { + start: { column: 4, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + ], + + range: [103, 128], + loc: { + start: { column: 10, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [100, 128], + loc: { + start: { column: 7, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + + range: [85, 128], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 7 }, + }, + }, + ], + + range: [81, 130], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'P', + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 130], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 131], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..3ff2e525da2b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-instance-member AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/fixture.ts b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/fixture.ts new file mode 100644 index 000000000000..8ad1189f081a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/fixture.ts @@ -0,0 +1,8 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class User { + @adminonly + static set y(a) { + this._y = a; + } +} diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..726459cbffe9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,186 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-static-member TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "adminonly", + + range: [89, 98], + loc: { + start: { column: 3, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + + range: [88, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "y", + + range: [112, 113], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + kind: "set", + override: false, + static: true, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [123, 127], + loc: { + start: { column: 4, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "_y", + + range: [128, 130], + loc: { + start: { column: 9, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + + range: [123, 130], + loc: { + start: { column: 4, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + operator: "=", + right: Identifier { + type: "Identifier", + name: "a", + + range: [133, 134], + loc: { + start: { column: 14, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [123, 134], + loc: { + start: { column: 4, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [123, 135], + loc: { + start: { column: 4, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + ], + + range: [117, 139], + loc: { + start: { column: 18, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "a", + + range: [114, 115], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + ], + + range: [113, 139], + loc: { + start: { column: 14, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + + range: [88, 139], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 7 }, + }, + }, + ], + + range: [84, 141], + loc: { + start: { column: 11, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "User", + + range: [79, 83], + loc: { + start: { column: 6, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + superClass: null, + + range: [73, 141], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], + sourceType: "script", + + range: [73, 142], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..2dedc4383866 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,206 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-static-member TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "User", + + range: [79, 83], + loc: { + start: { column: 6, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [88, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "adminonly", + + range: [89, 98], + loc: { + start: { column: 3, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [101, 107], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "set", + + range: [108, 111], + loc: { + start: { column: 9, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "y", + + range: [112, 113], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [113, 114], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [114, 115], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [115, 116], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [117, 118], + loc: { + start: { column: 18, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [123, 127], + loc: { + start: { column: 4, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [127, 128], + loc: { + start: { column: 8, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "_y", + + range: [128, 130], + loc: { + start: { column: 9, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [131, 132], + loc: { + start: { column: 12, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [133, 134], + loc: { + start: { column: 14, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [134, 135], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [138, 139], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [140, 141], + loc: { + start: { column: 0, line: 8 }, + end: { column: 1, line: 8 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..a8d8155d23ed --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/3-Babel-AST.shot @@ -0,0 +1,185 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-static-member Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "adminonly", + + range: [89, 98], + loc: { + start: { column: 3, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + + range: [88, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "y", + + range: [112, 113], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + kind: "set", + static: true, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [123, 127], + loc: { + start: { column: 4, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "_y", + + range: [128, 130], + loc: { + start: { column: 9, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + + range: [123, 130], + loc: { + start: { column: 4, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + operator: "=", + right: Identifier { + type: "Identifier", + name: "a", + + range: [133, 134], + loc: { + start: { column: 14, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [123, 134], + loc: { + start: { column: 4, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [123, 135], + loc: { + start: { column: 4, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + ], + + range: [117, 139], + loc: { + start: { column: 18, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "a", + + range: [114, 115], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + ], + + range: [113, 139], + loc: { + start: { column: 14, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + + range: [88, 139], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 7 }, + }, + }, + ], + + range: [84, 141], + loc: { + start: { column: 11, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "User", + + range: [79, 83], + loc: { + start: { column: 6, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + superClass: null, + + range: [73, 141], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], + sourceType: "script", + + range: [73, 142], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..e9e01b9c9025 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,206 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-static-member Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "User", + + range: [79, 83], + loc: { + start: { column: 6, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [88, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "adminonly", + + range: [89, 98], + loc: { + start: { column: 3, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [101, 107], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "set", + + range: [108, 111], + loc: { + start: { column: 9, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "y", + + range: [112, 113], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [113, 114], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [114, 115], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [115, 116], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [117, 118], + loc: { + start: { column: 18, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [123, 127], + loc: { + start: { column: 4, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [127, 128], + loc: { + start: { column: 8, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "_y", + + range: [128, 130], + loc: { + start: { column: 9, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [131, 132], + loc: { + start: { column: 12, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [133, 134], + loc: { + start: { column: 14, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [134, 135], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [138, 139], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [140, 141], + loc: { + start: { column: 0, line: 8 }, + end: { column: 1, line: 8 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..1ca322e0c3f4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,190 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-static-member AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + decorators: Array [ + Decorator { + type: 'Decorator', + expression: Identifier { + type: 'Identifier', + name: 'adminonly', + + range: [89, 98], + loc: { + start: { column: 3, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + + range: [88, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + ], + key: Identifier { + type: 'Identifier', + name: 'y', + + range: [112, 113], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + kind: 'set', +- override: false, + static: true, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ExpressionStatement { + type: 'ExpressionStatement', + expression: AssignmentExpression { + type: 'AssignmentExpression', + left: MemberExpression { + type: 'MemberExpression', + computed: false, + object: ThisExpression { + type: 'ThisExpression', + + range: [123, 127], + loc: { + start: { column: 4, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: 'Identifier', + name: '_y', + + range: [128, 130], + loc: { + start: { column: 9, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + + range: [123, 130], + loc: { + start: { column: 4, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + operator: '=', + right: Identifier { + type: 'Identifier', + name: 'a', + + range: [133, 134], + loc: { + start: { column: 14, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [123, 134], + loc: { + start: { column: 4, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [123, 135], + loc: { + start: { column: 4, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + ], + + range: [117, 139], + loc: { + start: { column: 18, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: 'Identifier', + name: 'a', + + range: [114, 115], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + ], + + range: [113, 139], + loc: { + start: { column: 14, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + + range: [88, 139], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 7 }, + }, + }, + ], + + range: [84, 141], + loc: { + start: { column: 11, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'User', + + range: [79, 83], + loc: { + start: { column: 6, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + superClass: null, + + range: [73, 141], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 142], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..8a3aacdbdad6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-static-member AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/fixture.ts b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/fixture.ts new file mode 100644 index 000000000000..32fcb45f3e49 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function f() {} diff --git a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..5e87232cc312 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,81 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures babylon-convergence type-parameter-whitespace-loc TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [89, 91], + loc: { + start: { column: 16, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "f", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + out: false, + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + ], + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..4e4fc36fd7d8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures babylon-convergence type-parameter-whitespace-loc TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..46314c48081c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/3-Babel-AST.shot @@ -0,0 +1,70 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures babylon-convergence type-parameter-whitespace-loc Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [89, 91], + loc: { + start: { column: 16, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "f", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + ], + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..9b1d8580e071 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures babylon-convergence type-parameter-whitespace-loc Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..546c2e3fa6b9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures babylon-convergence type-parameter-whitespace-loc AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + FunctionDeclaration { + type: 'FunctionDeclaration', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [89, 91], + loc: { + start: { column: 16, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: 'Identifier', + name: 'f', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [84, 85], +- loc: { +- start: { column: 11, line: 3 }, +- end: { column: 12, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + ], + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..24b4abcfb3dd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures babylon-convergence type-parameter-whitespace-loc AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/fixture.ts b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/fixture.ts new file mode 100644 index 000000000000..21018d808e7e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function f() {} diff --git a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..7612bfb5dbd4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,99 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures babylon-convergence type-parameters TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [113, 115], + loc: { + start: { column: 40, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "f", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + constraint: TSObjectKeyword { + type: "TSObjectKeyword", + + range: [94, 100], + loc: { + start: { column: 21, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + default: TSObjectKeyword { + type: "TSObjectKeyword", + + range: [103, 109], + loc: { + start: { column: 30, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + out: false, + + range: [84, 109], + loc: { + start: { column: 11, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + + range: [83, 110], + loc: { + start: { column: 10, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + + range: [73, 115], + loc: { + start: { column: 0, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 116], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..bb4be2d5a166 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures babylon-convergence type-parameters TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [86, 93], + loc: { + start: { column: 13, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "object", + + range: [94, 100], + loc: { + start: { column: 21, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "object", + + range: [103, 109], + loc: { + start: { column: 30, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [113, 114], + loc: { + start: { column: 40, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..469b031baa01 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/3-Babel-AST.shot @@ -0,0 +1,88 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures babylon-convergence type-parameters Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [113, 115], + loc: { + start: { column: 40, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "f", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + constraint: TSObjectKeyword { + type: "TSObjectKeyword", + + range: [94, 100], + loc: { + start: { column: 21, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + default: TSObjectKeyword { + type: "TSObjectKeyword", + + range: [103, 109], + loc: { + start: { column: 30, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + name: "T", + + range: [84, 109], + loc: { + start: { column: 11, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + + range: [83, 110], + loc: { + start: { column: 10, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + + range: [73, 115], + loc: { + start: { column: 0, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 116], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..8dd452e83349 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures babylon-convergence type-parameters Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [86, 93], + loc: { + start: { column: 13, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "object", + + range: [94, 100], + loc: { + start: { column: 21, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "object", + + range: [103, 109], + loc: { + start: { column: 30, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [113, 114], + loc: { + start: { column: 40, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..6a4e1eb30bfd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,104 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures babylon-convergence type-parameters AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + FunctionDeclaration { + type: 'FunctionDeclaration', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [113, 115], + loc: { + start: { column: 40, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: 'Identifier', + name: 'f', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSObjectKeyword { + type: 'TSObjectKeyword', + + range: [94, 100], + loc: { + start: { column: 21, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + default: TSObjectKeyword { + type: 'TSObjectKeyword', + + range: [103, 109], + loc: { + start: { column: 30, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [84, 85], +- loc: { +- start: { column: 11, line: 3 }, +- end: { column: 12, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [84, 109], + loc: { + start: { column: 11, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + + range: [83, 110], + loc: { + start: { column: 10, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + + range: [73, 115], + loc: { + start: { column: 0, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 116], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..dc431450efe1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures babylon-convergence type-parameters AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/fixture.ts new file mode 100644 index 000000000000..64bbf6a511d3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export abstract class AbstractSocket { + abstract static constructor(); +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..bb695d9a0b19 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ abstract-class-with-abstract-static-constructor TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..6c591d66392a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ abstract-class-with-abstract-static-constructor Babel - Error 1`] = `[SyntaxError: 'static' modifier cannot be used with 'abstract' modifier. (4:11)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..37fb30a105a3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ abstract-class-with-abstract-static-constructor Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/fixture.ts new file mode 100644 index 000000000000..f5fcd5499c11 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +abstract class SpecializedComponent extends SomeComponent { + abstract override foo = 1; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..8afa44f7c60b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ abstract-class-with-override-property TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..e48b2228671c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ abstract-class-with-override-property Babel - Error 1`] = `[SyntaxError: Property 'foo' cannot have an initializer because it is marked abstract. (4:24)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..6de99caccfc8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ abstract-class-with-override-property Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/fixture.ts new file mode 100644 index 000000000000..ed99cde593c7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/fixture.ts @@ -0,0 +1,4 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export abstract interface I { +} \ No newline at end of file diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..43e910b9175e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ abstract-interface TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..67e8635916be --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ abstract-interface Babel - Error 1`] = `[SyntaxError: 'abstract' modifier can only appear on a class, method, or property declaration. (3:7)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..15c7f73220aa --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ abstract-interface Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/fixture.ts new file mode 100644 index 000000000000..8372d25bbf67 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function foo() { + const bar = await baz(); + return bar.qux; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..2abea399073f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ await-without-async-function TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..6e36fa860668 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ await-without-async-function Babel - Error 1`] = `[SyntaxError: Unexpected reserved word 'await'. (4:14)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..e281e0edf2aa --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ await-without-async-function Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/fixture.ts new file mode 100644 index 000000000000..4f39238e5151 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/fixture.ts @@ -0,0 +1,7 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + private #priv1: string + public #priv2: string + static #priv3: string +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..0db28e9e7dfc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ class-private-identifier-field-with-accessibility-error TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..40321a29047e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ class-private-identifier-field-with-accessibility-error Babel - Error 1`] = `[SyntaxError: Private elements cannot have an accessibility modifier ('private'). (4:2)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..772471f96e26 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ class-private-identifier-field-with-accessibility-error Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/fixture.ts new file mode 100644 index 000000000000..c366977399ce --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/fixture.ts @@ -0,0 +1,7 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class C { + constructor() { } + + ['constructor']() { } +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..115cee14fe68 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ class-with-constructor-and-type-parameters TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..e61bb7cf0b49 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ class-with-constructor-and-type-parameters Babel - Error 1`] = `[SyntaxError: Type parameters cannot appear on a constructor declaration. (4:13)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..aa6535da513c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ class-with-constructor-and-type-parameters Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/fixture.ts new file mode 100644 index 000000000000..d05a16faecbf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/fixture.ts @@ -0,0 +1,8 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + constructor(export a: string) { + + } +} + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..2eb5b884fbe0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ class-with-export-parameter-properties TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..721146dd0f0e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ class-with-export-parameter-properties Babel - Error 1`] = `[SyntaxError: Unexpected keyword 'export'. (4:16)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..1cc73e1213a0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ class-with-export-parameter-properties Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/fixture.ts new file mode 100644 index 000000000000..675f49edf0aa --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class ClassWithParentAndInterface implements MyInterface extends MyOtherClass {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..4c8400772794 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ class-with-implements-and-extends TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..61594867ce5e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ class-with-implements-and-extends Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "," (3:57)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..8ca376cb9249 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ class-with-implements-and-extends Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/fixture.ts new file mode 100644 index 000000000000..502e6c0d4e5b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/fixture.ts @@ -0,0 +1,9 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + constructor(static a: string) { + + } +} + + diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..4a14ecee2002 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ class-with-static-parameter-properties TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..11599244d24a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ class-with-static-parameter-properties Babel - Error 1`] = `[SyntaxError: Unexpected reserved word 'static'. (4:16)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..588fc5dd0366 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ class-with-static-parameter-properties Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/fixture.ts new file mode 100644 index 000000000000..20edbad29f4e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/fixture.ts @@ -0,0 +1,9 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class A { + "constructor"(): number { + } + + ["constructor"](): number { + } +}; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..544fd4204a22 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ class-with-two-methods-computed-constructor TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..060e140c20f5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ class-with-two-methods-computed-constructor Babel - Error 1`] = `[SyntaxError: Type parameters cannot appear on a constructor declaration. (4:15)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..81cc16ee83cf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ class-with-two-methods-computed-constructor Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/fixture.ts new file mode 100644 index 000000000000..74a74df9a372 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/fixture.ts @@ -0,0 +1,19 @@ +// TODO: This fixture might be too large, and if so should be split up. + +// Type '10' +let x = 10 as const; + +// Type 'readonly [10, 20]' +let y = [10, 20] as const; + +// Type '{ readonly text: "hello" }' +let z = { text: "hello" } as const; + +// Type '10' +let x = 10; + +// Type 'readonly [10, 20]' +let y = [10, 20]; + +// Type '{ readonly text: "hello" }' +let z = { text: "hello" }; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..8c54cd2ddbd7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ const-assertions TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..203ef841fa38 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ const-assertions Babel - Error 1`] = `[SyntaxError: Identifier 'x' has already been declared. (13:4)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..a69ed0ed1cdb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ const-assertions Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/fixture.ts new file mode 100644 index 000000000000..79b964881291 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export enum Foo { + [1], +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..09fcd94cb14e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ export-named-enum-computed-number TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..92ac5f9b3f89 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ export-named-enum-computed-number Babel - Error 1`] = `[SyntaxError: Unexpected token (4:4)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..9ab87939ed92 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ export-named-enum-computed-number Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/fixture.ts new file mode 100644 index 000000000000..28e99708a945 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export enum Foo { + ['baz'], +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..34f14422bb4a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ export-named-enum-computed-string TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..54dece81c980 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ export-named-enum-computed-string Babel - Error 1`] = `[SyntaxError: Unexpected token (4:4)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..b81dfe8ab3e4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ export-named-enum-computed-string Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/fixture.ts new file mode 100644 index 000000000000..a712c82e5176 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export enum Foo { + [x], +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..ab9c1cb312e2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ export-named-enum-computed-var-ref TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..bf5d8d4312fe --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ export-named-enum-computed-var-ref Babel - Error 1`] = `[SyntaxError: Unexpected token (4:4)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..d0503e6badc9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ export-named-enum-computed-var-ref Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-type-star-from/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-type-star-from/fixture.ts new file mode 100644 index 000000000000..8e7376a61100 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-type-star-from/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export type * from 'bar'; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-type-star-from/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-type-star-from/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..886fb1e106b8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-type-star-from/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ export-type-star-from TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-type-star-from/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-type-star-from/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..def7016368fc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-type-star-from/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ export-type-star-from Babel - Error 1`] = `[SyntaxError: Unexpected token (3:12)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-type-star-from/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-type-star-from/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..848412137b2a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-type-star-from/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ export-type-star-from Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/fixture.ts new file mode 100644 index 000000000000..727743f8a5db --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export { foo } from "mod" assert { type: "json" }; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..1869025ab891 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ export-with-import-assertions TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..d16d6e9f798d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ export-with-import-assertions Babel - Error 1`] = `[SyntaxError: A JSON module can only be imported with \`default\`. (3:9)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..a9ca6bf4e92e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ export-with-import-assertions Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/fixture.ts new file mode 100644 index 000000000000..8f2b057bb5af --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +import type foo, { bar } from 'bar'; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..8dca8d083ac3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ import-type-error TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..fb7591e20893 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ import-type-error Babel - Error 1`] = `[SyntaxError: A type-only import can specify a default import or named bindings, but not both. (3:0)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..886a5e2d5b0f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ import-type-error Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/fixture.ts new file mode 100644 index 000000000000..cb253d8fe7e7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Test { + new (public x, private y); +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..fda3178b2721 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ interface-with-construct-signature-with-parameter-accessibility TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..7fc98b33463b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ interface-with-construct-signature-with-parameter-accessibility Babel - Error 1`] = `[SyntaxError: Unexpected reserved word 'public'. (4:9)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..d39bd1e45e7d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ interface-with-construct-signature-with-parameter-accessibility Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/fixture.ts new file mode 100644 index 000000000000..44dbc76b003b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +const b = () => new.target; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..65ea92510d86 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ new-target-in-arrow-function-body TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..613bd109ceaa --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ new-target-in-arrow-function-body Babel - Error 1`] = `[SyntaxError: \`new.target\` can only be used in functions or class properties. (3:16)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..af2bc132861b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ new-target-in-arrow-function-body Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/fixture.ts new file mode 100644 index 000000000000..03f1a06f5ff1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +const x!: string; +var y!: number; +let z!: object; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..ca5dbb187d38 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ var-with-definite-assignment TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..86beac1b20b5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ var-with-definite-assignment Babel - Error 1`] = `[SyntaxError: Missing initializer in const declaration. (3:16)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..3dcc38e06038 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics _error_ var-with-definite-assignment Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/fixture.ts new file mode 100644 index 000000000000..d246b57f631d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export abstract class AbstractSocket { + abstract constructor(); +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..aa816a04198d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,99 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-constructor TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: Array [ + TSAbstractMethodDefinition { + type: "TSAbstractMethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [123, 134], + loc: { + start: { column: 11, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + kind: "constructor", + override: false, + static: false, + value: TSEmptyBodyFunctionExpression { + type: "TSEmptyBodyFunctionExpression", + async: false, + body: null, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [134, 137], + loc: { + start: { column: 22, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [114, 137], + loc: { + start: { column: 2, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + ], + + range: [110, 139], + loc: { + start: { column: 37, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "AbstractSocket", + + range: [95, 109], + loc: { + start: { column: 22, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + superClass: null, + + range: [80, 139], + loc: { + start: { column: 7, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [73, 139], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "module", + + range: [73, 140], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..0fe1f149d470 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-constructor TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [80, 88], + loc: { + start: { column: 7, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [89, 94], + loc: { + start: { column: 16, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "AbstractSocket", + + range: [95, 109], + loc: { + start: { column: 22, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [114, 122], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [123, 134], + loc: { + start: { column: 11, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [134, 135], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [135, 136], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [136, 137], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [138, 139], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..4e1deaea3741 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/3-Babel-AST.shot @@ -0,0 +1,98 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-constructor Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + abstract: true, + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [123, 134], + loc: { + start: { column: 11, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + kind: "constructor", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [134, 137], + loc: { + start: { column: 22, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [114, 137], + loc: { + start: { column: 2, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + ], + + range: [110, 139], + loc: { + start: { column: 37, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "AbstractSocket", + + range: [95, 109], + loc: { + start: { column: 22, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + superClass: null, + + range: [80, 139], + loc: { + start: { column: 7, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [73, 139], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "module", + + range: [73, 140], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..8b7342e8d4d5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-constructor Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [80, 88], + loc: { + start: { column: 7, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [89, 94], + loc: { + start: { column: 16, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "AbstractSocket", + + range: [95, 109], + loc: { + start: { column: 22, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [114, 122], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [123, 134], + loc: { + start: { column: 11, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [134, 135], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [135, 136], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [136, 137], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [138, 139], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..d6d511ccbfdd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,108 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-constructor AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: ClassDeclaration { + type: 'ClassDeclaration', + abstract: true, + body: ClassBody { + type: 'ClassBody', + body: Array [ +- TSAbstractMethodDefinition { +- type: 'TSAbstractMethodDefinition', ++ MethodDefinition { ++ type: 'MethodDefinition', ++ abstract: true, + computed: false, + key: Identifier { + type: 'Identifier', + name: 'constructor', + + range: [123, 134], + loc: { + start: { column: 11, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + kind: 'constructor', +- override: false, + static: false, +- value: TSEmptyBodyFunctionExpression { +- type: 'TSEmptyBodyFunctionExpression', ++ value: FunctionExpression { ++ type: 'FunctionExpression', + async: false, +- body: null, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [134, 137], + loc: { + start: { column: 22, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [114, 137], + loc: { + start: { column: 2, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + ], + + range: [110, 139], + loc: { + start: { column: 37, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'AbstractSocket', + + range: [95, 109], + loc: { + start: { column: 22, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + superClass: null, + + range: [80, 139], + loc: { + start: { column: 7, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + exportKind: 'value', + source: null, + specifiers: Array [], + + range: [73, 139], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'module', + + range: [73, 140], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..b5d33dfde119 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-constructor AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/fixture.ts new file mode 100644 index 000000000000..546c6a86dbf1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export abstract class AbstractSocket { + abstract createSocket(): Promise; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..f411fd3cb0b8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,147 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: Array [ + TSAbstractMethodDefinition { + type: "TSAbstractMethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "createSocket", + + range: [123, 135], + loc: { + start: { column: 11, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + kind: "method", + override: false, + static: false, + value: TSEmptyBodyFunctionExpression { + type: "TSEmptyBodyFunctionExpression", + async: false, + body: null, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Promise", + + range: [139, 146], + loc: { + start: { column: 27, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [147, 153], + loc: { + start: { column: 35, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + ], + + range: [146, 154], + loc: { + start: { column: 34, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + + range: [139, 154], + loc: { + start: { column: 27, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + + range: [137, 154], + loc: { + start: { column: 25, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + + range: [135, 155], + loc: { + start: { column: 23, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + + range: [114, 155], + loc: { + start: { column: 2, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + ], + + range: [110, 157], + loc: { + start: { column: 37, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "AbstractSocket", + + range: [95, 109], + loc: { + start: { column: 22, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + superClass: null, + + range: [80, 157], + loc: { + start: { column: 7, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [73, 157], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "module", + + range: [73, 158], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..0044dfdcc7dd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [80, 88], + loc: { + start: { column: 7, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [89, 94], + loc: { + start: { column: 16, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "AbstractSocket", + + range: [95, 109], + loc: { + start: { column: 22, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [114, 122], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "createSocket", + + range: [123, 135], + loc: { + start: { column: 11, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [135, 136], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [136, 137], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [137, 138], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Promise", + + range: [139, 146], + loc: { + start: { column: 27, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [146, 147], + loc: { + start: { column: 34, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [147, 153], + loc: { + start: { column: 35, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [153, 154], + loc: { + start: { column: 41, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [154, 155], + loc: { + start: { column: 42, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [156, 157], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..84a50912b2cb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/3-Babel-AST.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + abstract: true, + computed: false, + key: Identifier { + type: "Identifier", + name: "createSocket", + + range: [123, 135], + loc: { + start: { column: 11, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Promise", + + range: [139, 146], + loc: { + start: { column: 27, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [147, 153], + loc: { + start: { column: 35, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + ], + + range: [146, 154], + loc: { + start: { column: 34, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + + range: [139, 154], + loc: { + start: { column: 27, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + + range: [137, 154], + loc: { + start: { column: 25, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + + range: [135, 155], + loc: { + start: { column: 23, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + + range: [114, 155], + loc: { + start: { column: 2, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + ], + + range: [110, 157], + loc: { + start: { column: 37, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "AbstractSocket", + + range: [95, 109], + loc: { + start: { column: 22, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + superClass: null, + + range: [80, 157], + loc: { + start: { column: 7, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [73, 157], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "module", + + range: [73, 158], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..a1d901e42b6a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [80, 88], + loc: { + start: { column: 7, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [89, 94], + loc: { + start: { column: 16, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "AbstractSocket", + + range: [95, 109], + loc: { + start: { column: 22, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [114, 122], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "createSocket", + + range: [123, 135], + loc: { + start: { column: 11, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [135, 136], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [136, 137], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [137, 138], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Promise", + + range: [139, 146], + loc: { + start: { column: 27, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [146, 147], + loc: { + start: { column: 34, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [147, 153], + loc: { + start: { column: 35, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [153, 154], + loc: { + start: { column: 41, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [154, 155], + loc: { + start: { column: 42, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [156, 157], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..cc059ebdd976 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: ClassDeclaration { + type: 'ClassDeclaration', + abstract: true, + body: ClassBody { + type: 'ClassBody', + body: Array [ +- TSAbstractMethodDefinition { +- type: 'TSAbstractMethodDefinition', ++ MethodDefinition { ++ type: 'MethodDefinition', ++ abstract: true, + computed: false, + key: Identifier { + type: 'Identifier', + name: 'createSocket', + + range: [123, 135], + loc: { + start: { column: 11, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + kind: 'method', +- override: false, + static: false, +- value: TSEmptyBodyFunctionExpression { +- type: 'TSEmptyBodyFunctionExpression', ++ value: FunctionExpression { ++ type: 'FunctionExpression', + async: false, +- body: null, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'Promise', + + range: [139, 146], + loc: { + start: { column: 27, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSStringKeyword { + type: 'TSStringKeyword', + + range: [147, 153], + loc: { + start: { column: 35, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + ], + + range: [146, 154], + loc: { + start: { column: 34, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + + range: [139, 154], + loc: { + start: { column: 27, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + + range: [137, 154], + loc: { + start: { column: 25, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + + range: [135, 155], + loc: { + start: { column: 23, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + + range: [114, 155], + loc: { + start: { column: 2, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + ], + + range: [110, 157], + loc: { + start: { column: 37, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'AbstractSocket', + + range: [95, 109], + loc: { + start: { column: 22, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + superClass: null, + + range: [80, 157], + loc: { + start: { column: 7, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + exportKind: 'value', + source: null, + specifiers: Array [], + + range: [73, 157], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'module', + + range: [73, 158], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..80ce7181009f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/fixture.ts new file mode 100644 index 000000000000..4a46e9fdf7be --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +abstract class Foo { + abstract bar; + abstract baz: number; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..e45b55218715 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,114 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-properties TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: Array [ + TSAbstractPropertyDefinition { + type: "TSAbstractPropertyDefinition", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [105, 108], + loc: { + start: { column: 11, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + override: false, + static: false, + value: null, + + range: [96, 109], + loc: { + start: { column: 2, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + TSAbstractPropertyDefinition { + type: "TSAbstractPropertyDefinition", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [121, 124], + loc: { + start: { column: 11, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [126, 132], + loc: { + start: { column: 16, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + + range: [124, 132], + loc: { + start: { column: 14, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + value: null, + + range: [112, 133], + loc: { + start: { column: 2, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + ], + + range: [92, 135], + loc: { + start: { column: 19, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + superClass: null, + + range: [73, 135], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 136], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..a7cb3e63512e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-properties TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "abstract", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [96, 104], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [105, 108], + loc: { + start: { column: 11, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [108, 109], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [112, 120], + loc: { + start: { column: 2, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [121, 124], + loc: { + start: { column: 11, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [124, 125], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [126, 132], + loc: { + start: { column: 16, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [132, 133], + loc: { + start: { column: 22, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [134, 135], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..4199e320c160 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/3-Babel-AST.shot @@ -0,0 +1,112 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-properties Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + abstract: true, + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [105, 108], + loc: { + start: { column: 11, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + static: false, + value: null, + + range: [96, 109], + loc: { + start: { column: 2, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + abstract: true, + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [121, 124], + loc: { + start: { column: 11, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [126, 132], + loc: { + start: { column: 16, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + + range: [124, 132], + loc: { + start: { column: 14, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + value: null, + + range: [112, 133], + loc: { + start: { column: 2, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + ], + + range: [92, 135], + loc: { + start: { column: 19, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + superClass: null, + + range: [73, 135], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 136], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..6596246f5fc8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-properties Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "abstract", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [96, 104], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [105, 108], + loc: { + start: { column: 11, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [108, 109], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [112, 120], + loc: { + start: { column: 2, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [121, 124], + loc: { + start: { column: 11, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [124, 125], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [126, 132], + loc: { + start: { column: 16, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [132, 133], + loc: { + start: { column: 22, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [134, 135], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..4989b7b35d17 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,124 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-properties AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + abstract: true, + body: ClassBody { + type: 'ClassBody', + body: Array [ +- TSAbstractPropertyDefinition { +- type: 'TSAbstractPropertyDefinition', ++ PropertyDefinition { ++ type: 'PropertyDefinition', ++ abstract: true, + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'bar', + + range: [105, 108], + loc: { + start: { column: 11, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, +- override: false, + static: false, + value: null, + + range: [96, 109], + loc: { + start: { column: 2, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, +- TSAbstractPropertyDefinition { +- type: 'TSAbstractPropertyDefinition', ++ PropertyDefinition { ++ type: 'PropertyDefinition', ++ abstract: true, + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'baz', + + range: [121, 124], + loc: { + start: { column: 11, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [126, 132], + loc: { + start: { column: 16, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + + range: [124, 132], + loc: { + start: { column: 14, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + value: null, + + range: [112, 133], + loc: { + start: { column: 2, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + ], + + range: [92, 135], + loc: { + start: { column: 19, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + superClass: null, + + range: [73, 135], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 136], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..122f1a4b6c58 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-properties AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/fixture.ts new file mode 100644 index 000000000000..1ca239190934 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +abstract class Foo { + public abstract readonly foo: string; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..7009559f1959 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,92 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-readonly-property TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: Array [ + TSAbstractPropertyDefinition { + type: "TSAbstractPropertyDefinition", + accessibility: "public", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [121, 124], + loc: { + start: { column: 27, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + override: false, + readonly: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [126, 132], + loc: { + start: { column: 32, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + + range: [124, 132], + loc: { + start: { column: 30, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + value: null, + + range: [96, 133], + loc: { + start: { column: 2, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + ], + + range: [92, 135], + loc: { + start: { column: 19, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + superClass: null, + + range: [73, 135], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 136], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..50a61022fb9e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-readonly-property TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "abstract", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [96, 102], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [103, 111], + loc: { + start: { column: 9, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [112, 120], + loc: { + start: { column: 18, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [121, 124], + loc: { + start: { column: 27, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [124, 125], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [126, 132], + loc: { + start: { column: 32, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [132, 133], + loc: { + start: { column: 38, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [134, 135], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..067dadfb4f67 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/3-Babel-AST.shot @@ -0,0 +1,91 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-readonly-property Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + abstract: true, + accessibility: "public", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [121, 124], + loc: { + start: { column: 27, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + readonly: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [126, 132], + loc: { + start: { column: 32, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + + range: [124, 132], + loc: { + start: { column: 30, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + value: null, + + range: [96, 133], + loc: { + start: { column: 2, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + ], + + range: [92, 135], + loc: { + start: { column: 19, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + superClass: null, + + range: [73, 135], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 136], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..5b2e3fc49076 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-readonly-property Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "abstract", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [96, 102], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [103, 111], + loc: { + start: { column: 9, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [112, 120], + loc: { + start: { column: 18, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [121, 124], + loc: { + start: { column: 27, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [124, 125], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [126, 132], + loc: { + start: { column: 32, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [132, 133], + loc: { + start: { column: 38, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [134, 135], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..c7d5ecccd101 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,99 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-readonly-property AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + abstract: true, + body: ClassBody { + type: 'ClassBody', + body: Array [ +- TSAbstractPropertyDefinition { +- type: 'TSAbstractPropertyDefinition', ++ PropertyDefinition { ++ type: 'PropertyDefinition', ++ abstract: true, + accessibility: 'public', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'foo', + + range: [121, 124], + loc: { + start: { column: 27, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, +- override: false, + readonly: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [126, 132], + loc: { + start: { column: 32, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + + range: [124, 132], + loc: { + start: { column: 30, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + value: null, + + range: [96, 133], + loc: { + start: { column: 2, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + ], + + range: [92, 135], + loc: { + start: { column: 19, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + superClass: null, + + range: [73, 135], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 136], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..064edf1f78ae --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,132 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-readonly-property AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Identifier { + type: 'Identifier', + value: 'abstract', + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'class', + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [96, 102], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'abstract', + + range: [103, 111], + loc: { + start: { column: 9, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'readonly', + + range: [112, 120], + loc: { + start: { column: 18, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'foo', + + range: [121, 124], + loc: { + start: { column: 27, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [124, 125], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [126, 132], + loc: { + start: { column: 32, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [132, 133], + loc: { + start: { column: 38, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [134, 135], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/fixture.ts new file mode 100644 index 000000000000..c1a26a1bc5f0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/fixture.ts @@ -0,0 +1,9 @@ +// TODO: This fixture might be too large, and if so should be split up. + +abstract class AbstractDeclProps { + declare prop1: string; + declare abstract prop2: string; + public declare abstract prop3: string; + declare abstract readonly prop4: string; + public declare abstract readonly prop5: string; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..63f3f0b3c812 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,262 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-declare-properties TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop1", + + range: [118, 123], + loc: { + start: { column: 10, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [125, 131], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [123, 131], + loc: { + start: { column: 15, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + value: null, + + range: [110, 132], + loc: { + start: { column: 2, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + TSAbstractPropertyDefinition { + type: "TSAbstractPropertyDefinition", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop2", + + range: [152, 157], + loc: { + start: { column: 19, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [159, 165], + loc: { + start: { column: 26, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + + range: [157, 165], + loc: { + start: { column: 24, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + value: null, + + range: [135, 166], + loc: { + start: { column: 2, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + TSAbstractPropertyDefinition { + type: "TSAbstractPropertyDefinition", + accessibility: "public", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop3", + + range: [193, 198], + loc: { + start: { column: 26, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [200, 206], + loc: { + start: { column: 33, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + + range: [198, 206], + loc: { + start: { column: 31, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + value: null, + + range: [169, 207], + loc: { + start: { column: 2, line: 6 }, + end: { column: 40, line: 6 }, + }, + }, + TSAbstractPropertyDefinition { + type: "TSAbstractPropertyDefinition", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop4", + + range: [236, 241], + loc: { + start: { column: 28, line: 7 }, + end: { column: 33, line: 7 }, + }, + }, + override: false, + readonly: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [243, 249], + loc: { + start: { column: 35, line: 7 }, + end: { column: 41, line: 7 }, + }, + }, + + range: [241, 249], + loc: { + start: { column: 33, line: 7 }, + end: { column: 41, line: 7 }, + }, + }, + value: null, + + range: [210, 250], + loc: { + start: { column: 2, line: 7 }, + end: { column: 42, line: 7 }, + }, + }, + TSAbstractPropertyDefinition { + type: "TSAbstractPropertyDefinition", + accessibility: "public", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop5", + + range: [286, 291], + loc: { + start: { column: 35, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, + override: false, + readonly: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [293, 299], + loc: { + start: { column: 42, line: 8 }, + end: { column: 48, line: 8 }, + }, + }, + + range: [291, 299], + loc: { + start: { column: 40, line: 8 }, + end: { column: 48, line: 8 }, + }, + }, + value: null, + + range: [253, 300], + loc: { + start: { column: 2, line: 8 }, + end: { column: 49, line: 8 }, + }, + }, + ], + + range: [106, 302], + loc: { + start: { column: 33, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "AbstractDeclProps", + + range: [88, 105], + loc: { + start: { column: 15, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + superClass: null, + + range: [73, 302], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + ], + sourceType: "script", + + range: [73, 303], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 10 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..1ff78ec24fef --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,386 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-declare-properties TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "abstract", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "AbstractDeclProps", + + range: [88, 105], + loc: { + start: { column: 15, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [110, 117], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop1", + + range: [118, 123], + loc: { + start: { column: 10, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [123, 124], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [125, 131], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [131, 132], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [135, 142], + loc: { + start: { column: 2, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [143, 151], + loc: { + start: { column: 10, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop2", + + range: [152, 157], + loc: { + start: { column: 19, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [157, 158], + loc: { + start: { column: 24, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [159, 165], + loc: { + start: { column: 26, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [165, 166], + loc: { + start: { column: 32, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [169, 175], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [176, 183], + loc: { + start: { column: 9, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [184, 192], + loc: { + start: { column: 17, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop3", + + range: [193, 198], + loc: { + start: { column: 26, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [198, 199], + loc: { + start: { column: 31, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [200, 206], + loc: { + start: { column: 33, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [206, 207], + loc: { + start: { column: 39, line: 6 }, + end: { column: 40, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [210, 217], + loc: { + start: { column: 2, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [218, 226], + loc: { + start: { column: 10, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [227, 235], + loc: { + start: { column: 19, line: 7 }, + end: { column: 27, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop4", + + range: [236, 241], + loc: { + start: { column: 28, line: 7 }, + end: { column: 33, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [241, 242], + loc: { + start: { column: 33, line: 7 }, + end: { column: 34, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [243, 249], + loc: { + start: { column: 35, line: 7 }, + end: { column: 41, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [249, 250], + loc: { + start: { column: 41, line: 7 }, + end: { column: 42, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [253, 259], + loc: { + start: { column: 2, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [260, 267], + loc: { + start: { column: 9, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [268, 276], + loc: { + start: { column: 17, line: 8 }, + end: { column: 25, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [277, 285], + loc: { + start: { column: 26, line: 8 }, + end: { column: 34, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop5", + + range: [286, 291], + loc: { + start: { column: 35, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [291, 292], + loc: { + start: { column: 40, line: 8 }, + end: { column: 41, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [293, 299], + loc: { + start: { column: 42, line: 8 }, + end: { column: 48, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [299, 300], + loc: { + start: { column: 48, line: 8 }, + end: { column: 49, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [301, 302], + loc: { + start: { column: 0, line: 9 }, + end: { column: 1, line: 9 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..292be075ff43 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/3-Babel-AST.shot @@ -0,0 +1,261 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-declare-properties Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop1", + + range: [118, 123], + loc: { + start: { column: 10, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [125, 131], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [123, 131], + loc: { + start: { column: 15, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + value: null, + + range: [110, 132], + loc: { + start: { column: 2, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + abstract: true, + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop2", + + range: [152, 157], + loc: { + start: { column: 19, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [159, 165], + loc: { + start: { column: 26, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + + range: [157, 165], + loc: { + start: { column: 24, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + value: null, + + range: [135, 166], + loc: { + start: { column: 2, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + abstract: true, + accessibility: "public", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop3", + + range: [193, 198], + loc: { + start: { column: 26, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [200, 206], + loc: { + start: { column: 33, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + + range: [198, 206], + loc: { + start: { column: 31, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + value: null, + + range: [169, 207], + loc: { + start: { column: 2, line: 6 }, + end: { column: 40, line: 6 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + abstract: true, + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop4", + + range: [236, 241], + loc: { + start: { column: 28, line: 7 }, + end: { column: 33, line: 7 }, + }, + }, + readonly: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [243, 249], + loc: { + start: { column: 35, line: 7 }, + end: { column: 41, line: 7 }, + }, + }, + + range: [241, 249], + loc: { + start: { column: 33, line: 7 }, + end: { column: 41, line: 7 }, + }, + }, + value: null, + + range: [210, 250], + loc: { + start: { column: 2, line: 7 }, + end: { column: 42, line: 7 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + abstract: true, + accessibility: "public", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop5", + + range: [286, 291], + loc: { + start: { column: 35, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, + readonly: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [293, 299], + loc: { + start: { column: 42, line: 8 }, + end: { column: 48, line: 8 }, + }, + }, + + range: [291, 299], + loc: { + start: { column: 40, line: 8 }, + end: { column: 48, line: 8 }, + }, + }, + value: null, + + range: [253, 300], + loc: { + start: { column: 2, line: 8 }, + end: { column: 49, line: 8 }, + }, + }, + ], + + range: [106, 302], + loc: { + start: { column: 33, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "AbstractDeclProps", + + range: [88, 105], + loc: { + start: { column: 15, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + superClass: null, + + range: [73, 302], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + ], + sourceType: "script", + + range: [73, 303], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 10 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..cb8c28aab234 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,386 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-declare-properties Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "abstract", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "AbstractDeclProps", + + range: [88, 105], + loc: { + start: { column: 15, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [110, 117], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop1", + + range: [118, 123], + loc: { + start: { column: 10, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [123, 124], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [125, 131], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [131, 132], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [135, 142], + loc: { + start: { column: 2, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [143, 151], + loc: { + start: { column: 10, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop2", + + range: [152, 157], + loc: { + start: { column: 19, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [157, 158], + loc: { + start: { column: 24, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [159, 165], + loc: { + start: { column: 26, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [165, 166], + loc: { + start: { column: 32, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [169, 175], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [176, 183], + loc: { + start: { column: 9, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [184, 192], + loc: { + start: { column: 17, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop3", + + range: [193, 198], + loc: { + start: { column: 26, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [198, 199], + loc: { + start: { column: 31, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [200, 206], + loc: { + start: { column: 33, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [206, 207], + loc: { + start: { column: 39, line: 6 }, + end: { column: 40, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [210, 217], + loc: { + start: { column: 2, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [218, 226], + loc: { + start: { column: 10, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [227, 235], + loc: { + start: { column: 19, line: 7 }, + end: { column: 27, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop4", + + range: [236, 241], + loc: { + start: { column: 28, line: 7 }, + end: { column: 33, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [241, 242], + loc: { + start: { column: 33, line: 7 }, + end: { column: 34, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [243, 249], + loc: { + start: { column: 35, line: 7 }, + end: { column: 41, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [249, 250], + loc: { + start: { column: 41, line: 7 }, + end: { column: 42, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [253, 259], + loc: { + start: { column: 2, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [260, 267], + loc: { + start: { column: 9, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [268, 276], + loc: { + start: { column: 17, line: 8 }, + end: { column: 25, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [277, 285], + loc: { + start: { column: 26, line: 8 }, + end: { column: 34, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop5", + + range: [286, 291], + loc: { + start: { column: 35, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [291, 292], + loc: { + start: { column: 40, line: 8 }, + end: { column: 41, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [293, 299], + loc: { + start: { column: 42, line: 8 }, + end: { column: 48, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [299, 300], + loc: { + start: { column: 48, line: 8 }, + end: { column: 49, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [301, 302], + loc: { + start: { column: 0, line: 9 }, + end: { column: 1, line: 9 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..e96ac30a3b55 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,278 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-declare-properties AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + abstract: true, + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, + declare: true, + key: Identifier { + type: 'Identifier', + name: 'prop1', + + range: [118, 123], + loc: { + start: { column: 10, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [125, 131], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [123, 131], + loc: { + start: { column: 15, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + value: null, + + range: [110, 132], + loc: { + start: { column: 2, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, +- TSAbstractPropertyDefinition { +- type: 'TSAbstractPropertyDefinition', ++ PropertyDefinition { ++ type: 'PropertyDefinition', ++ abstract: true, + computed: false, + declare: true, + key: Identifier { + type: 'Identifier', + name: 'prop2', + + range: [152, 157], + loc: { + start: { column: 19, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [159, 165], + loc: { + start: { column: 26, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + + range: [157, 165], + loc: { + start: { column: 24, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + value: null, + + range: [135, 166], + loc: { + start: { column: 2, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, +- TSAbstractPropertyDefinition { +- type: 'TSAbstractPropertyDefinition', ++ PropertyDefinition { ++ type: 'PropertyDefinition', ++ abstract: true, + accessibility: 'public', + computed: false, + declare: true, + key: Identifier { + type: 'Identifier', + name: 'prop3', + + range: [193, 198], + loc: { + start: { column: 26, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [200, 206], + loc: { + start: { column: 33, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + + range: [198, 206], + loc: { + start: { column: 31, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + value: null, + + range: [169, 207], + loc: { + start: { column: 2, line: 6 }, + end: { column: 40, line: 6 }, + }, + }, +- TSAbstractPropertyDefinition { +- type: 'TSAbstractPropertyDefinition', ++ PropertyDefinition { ++ type: 'PropertyDefinition', ++ abstract: true, + computed: false, + declare: true, + key: Identifier { + type: 'Identifier', + name: 'prop4', + + range: [236, 241], + loc: { + start: { column: 28, line: 7 }, + end: { column: 33, line: 7 }, + }, + }, +- override: false, + readonly: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [243, 249], + loc: { + start: { column: 35, line: 7 }, + end: { column: 41, line: 7 }, + }, + }, + + range: [241, 249], + loc: { + start: { column: 33, line: 7 }, + end: { column: 41, line: 7 }, + }, + }, + value: null, + + range: [210, 250], + loc: { + start: { column: 2, line: 7 }, + end: { column: 42, line: 7 }, + }, + }, +- TSAbstractPropertyDefinition { +- type: 'TSAbstractPropertyDefinition', ++ PropertyDefinition { ++ type: 'PropertyDefinition', ++ abstract: true, + accessibility: 'public', + computed: false, + declare: true, + key: Identifier { + type: 'Identifier', + name: 'prop5', + + range: [286, 291], + loc: { + start: { column: 35, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, +- override: false, + readonly: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [293, 299], + loc: { + start: { column: 42, line: 8 }, + end: { column: 48, line: 8 }, + }, + }, + + range: [291, 299], + loc: { + start: { column: 40, line: 8 }, + end: { column: 48, line: 8 }, + }, + }, + value: null, + + range: [253, 300], + loc: { + start: { column: 2, line: 8 }, + end: { column: 49, line: 8 }, + }, + }, + ], + + range: [106, 302], + loc: { + start: { column: 33, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'AbstractDeclProps', + + range: [88, 105], + loc: { + start: { column: 15, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + superClass: null, + + range: [73, 302], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 303], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 10 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..5adf58a89ffb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,394 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-declare-properties AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Identifier { + type: 'Identifier', + value: 'abstract', + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'class', + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'AbstractDeclProps', + + range: [88, 105], + loc: { + start: { column: 15, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'declare', + + range: [110, 117], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'prop1', + + range: [118, 123], + loc: { + start: { column: 10, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [123, 124], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [125, 131], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [131, 132], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'declare', + + range: [135, 142], + loc: { + start: { column: 2, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'abstract', + + range: [143, 151], + loc: { + start: { column: 10, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'prop2', + + range: [152, 157], + loc: { + start: { column: 19, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [157, 158], + loc: { + start: { column: 24, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [159, 165], + loc: { + start: { column: 26, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [165, 166], + loc: { + start: { column: 32, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [169, 175], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'declare', + + range: [176, 183], + loc: { + start: { column: 9, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'abstract', + + range: [184, 192], + loc: { + start: { column: 17, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'prop3', + + range: [193, 198], + loc: { + start: { column: 26, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [198, 199], + loc: { + start: { column: 31, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [200, 206], + loc: { + start: { column: 33, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [206, 207], + loc: { + start: { column: 39, line: 6 }, + end: { column: 40, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'declare', + + range: [210, 217], + loc: { + start: { column: 2, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'abstract', + + range: [218, 226], + loc: { + start: { column: 10, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'readonly', + + range: [227, 235], + loc: { + start: { column: 19, line: 7 }, + end: { column: 27, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'prop4', + + range: [236, 241], + loc: { + start: { column: 28, line: 7 }, + end: { column: 33, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [241, 242], + loc: { + start: { column: 33, line: 7 }, + end: { column: 34, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [243, 249], + loc: { + start: { column: 35, line: 7 }, + end: { column: 41, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [249, 250], + loc: { + start: { column: 41, line: 7 }, + end: { column: 42, line: 7 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [253, 259], + loc: { + start: { column: 2, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'declare', + + range: [260, 267], + loc: { + start: { column: 9, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'abstract', + + range: [268, 276], + loc: { + start: { column: 17, line: 8 }, + end: { column: 25, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'readonly', + + range: [277, 285], + loc: { + start: { column: 26, line: 8 }, + end: { column: 34, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'prop5', + + range: [286, 291], + loc: { + start: { column: 35, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [291, 292], + loc: { + start: { column: 40, line: 8 }, + end: { column: 41, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [293, 299], + loc: { + start: { column: 42, line: 8 }, + end: { column: 48, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [299, 300], + loc: { + start: { column: 48, line: 8 }, + end: { column: 49, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [301, 302], + loc: { + start: { column: 0, line: 9 }, + end: { column: 1, line: 9 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/fixture.ts new file mode 100644 index 000000000000..2e17a011afb9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export abstract class AbstractSocket { + createSocket?(): Promise; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..bf982a1b42e9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,148 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-optional-method TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "createSocket", + + range: [114, 126], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + kind: "method", + optional: true, + override: false, + static: false, + value: TSEmptyBodyFunctionExpression { + type: "TSEmptyBodyFunctionExpression", + async: false, + body: null, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Promise", + + range: [131, 138], + loc: { + start: { column: 19, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [139, 145], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + + range: [138, 146], + loc: { + start: { column: 26, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [131, 146], + loc: { + start: { column: 19, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [129, 146], + loc: { + start: { column: 17, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [127, 147], + loc: { + start: { column: 15, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + + range: [114, 147], + loc: { + start: { column: 2, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + ], + + range: [110, 149], + loc: { + start: { column: 37, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "AbstractSocket", + + range: [95, 109], + loc: { + start: { column: 22, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + superClass: null, + + range: [80, 149], + loc: { + start: { column: 7, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [73, 149], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "module", + + range: [73, 150], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..db824384c033 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-optional-method TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [80, 88], + loc: { + start: { column: 7, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [89, 94], + loc: { + start: { column: 16, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "AbstractSocket", + + range: [95, 109], + loc: { + start: { column: 22, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "createSocket", + + range: [114, 126], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [126, 127], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [127, 128], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [128, 129], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [129, 130], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Promise", + + range: [131, 138], + loc: { + start: { column: 19, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [138, 139], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [139, 145], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [145, 146], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [146, 147], + loc: { + start: { column: 34, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [148, 149], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..de5aa4e99ff2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/3-Babel-AST.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-optional-method Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "createSocket", + + range: [114, 126], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + kind: "method", + optional: true, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Promise", + + range: [131, 138], + loc: { + start: { column: 19, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [139, 145], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + + range: [138, 146], + loc: { + start: { column: 26, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [131, 146], + loc: { + start: { column: 19, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [129, 146], + loc: { + start: { column: 17, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [127, 147], + loc: { + start: { column: 15, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + + range: [114, 147], + loc: { + start: { column: 2, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + ], + + range: [110, 149], + loc: { + start: { column: 37, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "AbstractSocket", + + range: [95, 109], + loc: { + start: { column: 22, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + superClass: null, + + range: [80, 149], + loc: { + start: { column: 7, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [73, 149], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "module", + + range: [73, 150], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..233bd41af226 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-optional-method Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [80, 88], + loc: { + start: { column: 7, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [89, 94], + loc: { + start: { column: 16, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "AbstractSocket", + + range: [95, 109], + loc: { + start: { column: 22, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "createSocket", + + range: [114, 126], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [126, 127], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [127, 128], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [128, 129], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [129, 130], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Promise", + + range: [131, 138], + loc: { + start: { column: 19, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [138, 139], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [139, 145], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [145, 146], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [146, 147], + loc: { + start: { column: 34, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [148, 149], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..ea291f87cbe6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,154 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-optional-method AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: ClassDeclaration { + type: 'ClassDeclaration', + abstract: true, + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'createSocket', + + range: [114, 126], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + kind: 'method', + optional: true, +- override: false, + static: false, +- value: TSEmptyBodyFunctionExpression { +- type: 'TSEmptyBodyFunctionExpression', ++ value: FunctionExpression { ++ type: 'FunctionExpression', + async: false, +- body: null, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'Promise', + + range: [131, 138], + loc: { + start: { column: 19, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSStringKeyword { + type: 'TSStringKeyword', + + range: [139, 145], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + + range: [138, 146], + loc: { + start: { column: 26, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [131, 146], + loc: { + start: { column: 19, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [129, 146], + loc: { + start: { column: 17, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [127, 147], + loc: { + start: { column: 15, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + + range: [114, 147], + loc: { + start: { column: 2, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + ], + + range: [110, 149], + loc: { + start: { column: 37, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'AbstractSocket', + + range: [95, 109], + loc: { + start: { column: 22, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + superClass: null, + + range: [80, 149], + loc: { + start: { column: 7, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + exportKind: 'value', + source: null, + specifiers: Array [], + + range: [73, 149], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'module', + + range: [73, 150], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..7e6bd8ab76d2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-optional-method AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/fixture.ts new file mode 100644 index 000000000000..3c0e30cf669b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +abstract class SpecializedComponent extends SomeComponent { + abstract override show(); +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..47c5bb400fb1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,95 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-override-method TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: Array [ + TSAbstractMethodDefinition { + type: "TSAbstractMethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "show", + + range: [153, 157], + loc: { + start: { column: 20, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + kind: "method", + override: true, + static: false, + value: TSEmptyBodyFunctionExpression { + type: "TSEmptyBodyFunctionExpression", + async: false, + body: null, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [157, 160], + loc: { + start: { column: 24, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + + range: [135, 160], + loc: { + start: { column: 2, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + ], + + range: [131, 162], + loc: { + start: { column: 58, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "SpecializedComponent", + + range: [88, 108], + loc: { + start: { column: 15, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "SomeComponent", + + range: [117, 130], + loc: { + start: { column: 44, line: 3 }, + end: { column: 57, line: 3 }, + }, + }, + + range: [73, 162], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 163], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..811d4cceeffe --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-override-method TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "abstract", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "SpecializedComponent", + + range: [88, 108], + loc: { + start: { column: 15, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [109, 116], + loc: { + start: { column: 36, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "SomeComponent", + + range: [117, 130], + loc: { + start: { column: 44, line: 3 }, + end: { column: 57, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [131, 132], + loc: { + start: { column: 58, line: 3 }, + end: { column: 59, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [135, 143], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "override", + + range: [144, 152], + loc: { + start: { column: 11, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "show", + + range: [153, 157], + loc: { + start: { column: 20, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [157, 158], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [158, 159], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [159, 160], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [161, 162], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..16dd3b36c6d8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/3-Babel-AST.shot @@ -0,0 +1,95 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-override-method Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + abstract: true, + computed: false, + key: Identifier { + type: "Identifier", + name: "show", + + range: [153, 157], + loc: { + start: { column: 20, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + kind: "method", + override: true, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [157, 160], + loc: { + start: { column: 24, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + + range: [135, 160], + loc: { + start: { column: 2, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + ], + + range: [131, 162], + loc: { + start: { column: 58, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "SpecializedComponent", + + range: [88, 108], + loc: { + start: { column: 15, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "SomeComponent", + + range: [117, 130], + loc: { + start: { column: 44, line: 3 }, + end: { column: 57, line: 3 }, + }, + }, + + range: [73, 162], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 163], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..a597367b635f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-override-method Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "abstract", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "SpecializedComponent", + + range: [88, 108], + loc: { + start: { column: 15, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [109, 116], + loc: { + start: { column: 36, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "SomeComponent", + + range: [117, 130], + loc: { + start: { column: 44, line: 3 }, + end: { column: 57, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [131, 132], + loc: { + start: { column: 58, line: 3 }, + end: { column: 59, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [135, 143], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "override", + + range: [144, 152], + loc: { + start: { column: 11, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "show", + + range: [153, 157], + loc: { + start: { column: 20, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [157, 158], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [158, 159], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [159, 160], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [161, 162], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..a2123358d04c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,104 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-override-method AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + abstract: true, + body: ClassBody { + type: 'ClassBody', + body: Array [ +- TSAbstractMethodDefinition { +- type: 'TSAbstractMethodDefinition', ++ MethodDefinition { ++ type: 'MethodDefinition', ++ abstract: true, + computed: false, + key: Identifier { + type: 'Identifier', + name: 'show', + + range: [153, 157], + loc: { + start: { column: 20, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + kind: 'method', + override: true, + static: false, +- value: TSEmptyBodyFunctionExpression { +- type: 'TSEmptyBodyFunctionExpression', ++ value: FunctionExpression { ++ type: 'FunctionExpression', + async: false, +- body: null, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [157, 160], + loc: { + start: { column: 24, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + + range: [135, 160], + loc: { + start: { column: 2, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + ], + + range: [131, 162], + loc: { + start: { column: 58, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'SpecializedComponent', + + range: [88, 108], + loc: { + start: { column: 15, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + superClass: Identifier { + type: 'Identifier', + name: 'SomeComponent', + + range: [117, 130], + loc: { + start: { column: 44, line: 3 }, + end: { column: 57, line: 3 }, + }, + }, + + range: [73, 162], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 163], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..dcb8c1e09683 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics abstract-class-with-override-method AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/fixture.ts new file mode 100644 index 000000000000..6076c4d6fcd1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +var asserted2 = (n => { + return n; +}); diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..9eecb615e5e2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,120 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics angle-bracket-type-assertion-arrow-function TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "asserted2", + + range: [77, 86], + loc: { + start: { column: 4, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + init: TSTypeAssertion { + type: "TSTypeAssertion", + expression: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: Identifier { + type: "Identifier", + name: "n", + + range: [111, 112], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [104, 113], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ], + + range: [100, 115], + loc: { + start: { column: 27, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "n", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + + range: [95, 115], + loc: { + start: { column: 22, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [89, 116], + loc: { + start: { column: 16, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + + range: [77, 116], + loc: { + start: { column: 4, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + kind: "var", + + range: [73, 117], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..23c047001d96 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics angle-bracket-type-assertion-arrow-function TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "var", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserted2", + + range: [77, 86], + loc: { + start: { column: 4, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "n", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [97, 99], + loc: { + start: { column: 24, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [104, 110], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "n", + + range: [111, 112], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [112, 113], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [114, 115], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [115, 116], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [116, 117], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..997a20ea955c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/3-Babel-AST.shot @@ -0,0 +1,120 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics angle-bracket-type-assertion-arrow-function Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "asserted2", + + range: [77, 86], + loc: { + start: { column: 4, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + init: TSTypeAssertion { + type: "TSTypeAssertion", + expression: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: Identifier { + type: "Identifier", + name: "n", + + range: [111, 112], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [104, 113], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ], + + range: [100, 115], + loc: { + start: { column: 27, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "n", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + + range: [95, 115], + loc: { + start: { column: 22, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [89, 116], + loc: { + start: { column: 16, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + + range: [77, 116], + loc: { + start: { column: 4, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + kind: "var", + + range: [73, 117], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..6d649cb0c936 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics angle-bracket-type-assertion-arrow-function Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "var", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserted2", + + range: [77, 86], + loc: { + start: { column: 4, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "n", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [97, 99], + loc: { + start: { column: 24, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [104, 110], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "n", + + range: [111, 112], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [112, 113], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [114, 115], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [115, 116], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [116, 117], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..59f0d0c3ecd1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics angle-bracket-type-assertion-arrow-function AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..551f6745c321 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics angle-bracket-type-assertion-arrow-function AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/fixture.ts new file mode 100644 index 000000000000..7eb114ef3e95 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +const foo = 2; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..3167e4026e4a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics angle-bracket-type-assertion TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + init: TSTypeAssertion { + type: "TSTypeAssertion", + expression: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [85, 91], + loc: { + start: { column: 12, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [79, 91], + loc: { + start: { column: 6, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + kind: "const", + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..7a0bd797f3b4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics angle-bracket-type-assertion TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "const", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..92bf012dcace --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/3-Babel-AST.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics angle-bracket-type-assertion Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + init: TSTypeAssertion { + type: "TSTypeAssertion", + expression: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [85, 91], + loc: { + start: { column: 12, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [79, 91], + loc: { + start: { column: 6, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + kind: "const", + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..4633c6f25a00 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics angle-bracket-type-assertion Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "const", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..bebd2e1766fb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics angle-bracket-type-assertion AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..44ddcb635435 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics angle-bracket-type-assertion AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/fixture.ts new file mode 100644 index 000000000000..4d3882a8e67d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +((k?) => k + 1)(); diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..0b5151cde876 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,93 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics arrow-function-with-optional-parameter TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BinaryExpression { + type: "BinaryExpression", + left: Identifier { + type: "Identifier", + name: "k", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + operator: "+", + right: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "k", + optional: true, + + range: [75, 77], + loc: { + start: { column: 2, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + ], + + range: [74, 87], + loc: { + start: { column: 1, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + optional: false, + + range: [73, 90], + loc: { + start: { column: 0, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..133cfeb42b53 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics arrow-function-with-optional-parameter TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "k", + + range: [75, 76], + loc: { + start: { column: 2, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [76, 77], + loc: { + start: { column: 3, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [79, 81], + loc: { + start: { column: 6, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "k", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "+", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..0bf8dcb3f303 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/3-Babel-AST.shot @@ -0,0 +1,93 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics arrow-function-with-optional-parameter Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BinaryExpression { + type: "BinaryExpression", + left: Identifier { + type: "Identifier", + name: "k", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + operator: "+", + right: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "k", + optional: true, + + range: [75, 77], + loc: { + start: { column: 2, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + ], + + range: [74, 87], + loc: { + start: { column: 1, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + optional: false, + + range: [73, 90], + loc: { + start: { column: 0, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..7cfceefc108c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics arrow-function-with-optional-parameter Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "k", + + range: [75, 76], + loc: { + start: { column: 2, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [76, 77], + loc: { + start: { column: 3, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [79, 81], + loc: { + start: { column: 6, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "k", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "+", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..ca850e742148 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics arrow-function-with-optional-parameter AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..3ed32798d632 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics arrow-function-with-optional-parameter AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/fixture.ts new file mode 100644 index 000000000000..0485030e0217 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +(b: X): X => { + return b; +}; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..788e721214b1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,168 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics arrow-function-with-type-parameters TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: Identifier { + type: "Identifier", + name: "b", + + range: [100, 101], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [93, 102], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ], + + range: [89, 104], + loc: { + start: { column: 16, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "b", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "X", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [77, 81], + loc: { + start: { column: 4, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "X", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "X", + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + out: false, + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + ], + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..70e5c0a0be68 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics arrow-function-with-type-parameters TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "<", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [75, 76], + loc: { + start: { column: 2, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [76, 77], + loc: { + start: { column: 3, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [86, 88], + loc: { + start: { column: 13, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [93, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [100, 101], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [101, 102], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [103, 104], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [104, 105], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..62ff9487e9c6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/3-Babel-AST.shot @@ -0,0 +1,157 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics arrow-function-with-type-parameters Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: Identifier { + type: "Identifier", + name: "b", + + range: [100, 101], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [93, 102], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ], + + range: [89, 104], + loc: { + start: { column: 16, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "b", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "X", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [77, 81], + loc: { + start: { column: 4, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "X", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "X", + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + ], + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..667f31ed28c8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics arrow-function-with-type-parameters Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "<", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [75, 76], + loc: { + start: { column: 2, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [76, 77], + loc: { + start: { column: 3, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [86, 88], + loc: { + start: { column: 13, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [93, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [100, 101], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [101, 102], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [103, 104], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [104, 105], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..0886302dddea --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,173 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics arrow-function-with-type-parameters AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExpressionStatement { + type: 'ExpressionStatement', + expression: ArrowFunctionExpression { + type: 'ArrowFunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: Identifier { + type: 'Identifier', + name: 'b', + + range: [100, 101], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [93, 102], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ], + + range: [89, 104], + loc: { + start: { column: 16, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: 'Identifier', + name: 'b', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'X', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [77, 81], + loc: { + start: { column: 4, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'X', + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'X', +- +- range: [74, 75], +- loc: { +- start: { column: 1, line: 3 }, +- end: { column: 2, line: 3 }, +- }, +- }, +- out: false, ++ name: 'X', + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + ], + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..7c75c7c03675 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics arrow-function-with-type-parameters AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/fixture.ts new file mode 100644 index 000000000000..029433b2bdd6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +(async function test() {})(); diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..07c9fd1f6ca8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,69 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics async-function-expression TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: FunctionExpression { + type: "FunctionExpression", + async: true, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [96, 98], + loc: { + start: { column: 23, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "test", + + range: [89, 93], + loc: { + start: { column: 16, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + params: Array [], + + range: [74, 98], + loc: { + start: { column: 1, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + optional: false, + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..11b1cc405730 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics async-function-expression TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "async", + + range: [74, 79], + loc: { + start: { column: 1, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [80, 88], + loc: { + start: { column: 7, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "test", + + range: [89, 93], + loc: { + start: { column: 16, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..bfb645c26069 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/3-Babel-AST.shot @@ -0,0 +1,69 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics async-function-expression Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: FunctionExpression { + type: "FunctionExpression", + async: true, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [96, 98], + loc: { + start: { column: 23, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "test", + + range: [89, 93], + loc: { + start: { column: 16, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + params: Array [], + + range: [74, 98], + loc: { + start: { column: 1, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + optional: false, + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..2a3e9a4f5fba --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics async-function-expression Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "async", + + range: [74, 79], + loc: { + start: { column: 1, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [80, 88], + loc: { + start: { column: 7, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "test", + + range: [89, 93], + loc: { + start: { column: 16, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..6db212a60497 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics async-function-expression AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..18c7806a84ff --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics async-function-expression AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/fixture.ts new file mode 100644 index 000000000000..aa2dba728ee0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/fixture.ts @@ -0,0 +1,7 @@ +// TODO: This fixture might be too large, and if so should be split up. + +async function test() { + var foo = 'foo'; + let bar = 'bar'; + const fooBar = 'fooBar'; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..57dd682e58bb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics async-function-with-var-declaration TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: true, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [103, 106], + loc: { + start: { column: 6, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + init: Literal { + type: "Literal", + raw: "'foo'", + value: "foo", + + range: [109, 114], + loc: { + start: { column: 12, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + + range: [103, 114], + loc: { + start: { column: 6, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + ], + kind: "var", + + range: [99, 115], + loc: { + start: { column: 2, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "bar", + + range: [122, 125], + loc: { + start: { column: 6, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + init: Literal { + type: "Literal", + raw: "'bar'", + value: "bar", + + range: [128, 133], + loc: { + start: { column: 12, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [122, 133], + loc: { + start: { column: 6, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + ], + kind: "let", + + range: [118, 134], + loc: { + start: { column: 2, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "fooBar", + + range: [143, 149], + loc: { + start: { column: 8, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + init: Literal { + type: "Literal", + raw: "'fooBar'", + value: "fooBar", + + range: [152, 160], + loc: { + start: { column: 17, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + + range: [143, 160], + loc: { + start: { column: 8, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + ], + kind: "const", + + range: [137, 161], + loc: { + start: { column: 2, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + ], + + range: [95, 163], + loc: { + start: { column: 22, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "test", + + range: [88, 92], + loc: { + start: { column: 15, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + params: Array [], + + range: [73, 163], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 164], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..1b378974aebe --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,226 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics async-function-with-var-declaration TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "async", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [79, 87], + loc: { + start: { column: 6, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "test", + + range: [88, 92], + loc: { + start: { column: 15, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "var", + + range: [99, 102], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [103, 106], + loc: { + start: { column: 6, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [107, 108], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + String { + type: "String", + value: "'foo'", + + range: [109, 114], + loc: { + start: { column: 12, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [114, 115], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "let", + + range: [118, 121], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [122, 125], + loc: { + start: { column: 6, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [126, 127], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + String { + type: "String", + value: "'bar'", + + range: [128, 133], + loc: { + start: { column: 12, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [133, 134], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [137, 142], + loc: { + start: { column: 2, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "fooBar", + + range: [143, 149], + loc: { + start: { column: 8, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [150, 151], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + String { + type: "String", + value: "'fooBar'", + + range: [152, 160], + loc: { + start: { column: 17, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [160, 161], + loc: { + start: { column: 25, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [162, 163], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..f9b32160e431 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/3-Babel-AST.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics async-function-with-var-declaration Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: true, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [103, 106], + loc: { + start: { column: 6, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + init: Literal { + type: "Literal", + raw: "'foo'", + value: "foo", + + range: [109, 114], + loc: { + start: { column: 12, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + + range: [103, 114], + loc: { + start: { column: 6, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + ], + kind: "var", + + range: [99, 115], + loc: { + start: { column: 2, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "bar", + + range: [122, 125], + loc: { + start: { column: 6, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + init: Literal { + type: "Literal", + raw: "'bar'", + value: "bar", + + range: [128, 133], + loc: { + start: { column: 12, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [122, 133], + loc: { + start: { column: 6, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + ], + kind: "let", + + range: [118, 134], + loc: { + start: { column: 2, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "fooBar", + + range: [143, 149], + loc: { + start: { column: 8, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + init: Literal { + type: "Literal", + raw: "'fooBar'", + value: "fooBar", + + range: [152, 160], + loc: { + start: { column: 17, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + + range: [143, 160], + loc: { + start: { column: 8, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + ], + kind: "const", + + range: [137, 161], + loc: { + start: { column: 2, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + ], + + range: [95, 163], + loc: { + start: { column: 22, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "test", + + range: [88, 92], + loc: { + start: { column: 15, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + params: Array [], + + range: [73, 163], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 164], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..94857b09f73b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,226 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics async-function-with-var-declaration Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "async", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [79, 87], + loc: { + start: { column: 6, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "test", + + range: [88, 92], + loc: { + start: { column: 15, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "var", + + range: [99, 102], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [103, 106], + loc: { + start: { column: 6, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [107, 108], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + String { + type: "String", + value: "'foo'", + + range: [109, 114], + loc: { + start: { column: 12, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [114, 115], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "let", + + range: [118, 121], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [122, 125], + loc: { + start: { column: 6, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [126, 127], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + String { + type: "String", + value: "'bar'", + + range: [128, 133], + loc: { + start: { column: 12, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [133, 134], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [137, 142], + loc: { + start: { column: 2, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "fooBar", + + range: [143, 149], + loc: { + start: { column: 8, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [150, 151], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + String { + type: "String", + value: "'fooBar'", + + range: [152, 160], + loc: { + start: { column: 17, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [160, 161], + loc: { + start: { column: 25, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [162, 163], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..f37f21626ebf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics async-function-with-var-declaration AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..a8dbcd1488b5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,232 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics async-function-with-var-declaration AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Identifier { + type: 'Identifier', + value: 'async', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'function', + + range: [79, 87], + loc: { + start: { column: 6, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'test', + + range: [88, 92], + loc: { + start: { column: 15, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'var', + + range: [99, 102], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'foo', + + range: [103, 106], + loc: { + start: { column: 6, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [107, 108], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + String { + type: 'String', + value: '\\\\'foo\\\\'', + + range: [109, 114], + loc: { + start: { column: 12, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [114, 115], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [118, 121], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar', + + range: [122, 125], + loc: { + start: { column: 6, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [126, 127], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + String { + type: 'String', + value: '\\\\'bar\\\\'', + + range: [128, 133], + loc: { + start: { column: 12, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [133, 134], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [137, 142], + loc: { + start: { column: 2, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'fooBar', + + range: [143, 149], + loc: { + start: { column: 8, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [150, 151], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + String { + type: 'String', + value: '\\\\'fooBar\\\\'', + + range: [152, 160], + loc: { + start: { column: 17, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [160, 161], + loc: { + start: { column: 25, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [162, 163], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/fixture.ts new file mode 100644 index 000000000000..86310258c529 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type foo = { + (a: string): string; + new (a: string): string; +}; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..9346217d8e18 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,224 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics call-signatures-with-generics TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSCallSignatureDeclaration { + type: "TSCallSignatureDeclaration", + params: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [95, 101], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [93, 101], + loc: { + start: { column: 7, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [92, 101], + loc: { + start: { column: 6, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [104, 110], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [102, 110], + loc: { + start: { column: 16, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [89, 90], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + out: false, + + range: [89, 90], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + ], + + range: [88, 91], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + + range: [88, 111], + loc: { + start: { column: 2, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + TSConstructSignatureDeclaration { + type: "TSConstructSignatureDeclaration", + params: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [125, 131], + loc: { + start: { column: 13, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + + range: [123, 131], + loc: { + start: { column: 11, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + + range: [122, 131], + loc: { + start: { column: 10, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [134, 140], + loc: { + start: { column: 22, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + + range: [132, 140], + loc: { + start: { column: 20, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [119, 120], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + out: false, + + range: [119, 120], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + ], + + range: [118, 121], + loc: { + start: { column: 6, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + + range: [114, 141], + loc: { + start: { column: 2, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + ], + + range: [84, 143], + loc: { + start: { column: 11, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + + range: [73, 144], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 145], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..2b9331d217a3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,296 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics call-signatures-with-generics TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [88, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [89, 90], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [90, 91], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [91, 92], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [92, 93], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [93, 94], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [95, 101], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [101, 102], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [104, 110], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [110, 111], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [114, 117], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [118, 119], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [119, 120], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [120, 121], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [121, 122], + loc: { + start: { column: 9, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [122, 123], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [123, 124], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [125, 131], + loc: { + start: { column: 13, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [131, 132], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [132, 133], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [134, 140], + loc: { + start: { column: 22, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [140, 141], + loc: { + start: { column: 28, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [142, 143], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [143, 144], + loc: { + start: { column: 1, line: 6 }, + end: { column: 2, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..43854edbc3d9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/3-Babel-AST.shot @@ -0,0 +1,202 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics call-signatures-with-generics Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSCallSignatureDeclaration { + type: "TSCallSignatureDeclaration", + parameters: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [95, 101], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [93, 101], + loc: { + start: { column: 7, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [92, 101], + loc: { + start: { column: 6, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [104, 110], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [102, 110], + loc: { + start: { column: 16, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [89, 90], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + ], + + range: [88, 91], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + + range: [88, 111], + loc: { + start: { column: 2, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + TSConstructSignatureDeclaration { + type: "TSConstructSignatureDeclaration", + parameters: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [125, 131], + loc: { + start: { column: 13, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + + range: [123, 131], + loc: { + start: { column: 11, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + + range: [122, 131], + loc: { + start: { column: 10, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [134, 140], + loc: { + start: { column: 22, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + + range: [132, 140], + loc: { + start: { column: 20, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [119, 120], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + ], + + range: [118, 121], + loc: { + start: { column: 6, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + + range: [114, 141], + loc: { + start: { column: 2, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + ], + + range: [84, 143], + loc: { + start: { column: 11, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + + range: [73, 144], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 145], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..84feb8e6214f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,296 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics call-signatures-with-generics Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [88, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [89, 90], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [90, 91], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [91, 92], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [92, 93], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [93, 94], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [95, 101], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [101, 102], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [104, 110], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [110, 111], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [114, 117], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [118, 119], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [119, 120], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [120, 121], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [121, 122], + loc: { + start: { column: 9, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [122, 123], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [123, 124], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [125, 131], + loc: { + start: { column: 13, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [131, 132], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [132, 133], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [134, 140], + loc: { + start: { column: 22, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [140, 141], + loc: { + start: { column: 28, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [142, 143], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [143, 144], + loc: { + start: { column: 1, line: 6 }, + end: { column: 2, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..6a4db1dffed8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,234 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics call-signatures-with-generics AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'foo', + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: 'TSTypeLiteral', + members: Array [ + TSCallSignatureDeclaration { + type: 'TSCallSignatureDeclaration', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'a', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [95, 101], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [93, 101], + loc: { + start: { column: 7, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [92, 101], + loc: { + start: { column: 6, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [104, 110], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [102, 110], + loc: { + start: { column: 16, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [89, 90], +- loc: { +- start: { column: 3, line: 4 }, +- end: { column: 4, line: 4 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [89, 90], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + ], + + range: [88, 91], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + + range: [88, 111], + loc: { + start: { column: 2, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + TSConstructSignatureDeclaration { + type: 'TSConstructSignatureDeclaration', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'a', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [125, 131], + loc: { + start: { column: 13, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + + range: [123, 131], + loc: { + start: { column: 11, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + + range: [122, 131], + loc: { + start: { column: 10, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [134, 140], + loc: { + start: { column: 22, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + + range: [132, 140], + loc: { + start: { column: 20, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [119, 120], +- loc: { +- start: { column: 7, line: 5 }, +- end: { column: 8, line: 5 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [119, 120], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + ], + + range: [118, 121], + loc: { + start: { column: 6, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + + range: [114, 141], + loc: { + start: { column: 2, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + ], + + range: [84, 143], + loc: { + start: { column: 11, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + + range: [73, 144], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 6 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 145], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..f2a8b30f03ac --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics call-signatures-with-generics AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/fixture.ts new file mode 100644 index 000000000000..256de64bc2ef --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type foo = { + (a: string): string; + new (a: string): string; +}; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..1ebb9dfa9a98 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,160 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics call-signatures TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSCallSignatureDeclaration { + type: "TSCallSignatureDeclaration", + params: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [92, 98], + loc: { + start: { column: 6, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + + range: [90, 98], + loc: { + start: { column: 4, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + + range: [89, 98], + loc: { + start: { column: 3, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [101, 107], + loc: { + start: { column: 15, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [99, 107], + loc: { + start: { column: 13, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [88, 108], + loc: { + start: { column: 2, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + TSConstructSignatureDeclaration { + type: "TSConstructSignatureDeclaration", + params: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [119, 125], + loc: { + start: { column: 10, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + + range: [117, 125], + loc: { + start: { column: 8, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + + range: [116, 125], + loc: { + start: { column: 7, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [128, 134], + loc: { + start: { column: 19, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + + range: [126, 134], + loc: { + start: { column: 17, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + + range: [111, 135], + loc: { + start: { column: 2, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + ], + + range: [84, 137], + loc: { + start: { column: 11, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + + range: [73, 138], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 139], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..8f6c22a07ddf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,236 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics call-signatures TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [88, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [89, 90], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [90, 91], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [92, 98], + loc: { + start: { column: 6, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [98, 99], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [99, 100], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [101, 107], + loc: { + start: { column: 15, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [107, 108], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [111, 114], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [115, 116], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [116, 117], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [117, 118], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [119, 125], + loc: { + start: { column: 10, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [125, 126], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [126, 127], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [128, 134], + loc: { + start: { column: 19, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [134, 135], + loc: { + start: { column: 25, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [136, 137], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [137, 138], + loc: { + start: { column: 1, line: 6 }, + end: { column: 2, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..aa4238d26722 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/3-Babel-AST.shot @@ -0,0 +1,160 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics call-signatures Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSCallSignatureDeclaration { + type: "TSCallSignatureDeclaration", + parameters: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [92, 98], + loc: { + start: { column: 6, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + + range: [90, 98], + loc: { + start: { column: 4, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + + range: [89, 98], + loc: { + start: { column: 3, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [101, 107], + loc: { + start: { column: 15, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [99, 107], + loc: { + start: { column: 13, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [88, 108], + loc: { + start: { column: 2, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + TSConstructSignatureDeclaration { + type: "TSConstructSignatureDeclaration", + parameters: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [119, 125], + loc: { + start: { column: 10, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + + range: [117, 125], + loc: { + start: { column: 8, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + + range: [116, 125], + loc: { + start: { column: 7, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [128, 134], + loc: { + start: { column: 19, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + + range: [126, 134], + loc: { + start: { column: 17, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + + range: [111, 135], + loc: { + start: { column: 2, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + ], + + range: [84, 137], + loc: { + start: { column: 11, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + + range: [73, 138], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 139], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..0061fccc0d28 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,236 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics call-signatures Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [88, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [89, 90], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [90, 91], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [92, 98], + loc: { + start: { column: 6, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [98, 99], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [99, 100], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [101, 107], + loc: { + start: { column: 15, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [107, 108], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [111, 114], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [115, 116], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [116, 117], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [117, 118], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [119, 125], + loc: { + start: { column: 10, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [125, 126], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [126, 127], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [128, 134], + loc: { + start: { column: 19, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [134, 135], + loc: { + start: { column: 25, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [136, 137], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [137, 138], + loc: { + start: { column: 1, line: 6 }, + end: { column: 2, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..33b93128e072 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,168 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics call-signatures AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'foo', + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: 'TSTypeLiteral', + members: Array [ + TSCallSignatureDeclaration { + type: 'TSCallSignatureDeclaration', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'a', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [92, 98], + loc: { + start: { column: 6, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + + range: [90, 98], + loc: { + start: { column: 4, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + + range: [89, 98], + loc: { + start: { column: 3, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [101, 107], + loc: { + start: { column: 15, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [99, 107], + loc: { + start: { column: 13, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [88, 108], + loc: { + start: { column: 2, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + TSConstructSignatureDeclaration { + type: 'TSConstructSignatureDeclaration', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'a', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [119, 125], + loc: { + start: { column: 10, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + + range: [117, 125], + loc: { + start: { column: 8, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + + range: [116, 125], + loc: { + start: { column: 7, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [128, 134], + loc: { + start: { column: 19, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + + range: [126, 134], + loc: { + start: { column: 17, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + + range: [111, 135], + loc: { + start: { column: 2, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + ], + + range: [84, 137], + loc: { + start: { column: 11, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + + range: [73, 138], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 6 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 139], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..c9eb4711c4d1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics call-signatures AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/fixture.ts new file mode 100644 index 000000000000..0c34f39bab27 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +(x < y) as boolean; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..14cfecc47487 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,73 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-expression TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSAsExpression { + type: "TSAsExpression", + expression: BinaryExpression { + type: "BinaryExpression", + left: Identifier { + type: "Identifier", + name: "x", + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + operator: "<", + right: Identifier { + type: "Identifier", + name: "y", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + + range: [74, 79], + loc: { + start: { column: 1, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [84, 91], + loc: { + start: { column: 11, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..b7073ceb5e55 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-expression TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [76, 77], + loc: { + start: { column: 3, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "y", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [81, 83], + loc: { + start: { column: 8, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [84, 91], + loc: { + start: { column: 11, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..b82b88923a0c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/3-Babel-AST.shot @@ -0,0 +1,73 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-expression Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSAsExpression { + type: "TSAsExpression", + expression: BinaryExpression { + type: "BinaryExpression", + left: Identifier { + type: "Identifier", + name: "x", + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + operator: "<", + right: Identifier { + type: "Identifier", + name: "y", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + + range: [74, 79], + loc: { + start: { column: 1, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [84, 91], + loc: { + start: { column: 11, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..612fa55ba1e4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-expression Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [76, 77], + loc: { + start: { column: 3, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "y", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [81, 83], + loc: { + start: { column: 8, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [84, 91], + loc: { + start: { column: 11, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..5a48762a7337 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-expression AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..ccbe890c540e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-expression AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/fixture.ts new file mode 100644 index 000000000000..aad3969a8c6c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +(a as number as any) = 42; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..2eda95a6440d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,92 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-multi-assign TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: TSAsExpression { + type: "TSAsExpression", + expression: TSAsExpression { + type: "TSAsExpression", + expression: Identifier { + type: "Identifier", + name: "a", + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [79, 85], + loc: { + start: { column: 6, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [74, 85], + loc: { + start: { column: 1, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [89, 92], + loc: { + start: { column: 16, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [74, 92], + loc: { + start: { column: 1, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + operator: "=", + right: Literal { + type: "Literal", + raw: "42", + value: 42, + + range: [96, 98], + loc: { + start: { column: 23, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [73, 99], + loc: { + start: { column: 0, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..d0ae2e1f2b67 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-multi-assign TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [76, 78], + loc: { + start: { column: 3, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [79, 85], + loc: { + start: { column: 6, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [86, 88], + loc: { + start: { column: 13, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [89, 92], + loc: { + start: { column: 16, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Numeric { + type: "Numeric", + value: "42", + + range: [96, 98], + loc: { + start: { column: 23, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..24f702a558fa --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/3-Babel-AST.shot @@ -0,0 +1,92 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-multi-assign Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: TSAsExpression { + type: "TSAsExpression", + expression: TSAsExpression { + type: "TSAsExpression", + expression: Identifier { + type: "Identifier", + name: "a", + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [79, 85], + loc: { + start: { column: 6, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [74, 85], + loc: { + start: { column: 1, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [89, 92], + loc: { + start: { column: 16, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [74, 92], + loc: { + start: { column: 1, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + operator: "=", + right: Literal { + type: "Literal", + raw: "42", + value: 42, + + range: [96, 98], + loc: { + start: { column: 23, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [73, 99], + loc: { + start: { column: 0, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..478fef3d1b9e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-multi-assign Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [76, 78], + loc: { + start: { column: 3, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [79, 85], + loc: { + start: { column: 6, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [86, 88], + loc: { + start: { column: 13, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [89, 92], + loc: { + start: { column: 16, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Numeric { + type: "Numeric", + value: "42", + + range: [96, 98], + loc: { + start: { column: 23, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..a4c620a74b81 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-multi-assign AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..9878fb875f86 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-multi-assign AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/fixture.ts new file mode 100644 index 000000000000..e25aff6c6b95 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +x as any as T; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..5f7a2d81d463 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,81 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-multi TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSAsExpression { + type: "TSAsExpression", + expression: TSAsExpression { + type: "TSAsExpression", + expression: Identifier { + type: "Identifier", + name: "x", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 86], + loc: { + start: { column: 0, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 87], + loc: { + start: { column: 0, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 88], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..d3577e9d3485 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-multi TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "x", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [75, 77], + loc: { + start: { column: 2, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [82, 84], + loc: { + start: { column: 9, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..1ec8e0d1cffd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/3-Babel-AST.shot @@ -0,0 +1,81 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-multi Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSAsExpression { + type: "TSAsExpression", + expression: TSAsExpression { + type: "TSAsExpression", + expression: Identifier { + type: "Identifier", + name: "x", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 86], + loc: { + start: { column: 0, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 87], + loc: { + start: { column: 0, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 88], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..df53924bb180 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-multi Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "x", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [75, 77], + loc: { + start: { column: 2, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [82, 84], + loc: { + start: { column: 9, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..38599adfe7fa --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-multi AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..83f40d7ff212 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-multi AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/fixture.ts new file mode 100644 index 000000000000..c0bc7649ce90 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +x === (1 as number); diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..68298b562770 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,74 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-operator TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: BinaryExpression { + type: "BinaryExpression", + left: Identifier { + type: "Identifier", + name: "x", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + operator: "===", + right: TSAsExpression { + type: "TSAsExpression", + expression: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [85, 91], + loc: { + start: { column: 12, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [80, 91], + loc: { + start: { column: 7, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..adfc21caffee --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-operator TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "x", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "===", + + range: [75, 78], + loc: { + start: { column: 2, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [82, 84], + loc: { + start: { column: 9, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [85, 91], + loc: { + start: { column: 12, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..7f721cb0ad60 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/3-Babel-AST.shot @@ -0,0 +1,74 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-operator Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: BinaryExpression { + type: "BinaryExpression", + left: Identifier { + type: "Identifier", + name: "x", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + operator: "===", + right: TSAsExpression { + type: "TSAsExpression", + expression: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [85, 91], + loc: { + start: { column: 12, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [80, 91], + loc: { + start: { column: 7, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..ad93ab5e4e3c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-operator Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "x", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "===", + + range: [75, 78], + loc: { + start: { column: 2, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [82, 84], + loc: { + start: { column: 9, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [85, 91], + loc: { + start: { column: 12, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..4b0c8c0b06b7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-operator AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..c76b8b205d89 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-operator AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/fixture.ts new file mode 100644 index 000000000000..1b096daf4f56 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +const foo = x as any; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..fc82bb51bf3d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,75 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-simple TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + init: TSAsExpression { + type: "TSAsExpression", + expression: Identifier { + type: "Identifier", + name: "x", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [79, 93], + loc: { + start: { column: 6, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + kind: "const", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..6918498edd24 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-simple TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "const", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [87, 89], + loc: { + start: { column: 14, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..437d3cb4c482 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/3-Babel-AST.shot @@ -0,0 +1,75 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-simple Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + init: TSAsExpression { + type: "TSAsExpression", + expression: Identifier { + type: "Identifier", + name: "x", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [79, 93], + loc: { + start: { column: 6, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + kind: "const", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..ebaf4ef56a62 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-simple Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "const", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [87, 89], + loc: { + start: { column: 14, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..2f9dfe1a2353 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-simple AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..25785cbf9850 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics cast-as-simple AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/fixture.ts new file mode 100644 index 000000000000..862b179502d2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/fixture.ts @@ -0,0 +1,7 @@ +// TODO: This fixture might be too large, and if so should be split up. + +try { +} catch (e: any) {} + +try { +} catch (e: unknown) {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..73031bf931ea --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,150 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics catch-clause-with-annotation TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TryStatement { + type: "TryStatement", + block: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 1, line: 4 }, + }, + }, + finalizer: null, + handler: CatchClause { + type: "CatchClause", + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [96, 98], + loc: { + start: { column: 17, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + param: Identifier { + type: "Identifier", + name: "e", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [91, 94], + loc: { + start: { column: 12, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [89, 94], + loc: { + start: { column: 10, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [88, 94], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [81, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 19, line: 4 }, + }, + }, + TryStatement { + type: "TryStatement", + block: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [104, 107], + loc: { + start: { column: 4, line: 6 }, + end: { column: 1, line: 7 }, + }, + }, + finalizer: null, + handler: CatchClause { + type: "CatchClause", + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [127, 129], + loc: { + start: { column: 21, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + param: Identifier { + type: "Identifier", + name: "e", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnknownKeyword { + type: "TSUnknownKeyword", + + range: [118, 125], + loc: { + start: { column: 12, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + + range: [116, 125], + loc: { + start: { column: 10, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + + range: [115, 125], + loc: { + start: { column: 9, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + + range: [108, 129], + loc: { + start: { column: 2, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + + range: [100, 129], + loc: { + start: { column: 0, line: 6 }, + end: { column: 23, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 130], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..1a64085c61ad --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,226 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics catch-clause-with-annotation TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "try", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [79, 80], + loc: { + start: { column: 0, line: 4 }, + end: { column: 1, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "catch", + + range: [81, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [87, 88], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "e", + + range: [88, 89], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [89, 90], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [91, 94], + loc: { + start: { column: 12, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [94, 95], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [96, 97], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [97, 98], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "try", + + range: [100, 103], + loc: { + start: { column: 0, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [104, 105], + loc: { + start: { column: 4, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [106, 107], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "catch", + + range: [108, 113], + loc: { + start: { column: 2, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [114, 115], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "e", + + range: [115, 116], + loc: { + start: { column: 9, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [116, 117], + loc: { + start: { column: 10, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "unknown", + + range: [118, 125], + loc: { + start: { column: 12, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [125, 126], + loc: { + start: { column: 19, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [127, 128], + loc: { + start: { column: 21, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [128, 129], + loc: { + start: { column: 22, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..af80c15438a6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/3-Babel-AST.shot @@ -0,0 +1,150 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics catch-clause-with-annotation Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TryStatement { + type: "TryStatement", + block: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 1, line: 4 }, + }, + }, + finalizer: null, + handler: CatchClause { + type: "CatchClause", + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [96, 98], + loc: { + start: { column: 17, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + param: Identifier { + type: "Identifier", + name: "e", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [91, 94], + loc: { + start: { column: 12, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [89, 94], + loc: { + start: { column: 10, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [88, 94], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [81, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 19, line: 4 }, + }, + }, + TryStatement { + type: "TryStatement", + block: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [104, 107], + loc: { + start: { column: 4, line: 6 }, + end: { column: 1, line: 7 }, + }, + }, + finalizer: null, + handler: CatchClause { + type: "CatchClause", + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [127, 129], + loc: { + start: { column: 21, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + param: Identifier { + type: "Identifier", + name: "e", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnknownKeyword { + type: "TSUnknownKeyword", + + range: [118, 125], + loc: { + start: { column: 12, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + + range: [116, 125], + loc: { + start: { column: 10, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + + range: [115, 125], + loc: { + start: { column: 9, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + + range: [108, 129], + loc: { + start: { column: 2, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + + range: [100, 129], + loc: { + start: { column: 0, line: 6 }, + end: { column: 23, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 130], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..1afa55c534d0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,226 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics catch-clause-with-annotation Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "try", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [79, 80], + loc: { + start: { column: 0, line: 4 }, + end: { column: 1, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "catch", + + range: [81, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [87, 88], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "e", + + range: [88, 89], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [89, 90], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [91, 94], + loc: { + start: { column: 12, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [94, 95], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [96, 97], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [97, 98], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "try", + + range: [100, 103], + loc: { + start: { column: 0, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [104, 105], + loc: { + start: { column: 4, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [106, 107], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "catch", + + range: [108, 113], + loc: { + start: { column: 2, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [114, 115], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "e", + + range: [115, 116], + loc: { + start: { column: 9, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [116, 117], + loc: { + start: { column: 10, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "unknown", + + range: [118, 125], + loc: { + start: { column: 12, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [125, 126], + loc: { + start: { column: 19, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [127, 128], + loc: { + start: { column: 21, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [128, 129], + loc: { + start: { column: 22, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..89b8eb95c595 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics catch-clause-with-annotation AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..62b559fffea1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics catch-clause-with-annotation AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/fixture.ts new file mode 100644 index 000000000000..3a8be0ce9197 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/fixture.ts @@ -0,0 +1,4 @@ +// TODO: This fixture might be too large, and if so should be split up. + +try { +} catch (e: string) {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..cf0a97d3afd6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,83 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics catch-clause-with-invalid-annotation TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TryStatement { + type: "TryStatement", + block: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 1, line: 4 }, + }, + }, + finalizer: null, + handler: CatchClause { + type: "CatchClause", + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [99, 101], + loc: { + start: { column: 20, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + param: Identifier { + type: "Identifier", + name: "e", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [91, 97], + loc: { + start: { column: 12, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [89, 97], + loc: { + start: { column: 10, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [88, 97], + loc: { + start: { column: 9, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [81, 101], + loc: { + start: { column: 2, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 22, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..64d031e837ab --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics catch-clause-with-invalid-annotation TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "try", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [79, 80], + loc: { + start: { column: 0, line: 4 }, + end: { column: 1, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "catch", + + range: [81, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [87, 88], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "e", + + range: [88, 89], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [89, 90], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [91, 97], + loc: { + start: { column: 12, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [97, 98], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [99, 100], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [100, 101], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..24860f593b80 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/3-Babel-AST.shot @@ -0,0 +1,83 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics catch-clause-with-invalid-annotation Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TryStatement { + type: "TryStatement", + block: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 1, line: 4 }, + }, + }, + finalizer: null, + handler: CatchClause { + type: "CatchClause", + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [99, 101], + loc: { + start: { column: 20, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + param: Identifier { + type: "Identifier", + name: "e", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [91, 97], + loc: { + start: { column: 12, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [89, 97], + loc: { + start: { column: 10, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [88, 97], + loc: { + start: { column: 9, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [81, 101], + loc: { + start: { column: 2, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 22, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..fd7fbaeb83c4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics catch-clause-with-invalid-annotation Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "try", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [79, 80], + loc: { + start: { column: 0, line: 4 }, + end: { column: 1, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "catch", + + range: [81, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [87, 88], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "e", + + range: [88, 89], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [89, 90], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [91, 97], + loc: { + start: { column: 12, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [97, 98], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [99, 100], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [100, 101], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..ff4be300dbe3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics catch-clause-with-invalid-annotation AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..ddcc6d1eaa8f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics catch-clause-with-invalid-annotation AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/fixture.ts new file mode 100644 index 000000000000..0d3e9dd6c976 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/fixture.ts @@ -0,0 +1,4 @@ +// TODO: This fixture might be too large, and if so should be split up. + +abstract; +class B {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..3b834e81c9b3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,65 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-multi-line-keyword-abstract TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: Identifier { + type: "Identifier", + name: "abstract", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [91, 93], + loc: { + start: { column: 8, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "B", + + range: [89, 90], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + superClass: null, + + range: [83, 93], + loc: { + start: { column: 0, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..7c7d30548d1c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-multi-line-keyword-abstract TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "abstract", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [83, 88], + loc: { + start: { column: 0, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [89, 90], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [91, 92], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [92, 93], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..9aee98eac4f7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/3-Babel-AST.shot @@ -0,0 +1,65 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-multi-line-keyword-abstract Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: Identifier { + type: "Identifier", + name: "abstract", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [91, 93], + loc: { + start: { column: 8, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "B", + + range: [89, 90], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + superClass: null, + + range: [83, 93], + loc: { + start: { column: 0, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..03f76889c5c7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-multi-line-keyword-abstract Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "abstract", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [83, 88], + loc: { + start: { column: 0, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [89, 90], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [91, 92], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [92, 93], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..c36526457e79 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-multi-line-keyword-abstract AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..55a5dcb94fb6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-multi-line-keyword-abstract AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/fixture.ts new file mode 100644 index 000000000000..5bb43c49b117 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/fixture.ts @@ -0,0 +1,4 @@ +// TODO: This fixture might be too large, and if so should be split up. + +declare; +class B {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..d834afb0baea --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,65 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-multi-line-keyword-declare TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: Identifier { + type: "Identifier", + name: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [90, 92], + loc: { + start: { column: 8, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "B", + + range: [88, 89], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + superClass: null, + + range: [82, 92], + loc: { + start: { column: 0, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..47994c5c658e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-multi-line-keyword-declare TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [82, 87], + loc: { + start: { column: 0, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [88, 89], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [90, 91], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [91, 92], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..f63de7acb5c0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/3-Babel-AST.shot @@ -0,0 +1,65 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-multi-line-keyword-declare Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: Identifier { + type: "Identifier", + name: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [90, 92], + loc: { + start: { column: 8, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "B", + + range: [88, 89], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + superClass: null, + + range: [82, 92], + loc: { + start: { column: 0, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..5d960db6b578 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-multi-line-keyword-declare Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [82, 87], + loc: { + start: { column: 0, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [88, 89], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [90, 91], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [91, 92], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..91ba03ff880f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-multi-line-keyword-declare AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..609220fb34ad --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-multi-line-keyword-declare AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/fixture.ts new file mode 100644 index 000000000000..011775eb6648 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/fixture.ts @@ -0,0 +1,10 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + #priv1: number; + #priv2: number = 1; + + constructor() { + this.#priv1 = 1; + } +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..798be99f4e43 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,249 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-private-identifier-field-with-annotation TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + key: PrivateIdentifier { + type: "PrivateIdentifier", + name: "priv1", + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [95, 101], + loc: { + start: { column: 10, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [93, 101], + loc: { + start: { column: 8, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + value: null, + + range: [87, 102], + loc: { + start: { column: 2, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + key: PrivateIdentifier { + type: "PrivateIdentifier", + name: "priv2", + + range: [105, 111], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [113, 119], + loc: { + start: { column: 10, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + + range: [111, 119], + loc: { + start: { column: 8, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + value: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [122, 123], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + + range: [105, 124], + loc: { + start: { column: 2, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [128, 139], + loc: { + start: { column: 2, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + kind: "constructor", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [148, 152], + loc: { + start: { column: 4, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + optional: false, + property: PrivateIdentifier { + type: "PrivateIdentifier", + name: "priv1", + + range: [153, 159], + loc: { + start: { column: 9, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + + range: [148, 159], + loc: { + start: { column: 4, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + operator: "=", + right: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [162, 163], + loc: { + start: { column: 18, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + + range: [148, 163], + loc: { + start: { column: 4, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + + range: [148, 164], + loc: { + start: { column: 4, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + ], + + range: [142, 168], + loc: { + start: { column: 16, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [139, 168], + loc: { + start: { column: 13, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + + range: [128, 168], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + ], + + range: [83, 170], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 170], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 171], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..c784225a6edb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,256 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-private-identifier-field-with-annotation TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "#priv1", + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [93, 94], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [95, 101], + loc: { + start: { column: 10, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [101, 102], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "#priv2", + + range: [105, 111], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [111, 112], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [113, 119], + loc: { + start: { column: 10, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [120, 121], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [122, 123], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [123, 124], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [128, 139], + loc: { + start: { column: 2, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [139, 140], + loc: { + start: { column: 13, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [140, 141], + loc: { + start: { column: 14, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [142, 143], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [148, 152], + loc: { + start: { column: 4, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [152, 153], + loc: { + start: { column: 8, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "#priv1", + + range: [153, 159], + loc: { + start: { column: 9, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [160, 161], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [162, 163], + loc: { + start: { column: 18, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [163, 164], + loc: { + start: { column: 19, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [167, 168], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [169, 170], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..061e9fb44c5d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/3-Babel-AST.shot @@ -0,0 +1,244 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-private-identifier-field-with-annotation Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + key: PrivateIdentifier { + type: "PrivateIdentifier", + name: "priv1", + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [95, 101], + loc: { + start: { column: 10, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [93, 101], + loc: { + start: { column: 8, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + value: null, + + range: [87, 102], + loc: { + start: { column: 2, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + key: PrivateIdentifier { + type: "PrivateIdentifier", + name: "priv2", + + range: [105, 111], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [113, 119], + loc: { + start: { column: 10, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + + range: [111, 119], + loc: { + start: { column: 8, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + value: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [122, 123], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + + range: [105, 124], + loc: { + start: { column: 2, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [128, 139], + loc: { + start: { column: 2, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + kind: "constructor", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [148, 152], + loc: { + start: { column: 4, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + optional: false, + property: PrivateIdentifier { + type: "PrivateIdentifier", + name: "priv1", + + range: [153, 159], + loc: { + start: { column: 9, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + + range: [148, 159], + loc: { + start: { column: 4, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + operator: "=", + right: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [162, 163], + loc: { + start: { column: 18, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + + range: [148, 163], + loc: { + start: { column: 4, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + + range: [148, 164], + loc: { + start: { column: 4, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + ], + + range: [142, 168], + loc: { + start: { column: 16, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [139, 168], + loc: { + start: { column: 13, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + + range: [128, 168], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + ], + + range: [83, 170], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 170], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 171], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..92ea3a454cd6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,256 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-private-identifier-field-with-annotation Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + PrivateIdentifier { + type: "PrivateIdentifier", + value: "priv1", + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [93, 94], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [95, 101], + loc: { + start: { column: 10, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [101, 102], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + PrivateIdentifier { + type: "PrivateIdentifier", + value: "priv2", + + range: [105, 111], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [111, 112], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [113, 119], + loc: { + start: { column: 10, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [120, 121], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [122, 123], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [123, 124], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [128, 139], + loc: { + start: { column: 2, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [139, 140], + loc: { + start: { column: 13, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [140, 141], + loc: { + start: { column: 14, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [142, 143], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [148, 152], + loc: { + start: { column: 4, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [152, 153], + loc: { + start: { column: 8, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + PrivateIdentifier { + type: "PrivateIdentifier", + value: "priv1", + + range: [153, 159], + loc: { + start: { column: 9, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [160, 161], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [162, 163], + loc: { + start: { column: 18, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [163, 164], + loc: { + start: { column: 19, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [167, 168], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [169, 170], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..50e07fdec6a3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,253 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-private-identifier-field-with-annotation AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + key: PrivateIdentifier { + type: 'PrivateIdentifier', + name: 'priv1', + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [95, 101], + loc: { + start: { column: 10, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [93, 101], + loc: { + start: { column: 8, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + value: null, + + range: [87, 102], + loc: { + start: { column: 2, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + key: PrivateIdentifier { + type: 'PrivateIdentifier', + name: 'priv2', + + range: [105, 111], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [113, 119], + loc: { + start: { column: 10, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + + range: [111, 119], + loc: { + start: { column: 8, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + value: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [122, 123], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + + range: [105, 124], + loc: { + start: { column: 2, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'constructor', + + range: [128, 139], + loc: { + start: { column: 2, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + kind: 'constructor', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ExpressionStatement { + type: 'ExpressionStatement', + expression: AssignmentExpression { + type: 'AssignmentExpression', + left: MemberExpression { + type: 'MemberExpression', + computed: false, + object: ThisExpression { + type: 'ThisExpression', + + range: [148, 152], + loc: { + start: { column: 4, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + optional: false, + property: PrivateIdentifier { + type: 'PrivateIdentifier', + name: 'priv1', + + range: [153, 159], + loc: { + start: { column: 9, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + + range: [148, 159], + loc: { + start: { column: 4, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + operator: '=', + right: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [162, 163], + loc: { + start: { column: 18, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + + range: [148, 163], + loc: { + start: { column: 4, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + + range: [148, 164], + loc: { + start: { column: 4, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + ], + + range: [142, 168], + loc: { + start: { column: 16, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [139, 168], + loc: { + start: { column: 13, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + + range: [128, 168], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + ], + + range: [83, 170], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 170], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 171], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..866b70e2678f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,269 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-private-identifier-field-with-annotation AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, +- Identifier { +- type: 'Identifier', +- value: '#priv1', ++ PrivateIdentifier { ++ type: 'PrivateIdentifier', ++ value: 'priv1', + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [93, 94], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [95, 101], + loc: { + start: { column: 10, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [101, 102], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, +- Identifier { +- type: 'Identifier', +- value: '#priv2', ++ PrivateIdentifier { ++ type: 'PrivateIdentifier', ++ value: 'priv2', + + range: [105, 111], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [111, 112], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [113, 119], + loc: { + start: { column: 10, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [120, 121], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [122, 123], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [123, 124], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'constructor', + + range: [128, 139], + loc: { + start: { column: 2, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [139, 140], + loc: { + start: { column: 13, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [140, 141], + loc: { + start: { column: 14, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [142, 143], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'this', + + range: [148, 152], + loc: { + start: { column: 4, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '.', + + range: [152, 153], + loc: { + start: { column: 8, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, +- Identifier { +- type: 'Identifier', +- value: '#priv1', ++ PrivateIdentifier { ++ type: 'PrivateIdentifier', ++ value: 'priv1', + + range: [153, 159], + loc: { + start: { column: 9, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [160, 161], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [162, 163], + loc: { + start: { column: 18, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [163, 164], + loc: { + start: { column: 19, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [167, 168], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [169, 170], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/fixture.ts new file mode 100644 index 000000000000..dd830c4c84e7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + readonly #priv: string; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..eebfd0349f20 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,90 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-private-identifier-readonly-field TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + key: PrivateIdentifier { + type: "PrivateIdentifier", + name: "priv", + + range: [96, 101], + loc: { + start: { column: 11, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + override: false, + readonly: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [103, 109], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [101, 109], + loc: { + start: { column: 16, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + value: null, + + range: [87, 110], + loc: { + start: { column: 2, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + ], + + range: [83, 112], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..557bd53d6473 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-private-identifier-readonly-field TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [87, 95], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "#priv", + + range: [96, 101], + loc: { + start: { column: 11, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [101, 102], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [103, 109], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [109, 110], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [111, 112], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..22d1bb0dffa5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/3-Babel-AST.shot @@ -0,0 +1,88 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-private-identifier-readonly-field Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + key: PrivateIdentifier { + type: "PrivateIdentifier", + name: "priv", + + range: [96, 101], + loc: { + start: { column: 11, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + readonly: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [103, 109], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [101, 109], + loc: { + start: { column: 16, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + value: null, + + range: [87, 110], + loc: { + start: { column: 2, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + ], + + range: [83, 112], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..c2d7cff7d771 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-private-identifier-readonly-field Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [87, 95], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + PrivateIdentifier { + type: "PrivateIdentifier", + value: "priv", + + range: [96, 101], + loc: { + start: { column: 11, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [101, 102], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [103, 109], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [109, 110], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [111, 112], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..4a94acfc12a9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,94 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-private-identifier-readonly-field AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + key: PrivateIdentifier { + type: 'PrivateIdentifier', + name: 'priv', + + range: [96, 101], + loc: { + start: { column: 11, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, +- override: false, + readonly: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [103, 109], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [101, 109], + loc: { + start: { column: 16, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + value: null, + + range: [87, 110], + loc: { + start: { column: 2, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + ], + + range: [83, 112], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..f3da9c110b26 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,103 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-private-identifier-readonly-field AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'readonly', + + range: [87, 95], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, +- Identifier { +- type: 'Identifier', +- value: '#priv', ++ PrivateIdentifier { ++ type: 'PrivateIdentifier', ++ value: 'priv', + + range: [96, 101], + loc: { + start: { column: 11, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [101, 102], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [103, 109], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [109, 110], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [111, 112], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/fixture.ts new file mode 100644 index 000000000000..ad198cdc7e5f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/fixture.ts @@ -0,0 +1,10 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + static count = 0; + static { + if (someCondition()) { + count++; + } + } +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..6050bf68a3bb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,164 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-static-blocks TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "count", + + range: [94, 99], + loc: { + start: { column: 9, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + override: false, + static: true, + value: Literal { + type: "Literal", + raw: "0", + value: 0, + + range: [102, 103], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [87, 104], + loc: { + start: { column: 2, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + StaticBlock { + type: "StaticBlock", + body: Array [ + IfStatement { + type: "IfStatement", + alternate: null, + consequent: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: UpdateExpression { + type: "UpdateExpression", + argument: Identifier { + type: "Identifier", + name: "count", + + range: [149, 154], + loc: { + start: { column: 6, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + operator: "++", + prefix: false, + + range: [149, 156], + loc: { + start: { column: 6, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + + range: [149, 157], + loc: { + start: { column: 6, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + ], + + range: [141, 163], + loc: { + start: { column: 25, line: 6 }, + end: { column: 5, line: 8 }, + }, + }, + test: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "someCondition", + + range: [124, 137], + loc: { + start: { column: 8, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, + optional: false, + + range: [124, 139], + loc: { + start: { column: 8, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + + range: [120, 163], + loc: { + start: { column: 4, line: 6 }, + end: { column: 5, line: 8 }, + }, + }, + ], + + range: [107, 167], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 9 }, + }, + }, + ], + + range: [83, 169], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 169], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 170], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..e7f4c131f645 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,236 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-static-blocks TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "count", + + range: [94, 99], + loc: { + start: { column: 9, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [100, 101], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "0", + + range: [102, 103], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [103, 104], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [107, 113], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [114, 115], + loc: { + start: { column: 9, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "if", + + range: [120, 122], + loc: { + start: { column: 4, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [123, 124], + loc: { + start: { column: 7, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "someCondition", + + range: [124, 137], + loc: { + start: { column: 8, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [137, 138], + loc: { + start: { column: 21, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [138, 139], + loc: { + start: { column: 22, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [139, 140], + loc: { + start: { column: 23, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [141, 142], + loc: { + start: { column: 25, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "count", + + range: [149, 154], + loc: { + start: { column: 6, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "++", + + range: [154, 156], + loc: { + start: { column: 11, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [156, 157], + loc: { + start: { column: 13, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [162, 163], + loc: { + start: { column: 4, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [166, 167], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [168, 169], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..276f3d2e7330 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/3-Babel-AST.shot @@ -0,0 +1,162 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-static-blocks Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "count", + + range: [94, 99], + loc: { + start: { column: 9, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + static: true, + value: Literal { + type: "Literal", + raw: "0", + value: 0, + + range: [102, 103], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [87, 104], + loc: { + start: { column: 2, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + StaticBlock { + type: "StaticBlock", + body: Array [ + IfStatement { + type: "IfStatement", + alternate: null, + consequent: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: UpdateExpression { + type: "UpdateExpression", + argument: Identifier { + type: "Identifier", + name: "count", + + range: [149, 154], + loc: { + start: { column: 6, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + operator: "++", + prefix: false, + + range: [149, 156], + loc: { + start: { column: 6, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + + range: [149, 157], + loc: { + start: { column: 6, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + ], + + range: [141, 163], + loc: { + start: { column: 25, line: 6 }, + end: { column: 5, line: 8 }, + }, + }, + test: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "someCondition", + + range: [124, 137], + loc: { + start: { column: 8, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, + optional: false, + + range: [124, 139], + loc: { + start: { column: 8, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + + range: [120, 163], + loc: { + start: { column: 4, line: 6 }, + end: { column: 5, line: 8 }, + }, + }, + ], + + range: [107, 167], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 9 }, + }, + }, + ], + + range: [83, 169], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 169], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 170], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..e9c92b21d525 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,236 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-static-blocks Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "count", + + range: [94, 99], + loc: { + start: { column: 9, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [100, 101], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "0", + + range: [102, 103], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [103, 104], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [107, 113], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [114, 115], + loc: { + start: { column: 9, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "if", + + range: [120, 122], + loc: { + start: { column: 4, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [123, 124], + loc: { + start: { column: 7, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "someCondition", + + range: [124, 137], + loc: { + start: { column: 8, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [137, 138], + loc: { + start: { column: 21, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [138, 139], + loc: { + start: { column: 22, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [139, 140], + loc: { + start: { column: 23, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [141, 142], + loc: { + start: { column: 25, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "count", + + range: [149, 154], + loc: { + start: { column: 6, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "++", + + range: [154, 156], + loc: { + start: { column: 11, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [156, 157], + loc: { + start: { column: 13, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [162, 163], + loc: { + start: { column: 4, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [166, 167], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [168, 169], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..c937657039ca --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,168 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-static-blocks AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'count', + + range: [94, 99], + loc: { + start: { column: 9, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, +- override: false, + static: true, + value: Literal { + type: 'Literal', + raw: '0', + value: 0, + + range: [102, 103], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [87, 104], + loc: { + start: { column: 2, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + StaticBlock { + type: 'StaticBlock', + body: Array [ + IfStatement { + type: 'IfStatement', + alternate: null, + consequent: BlockStatement { + type: 'BlockStatement', + body: Array [ + ExpressionStatement { + type: 'ExpressionStatement', + expression: UpdateExpression { + type: 'UpdateExpression', + argument: Identifier { + type: 'Identifier', + name: 'count', + + range: [149, 154], + loc: { + start: { column: 6, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + operator: '++', + prefix: false, + + range: [149, 156], + loc: { + start: { column: 6, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + + range: [149, 157], + loc: { + start: { column: 6, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + ], + + range: [141, 163], + loc: { + start: { column: 25, line: 6 }, + end: { column: 5, line: 8 }, + }, + }, + test: CallExpression { + type: 'CallExpression', + arguments: Array [], + callee: Identifier { + type: 'Identifier', + name: 'someCondition', + + range: [124, 137], + loc: { + start: { column: 8, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, + optional: false, + + range: [124, 139], + loc: { + start: { column: 8, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + + range: [120, 163], + loc: { + start: { column: 4, line: 6 }, + end: { column: 5, line: 8 }, + }, + }, + ], + + range: [107, 167], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 9 }, + }, + }, + ], + + range: [83, 169], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 169], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 170], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..449d55ea1219 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-static-blocks AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/fixture.ts new file mode 100644 index 000000000000..d665276e4756 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/fixture.ts @@ -0,0 +1,12 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + private bar: string; + public static baz: number; + public getBar() { + return this.bar; + } + protected setBar(bar: string) { + this.bar = bar; + } +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..fac5f0ca998c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,358 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-accessibility-modifiers TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + accessibility: "private", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [95, 98], + loc: { + start: { column: 10, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [100, 106], + loc: { + start: { column: 15, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [98, 106], + loc: { + start: { column: 13, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + value: null, + + range: [87, 107], + loc: { + start: { column: 2, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + accessibility: "public", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [124, 127], + loc: { + start: { column: 16, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + override: false, + static: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [129, 135], + loc: { + start: { column: 21, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + + range: [127, 135], + loc: { + start: { column: 19, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + value: null, + + range: [110, 136], + loc: { + start: { column: 2, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + accessibility: "public", + computed: false, + key: Identifier { + type: "Identifier", + name: "getBar", + + range: [146, 152], + loc: { + start: { column: 9, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [168, 172], + loc: { + start: { column: 11, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "bar", + + range: [173, 176], + loc: { + start: { column: 16, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + + range: [168, 176], + loc: { + start: { column: 11, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + + range: [161, 177], + loc: { + start: { column: 4, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + ], + + range: [155, 181], + loc: { + start: { column: 18, line: 6 }, + end: { column: 3, line: 8 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [152, 181], + loc: { + start: { column: 15, line: 6 }, + end: { column: 3, line: 8 }, + }, + }, + + range: [139, 181], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 8 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + accessibility: "protected", + computed: false, + key: Identifier { + type: "Identifier", + name: "setBar", + + range: [194, 200], + loc: { + start: { column: 12, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [220, 224], + loc: { + start: { column: 4, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "bar", + + range: [225, 228], + loc: { + start: { column: 9, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + + range: [220, 228], + loc: { + start: { column: 4, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + operator: "=", + right: Identifier { + type: "Identifier", + name: "bar", + + range: [231, 234], + loc: { + start: { column: 15, line: 10 }, + end: { column: 18, line: 10 }, + }, + }, + + range: [220, 234], + loc: { + start: { column: 4, line: 10 }, + end: { column: 18, line: 10 }, + }, + }, + + range: [220, 235], + loc: { + start: { column: 4, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + ], + + range: [214, 239], + loc: { + start: { column: 32, line: 9 }, + end: { column: 3, line: 11 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "bar", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [206, 212], + loc: { + start: { column: 24, line: 9 }, + end: { column: 30, line: 9 }, + }, + }, + + range: [204, 212], + loc: { + start: { column: 22, line: 9 }, + end: { column: 30, line: 9 }, + }, + }, + + range: [201, 212], + loc: { + start: { column: 19, line: 9 }, + end: { column: 30, line: 9 }, + }, + }, + ], + + range: [200, 239], + loc: { + start: { column: 18, line: 9 }, + end: { column: 3, line: 11 }, + }, + }, + + range: [184, 239], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 11 }, + }, + }, + ], + + range: [83, 241], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 12 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 241], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 12 }, + }, + }, + ], + sourceType: "script", + + range: [73, 242], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 13 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..e991db347272 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,416 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-accessibility-modifiers TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "private", + + range: [87, 94], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [95, 98], + loc: { + start: { column: 10, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [98, 99], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [100, 106], + loc: { + start: { column: 15, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [106, 107], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [110, 116], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [117, 123], + loc: { + start: { column: 9, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [124, 127], + loc: { + start: { column: 16, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [127, 128], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [129, 135], + loc: { + start: { column: 21, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [135, 136], + loc: { + start: { column: 27, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [139, 145], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "getBar", + + range: [146, 152], + loc: { + start: { column: 9, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [152, 153], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [153, 154], + loc: { + start: { column: 16, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [155, 156], + loc: { + start: { column: 18, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [161, 167], + loc: { + start: { column: 4, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [168, 172], + loc: { + start: { column: 11, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [172, 173], + loc: { + start: { column: 15, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [173, 176], + loc: { + start: { column: 16, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [176, 177], + loc: { + start: { column: 19, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [180, 181], + loc: { + start: { column: 2, line: 8 }, + end: { column: 3, line: 8 }, + }, + }, + Keyword { + type: "Keyword", + value: "protected", + + range: [184, 193], + loc: { + start: { column: 2, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "setBar", + + range: [194, 200], + loc: { + start: { column: 12, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [200, 201], + loc: { + start: { column: 18, line: 9 }, + end: { column: 19, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [201, 204], + loc: { + start: { column: 19, line: 9 }, + end: { column: 22, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [204, 205], + loc: { + start: { column: 22, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [206, 212], + loc: { + start: { column: 24, line: 9 }, + end: { column: 30, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [212, 213], + loc: { + start: { column: 30, line: 9 }, + end: { column: 31, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [214, 215], + loc: { + start: { column: 32, line: 9 }, + end: { column: 33, line: 9 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [220, 224], + loc: { + start: { column: 4, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [224, 225], + loc: { + start: { column: 8, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [225, 228], + loc: { + start: { column: 9, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [229, 230], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [231, 234], + loc: { + start: { column: 15, line: 10 }, + end: { column: 18, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [234, 235], + loc: { + start: { column: 18, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [238, 239], + loc: { + start: { column: 2, line: 11 }, + end: { column: 3, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [240, 241], + loc: { + start: { column: 0, line: 12 }, + end: { column: 1, line: 12 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..4dcb4e7870c8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/3-Babel-AST.shot @@ -0,0 +1,352 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-accessibility-modifiers Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + accessibility: "private", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [95, 98], + loc: { + start: { column: 10, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [100, 106], + loc: { + start: { column: 15, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [98, 106], + loc: { + start: { column: 13, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + value: null, + + range: [87, 107], + loc: { + start: { column: 2, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + accessibility: "public", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [124, 127], + loc: { + start: { column: 16, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + static: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [129, 135], + loc: { + start: { column: 21, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + + range: [127, 135], + loc: { + start: { column: 19, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + value: null, + + range: [110, 136], + loc: { + start: { column: 2, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + accessibility: "public", + computed: false, + key: Identifier { + type: "Identifier", + name: "getBar", + + range: [146, 152], + loc: { + start: { column: 9, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [168, 172], + loc: { + start: { column: 11, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "bar", + + range: [173, 176], + loc: { + start: { column: 16, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + + range: [168, 176], + loc: { + start: { column: 11, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + + range: [161, 177], + loc: { + start: { column: 4, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + ], + + range: [155, 181], + loc: { + start: { column: 18, line: 6 }, + end: { column: 3, line: 8 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [152, 181], + loc: { + start: { column: 15, line: 6 }, + end: { column: 3, line: 8 }, + }, + }, + + range: [139, 181], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 8 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + accessibility: "protected", + computed: false, + key: Identifier { + type: "Identifier", + name: "setBar", + + range: [194, 200], + loc: { + start: { column: 12, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [220, 224], + loc: { + start: { column: 4, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "bar", + + range: [225, 228], + loc: { + start: { column: 9, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + + range: [220, 228], + loc: { + start: { column: 4, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + operator: "=", + right: Identifier { + type: "Identifier", + name: "bar", + + range: [231, 234], + loc: { + start: { column: 15, line: 10 }, + end: { column: 18, line: 10 }, + }, + }, + + range: [220, 234], + loc: { + start: { column: 4, line: 10 }, + end: { column: 18, line: 10 }, + }, + }, + + range: [220, 235], + loc: { + start: { column: 4, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + ], + + range: [214, 239], + loc: { + start: { column: 32, line: 9 }, + end: { column: 3, line: 11 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "bar", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [206, 212], + loc: { + start: { column: 24, line: 9 }, + end: { column: 30, line: 9 }, + }, + }, + + range: [204, 212], + loc: { + start: { column: 22, line: 9 }, + end: { column: 30, line: 9 }, + }, + }, + + range: [201, 212], + loc: { + start: { column: 19, line: 9 }, + end: { column: 30, line: 9 }, + }, + }, + ], + + range: [200, 239], + loc: { + start: { column: 18, line: 9 }, + end: { column: 3, line: 11 }, + }, + }, + + range: [184, 239], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 11 }, + }, + }, + ], + + range: [83, 241], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 12 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 241], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 12 }, + }, + }, + ], + sourceType: "script", + + range: [73, 242], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 13 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..d80ee29186a4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,416 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-accessibility-modifiers Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "private", + + range: [87, 94], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [95, 98], + loc: { + start: { column: 10, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [98, 99], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [100, 106], + loc: { + start: { column: 15, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [106, 107], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [110, 116], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [117, 123], + loc: { + start: { column: 9, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [124, 127], + loc: { + start: { column: 16, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [127, 128], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [129, 135], + loc: { + start: { column: 21, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [135, 136], + loc: { + start: { column: 27, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [139, 145], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "getBar", + + range: [146, 152], + loc: { + start: { column: 9, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [152, 153], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [153, 154], + loc: { + start: { column: 16, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [155, 156], + loc: { + start: { column: 18, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [161, 167], + loc: { + start: { column: 4, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [168, 172], + loc: { + start: { column: 11, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [172, 173], + loc: { + start: { column: 15, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [173, 176], + loc: { + start: { column: 16, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [176, 177], + loc: { + start: { column: 19, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [180, 181], + loc: { + start: { column: 2, line: 8 }, + end: { column: 3, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "protected", + + range: [184, 193], + loc: { + start: { column: 2, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "setBar", + + range: [194, 200], + loc: { + start: { column: 12, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [200, 201], + loc: { + start: { column: 18, line: 9 }, + end: { column: 19, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [201, 204], + loc: { + start: { column: 19, line: 9 }, + end: { column: 22, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [204, 205], + loc: { + start: { column: 22, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [206, 212], + loc: { + start: { column: 24, line: 9 }, + end: { column: 30, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [212, 213], + loc: { + start: { column: 30, line: 9 }, + end: { column: 31, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [214, 215], + loc: { + start: { column: 32, line: 9 }, + end: { column: 33, line: 9 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [220, 224], + loc: { + start: { column: 4, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [224, 225], + loc: { + start: { column: 8, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [225, 228], + loc: { + start: { column: 9, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [229, 230], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [231, 234], + loc: { + start: { column: 15, line: 10 }, + end: { column: 18, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [234, 235], + loc: { + start: { column: 18, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [238, 239], + loc: { + start: { column: 2, line: 11 }, + end: { column: 3, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [240, 241], + loc: { + start: { column: 0, line: 12 }, + end: { column: 1, line: 12 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..3e92199a42e2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,362 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-accessibility-modifiers AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + accessibility: 'private', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'bar', + + range: [95, 98], + loc: { + start: { column: 10, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [100, 106], + loc: { + start: { column: 15, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [98, 106], + loc: { + start: { column: 13, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + value: null, + + range: [87, 107], + loc: { + start: { column: 2, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + accessibility: 'public', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'baz', + + range: [124, 127], + loc: { + start: { column: 16, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, +- override: false, + static: true, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [129, 135], + loc: { + start: { column: 21, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + + range: [127, 135], + loc: { + start: { column: 19, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + value: null, + + range: [110, 136], + loc: { + start: { column: 2, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + accessibility: 'public', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'getBar', + + range: [146, 152], + loc: { + start: { column: 9, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: MemberExpression { + type: 'MemberExpression', + computed: false, + object: ThisExpression { + type: 'ThisExpression', + + range: [168, 172], + loc: { + start: { column: 11, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: 'Identifier', + name: 'bar', + + range: [173, 176], + loc: { + start: { column: 16, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + + range: [168, 176], + loc: { + start: { column: 11, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + + range: [161, 177], + loc: { + start: { column: 4, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + ], + + range: [155, 181], + loc: { + start: { column: 18, line: 6 }, + end: { column: 3, line: 8 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [152, 181], + loc: { + start: { column: 15, line: 6 }, + end: { column: 3, line: 8 }, + }, + }, + + range: [139, 181], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 8 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + accessibility: 'protected', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'setBar', + + range: [194, 200], + loc: { + start: { column: 12, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ExpressionStatement { + type: 'ExpressionStatement', + expression: AssignmentExpression { + type: 'AssignmentExpression', + left: MemberExpression { + type: 'MemberExpression', + computed: false, + object: ThisExpression { + type: 'ThisExpression', + + range: [220, 224], + loc: { + start: { column: 4, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + optional: false, + property: Identifier { + type: 'Identifier', + name: 'bar', + + range: [225, 228], + loc: { + start: { column: 9, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + + range: [220, 228], + loc: { + start: { column: 4, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + operator: '=', + right: Identifier { + type: 'Identifier', + name: 'bar', + + range: [231, 234], + loc: { + start: { column: 15, line: 10 }, + end: { column: 18, line: 10 }, + }, + }, + + range: [220, 234], + loc: { + start: { column: 4, line: 10 }, + end: { column: 18, line: 10 }, + }, + }, + + range: [220, 235], + loc: { + start: { column: 4, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + ], + + range: [214, 239], + loc: { + start: { column: 32, line: 9 }, + end: { column: 3, line: 11 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: 'Identifier', + name: 'bar', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [206, 212], + loc: { + start: { column: 24, line: 9 }, + end: { column: 30, line: 9 }, + }, + }, + + range: [204, 212], + loc: { + start: { column: 22, line: 9 }, + end: { column: 30, line: 9 }, + }, + }, + + range: [201, 212], + loc: { + start: { column: 19, line: 9 }, + end: { column: 30, line: 9 }, + }, + }, + ], + + range: [200, 239], + loc: { + start: { column: 18, line: 9 }, + end: { column: 3, line: 11 }, + }, + }, + + range: [184, 239], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 11 }, + }, + }, + ], + + range: [83, 241], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 12 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 241], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 12 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 242], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 13 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..4360b4901eb5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,428 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-accessibility-modifiers AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'private', + + range: [87, 94], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar', + + range: [95, 98], + loc: { + start: { column: 10, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [98, 99], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [100, 106], + loc: { + start: { column: 15, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [106, 107], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [110, 116], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'static', + + range: [117, 123], + loc: { + start: { column: 9, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'baz', + + range: [124, 127], + loc: { + start: { column: 16, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [127, 128], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [129, 135], + loc: { + start: { column: 21, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [135, 136], + loc: { + start: { column: 27, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [139, 145], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'getBar', + + range: [146, 152], + loc: { + start: { column: 9, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [152, 153], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [153, 154], + loc: { + start: { column: 16, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [155, 156], + loc: { + start: { column: 18, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'return', + + range: [161, 167], + loc: { + start: { column: 4, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'this', + + range: [168, 172], + loc: { + start: { column: 11, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '.', + + range: [172, 173], + loc: { + start: { column: 15, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar', + + range: [173, 176], + loc: { + start: { column: 16, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [176, 177], + loc: { + start: { column: 19, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [180, 181], + loc: { + start: { column: 2, line: 8 }, + end: { column: 3, line: 8 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'protected', + + range: [184, 193], + loc: { + start: { column: 2, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'setBar', + + range: [194, 200], + loc: { + start: { column: 12, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [200, 201], + loc: { + start: { column: 18, line: 9 }, + end: { column: 19, line: 9 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar', + + range: [201, 204], + loc: { + start: { column: 19, line: 9 }, + end: { column: 22, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [204, 205], + loc: { + start: { column: 22, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [206, 212], + loc: { + start: { column: 24, line: 9 }, + end: { column: 30, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [212, 213], + loc: { + start: { column: 30, line: 9 }, + end: { column: 31, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [214, 215], + loc: { + start: { column: 32, line: 9 }, + end: { column: 33, line: 9 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'this', + + range: [220, 224], + loc: { + start: { column: 4, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '.', + + range: [224, 225], + loc: { + start: { column: 8, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar', + + range: [225, 228], + loc: { + start: { column: 9, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [229, 230], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar', + + range: [231, 234], + loc: { + start: { column: 15, line: 10 }, + end: { column: 18, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [234, 235], + loc: { + start: { column: 18, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [238, 239], + loc: { + start: { column: 2, line: 11 }, + end: { column: 3, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [240, 241], + loc: { + start: { column: 0, line: 12 }, + end: { column: 1, line: 12 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/fixture.ts new file mode 100644 index 000000000000..ac2073843810 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/fixture.ts @@ -0,0 +1,7 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class C { + protected constructor() {} + + public ['constructor']() {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..e46d47826821 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,144 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-modifier TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + accessibility: "protected", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [95, 106], + loc: { + start: { column: 12, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + kind: "constructor", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [109, 111], + loc: { + start: { column: 26, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [106, 111], + loc: { + start: { column: 23, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + + range: [85, 111], + loc: { + start: { column: 2, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + accessibility: "public", + computed: true, + key: Literal { + type: "Literal", + raw: "'constructor'", + value: "constructor", + + range: [123, 136], + loc: { + start: { column: 10, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [140, 142], + loc: { + start: { column: 27, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [137, 142], + loc: { + start: { column: 24, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + + range: [115, 142], + loc: { + start: { column: 2, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + ], + + range: [81, 144], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "C", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 144], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 145], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..d96bfb383f83 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,186 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-modifier TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "protected", + + range: [85, 94], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [95, 106], + loc: { + start: { column: 12, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [106, 107], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [107, 108], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [109, 110], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [110, 111], + loc: { + start: { column: 27, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [115, 121], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [122, 123], + loc: { + start: { column: 9, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + String { + type: "String", + value: "'constructor'", + + range: [123, 136], + loc: { + start: { column: 10, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [136, 137], + loc: { + start: { column: 23, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [137, 138], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [138, 139], + loc: { + start: { column: 25, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [140, 141], + loc: { + start: { column: 27, line: 6 }, + end: { column: 28, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [141, 142], + loc: { + start: { column: 28, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [143, 144], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..df220da600e4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/3-Babel-AST.shot @@ -0,0 +1,142 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-modifier Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + accessibility: "protected", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [95, 106], + loc: { + start: { column: 12, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + kind: "constructor", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [109, 111], + loc: { + start: { column: 26, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [106, 111], + loc: { + start: { column: 23, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + + range: [85, 111], + loc: { + start: { column: 2, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + accessibility: "public", + computed: true, + key: Literal { + type: "Literal", + raw: "'constructor'", + value: "constructor", + + range: [123, 136], + loc: { + start: { column: 10, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [140, 142], + loc: { + start: { column: 27, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [137, 142], + loc: { + start: { column: 24, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + + range: [115, 142], + loc: { + start: { column: 2, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + ], + + range: [81, 144], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "C", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 144], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 145], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..9a96e5ad66f9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,186 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-modifier Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "protected", + + range: [85, 94], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [95, 106], + loc: { + start: { column: 12, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [106, 107], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [107, 108], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [109, 110], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [110, 111], + loc: { + start: { column: 27, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [115, 121], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [122, 123], + loc: { + start: { column: 9, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + String { + type: "String", + value: "'constructor'", + + range: [123, 136], + loc: { + start: { column: 10, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [136, 137], + loc: { + start: { column: 23, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [137, 138], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [138, 139], + loc: { + start: { column: 25, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [140, 141], + loc: { + start: { column: 27, line: 6 }, + end: { column: 28, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [141, 142], + loc: { + start: { column: 28, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [143, 144], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..09565af57920 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,148 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-modifier AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + accessibility: 'protected', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'constructor', + + range: [95, 106], + loc: { + start: { column: 12, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + kind: 'constructor', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [109, 111], + loc: { + start: { column: 26, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [106, 111], + loc: { + start: { column: 23, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + + range: [85, 111], + loc: { + start: { column: 2, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + accessibility: 'public', + computed: true, + key: Literal { + type: 'Literal', + raw: '\\\\'constructor\\\\'', + value: 'constructor', + + range: [123, 136], + loc: { + start: { column: 10, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [140, 142], + loc: { + start: { column: 27, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [137, 142], + loc: { + start: { column: 24, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + + range: [115, 142], + loc: { + start: { column: 2, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + ], + + range: [81, 144], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'C', + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 144], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 145], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..16e6f938f8bf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,194 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-modifier AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'C', + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'protected', + + range: [85, 94], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'constructor', + + range: [95, 106], + loc: { + start: { column: 12, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [106, 107], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [107, 108], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [109, 110], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [110, 111], + loc: { + start: { column: 27, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [115, 121], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [122, 123], + loc: { + start: { column: 9, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + String { + type: 'String', + value: '\\\\'constructor\\\\'', + + range: [123, 136], + loc: { + start: { column: 10, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [136, 137], + loc: { + start: { column: 23, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [137, 138], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [138, 139], + loc: { + start: { column: 25, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [140, 141], + loc: { + start: { column: 27, line: 6 }, + end: { column: 28, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [141, 142], + loc: { + start: { column: 28, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [143, 144], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/fixture.ts new file mode 100644 index 000000000000..64e81fabf495 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class SpecializedComponent extends SomeComponent { + constructor(protected override readonly param: string) {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..a0d2cc8f0257 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,144 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-parameter-property-with-modifiers TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [126, 137], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: "constructor", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [181, 183], + loc: { + start: { column: 57, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "protected", + override: true, + parameter: Identifier { + type: "Identifier", + name: "param", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [173, 179], + loc: { + start: { column: 49, line: 4 }, + end: { column: 55, line: 4 }, + }, + }, + + range: [171, 179], + loc: { + start: { column: 47, line: 4 }, + end: { column: 55, line: 4 }, + }, + }, + + range: [166, 179], + loc: { + start: { column: 42, line: 4 }, + end: { column: 55, line: 4 }, + }, + }, + readonly: true, + + range: [138, 179], + loc: { + start: { column: 14, line: 4 }, + end: { column: 55, line: 4 }, + }, + }, + ], + + range: [137, 183], + loc: { + start: { column: 13, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + + range: [126, 183], + loc: { + start: { column: 2, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + ], + + range: [122, 185], + loc: { + start: { column: 49, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "SpecializedComponent", + + range: [79, 99], + loc: { + start: { column: 6, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "SomeComponent", + + range: [108, 121], + loc: { + start: { column: 35, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + + range: [73, 185], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 186], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..c2531333b8b3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-parameter-property-with-modifiers TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "SpecializedComponent", + + range: [79, 99], + loc: { + start: { column: 6, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [100, 107], + loc: { + start: { column: 27, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "SomeComponent", + + range: [108, 121], + loc: { + start: { column: 35, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [122, 123], + loc: { + start: { column: 49, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [126, 137], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [137, 138], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "protected", + + range: [138, 147], + loc: { + start: { column: 14, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "override", + + range: [148, 156], + loc: { + start: { column: 24, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [157, 165], + loc: { + start: { column: 33, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "param", + + range: [166, 171], + loc: { + start: { column: 42, line: 4 }, + end: { column: 47, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [171, 172], + loc: { + start: { column: 47, line: 4 }, + end: { column: 48, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [173, 179], + loc: { + start: { column: 49, line: 4 }, + end: { column: 55, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [179, 180], + loc: { + start: { column: 55, line: 4 }, + end: { column: 56, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [181, 182], + loc: { + start: { column: 57, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [182, 183], + loc: { + start: { column: 58, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [184, 185], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..ad808d3b70fd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/3-Babel-AST.shot @@ -0,0 +1,143 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-parameter-property-with-modifiers Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [126, 137], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: "constructor", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [181, 183], + loc: { + start: { column: 57, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "protected", + override: true, + parameter: Identifier { + type: "Identifier", + name: "param", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [173, 179], + loc: { + start: { column: 49, line: 4 }, + end: { column: 55, line: 4 }, + }, + }, + + range: [171, 179], + loc: { + start: { column: 47, line: 4 }, + end: { column: 55, line: 4 }, + }, + }, + + range: [166, 179], + loc: { + start: { column: 42, line: 4 }, + end: { column: 55, line: 4 }, + }, + }, + readonly: true, + + range: [138, 179], + loc: { + start: { column: 14, line: 4 }, + end: { column: 55, line: 4 }, + }, + }, + ], + + range: [137, 183], + loc: { + start: { column: 13, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + + range: [126, 183], + loc: { + start: { column: 2, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + ], + + range: [122, 185], + loc: { + start: { column: 49, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "SpecializedComponent", + + range: [79, 99], + loc: { + start: { column: 6, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "SomeComponent", + + range: [108, 121], + loc: { + start: { column: 35, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + + range: [73, 185], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 186], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..88dede1fdad0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-parameter-property-with-modifiers Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "SpecializedComponent", + + range: [79, 99], + loc: { + start: { column: 6, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [100, 107], + loc: { + start: { column: 27, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "SomeComponent", + + range: [108, 121], + loc: { + start: { column: 35, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [122, 123], + loc: { + start: { column: 49, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [126, 137], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [137, 138], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "protected", + + range: [138, 147], + loc: { + start: { column: 14, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "override", + + range: [148, 156], + loc: { + start: { column: 24, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [157, 165], + loc: { + start: { column: 33, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "param", + + range: [166, 171], + loc: { + start: { column: 42, line: 4 }, + end: { column: 47, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [171, 172], + loc: { + start: { column: 47, line: 4 }, + end: { column: 48, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [173, 179], + loc: { + start: { column: 49, line: 4 }, + end: { column: 55, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [179, 180], + loc: { + start: { column: 55, line: 4 }, + end: { column: 56, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [181, 182], + loc: { + start: { column: 57, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [182, 183], + loc: { + start: { column: 58, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [184, 185], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..1fad65fb13d2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,148 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-parameter-property-with-modifiers AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'constructor', + + range: [126, 137], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: 'constructor', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [181, 183], + loc: { + start: { column: 57, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: 'TSParameterProperty', + accessibility: 'protected', + override: true, + parameter: Identifier { + type: 'Identifier', + name: 'param', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [173, 179], + loc: { + start: { column: 49, line: 4 }, + end: { column: 55, line: 4 }, + }, + }, + + range: [171, 179], + loc: { + start: { column: 47, line: 4 }, + end: { column: 55, line: 4 }, + }, + }, + + range: [166, 179], + loc: { + start: { column: 42, line: 4 }, + end: { column: 55, line: 4 }, + }, + }, + readonly: true, + + range: [138, 179], + loc: { + start: { column: 14, line: 4 }, + end: { column: 55, line: 4 }, + }, + }, + ], + + range: [137, 183], + loc: { + start: { column: 13, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + + range: [126, 183], + loc: { + start: { column: 2, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + ], + + range: [122, 185], + loc: { + start: { column: 49, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'SpecializedComponent', + + range: [79, 99], + loc: { + start: { column: 6, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + superClass: Identifier { + type: 'Identifier', + name: 'SomeComponent', + + range: [108, 121], + loc: { + start: { column: 35, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + + range: [73, 185], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 186], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..ab7411230bbe --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,182 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-parameter-property-with-modifiers AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'SpecializedComponent', + + range: [79, 99], + loc: { + start: { column: 6, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'extends', + + range: [100, 107], + loc: { + start: { column: 27, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'SomeComponent', + + range: [108, 121], + loc: { + start: { column: 35, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [122, 123], + loc: { + start: { column: 49, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'constructor', + + range: [126, 137], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [137, 138], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'protected', + + range: [138, 147], + loc: { + start: { column: 14, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'override', + + range: [148, 156], + loc: { + start: { column: 24, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'readonly', + + range: [157, 165], + loc: { + start: { column: 33, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'param', + + range: [166, 171], + loc: { + start: { column: 42, line: 4 }, + end: { column: 47, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [171, 172], + loc: { + start: { column: 47, line: 4 }, + end: { column: 48, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [173, 179], + loc: { + start: { column: 49, line: 4 }, + end: { column: 55, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [179, 180], + loc: { + start: { column: 55, line: 4 }, + end: { column: 56, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [181, 182], + loc: { + start: { column: 57, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [182, 183], + loc: { + start: { column: 58, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [184, 185], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/fixture.ts new file mode 100644 index 000000000000..e77e9c715841 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/fixture.ts @@ -0,0 +1,7 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class SpecializedComponent extends SomeComponent { + constructor(override param: string) { + super(); + } +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..c1328dc71165 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,172 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-parameter-proptery-with-override-modifier TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [126, 137], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: "constructor", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Super { + type: "Super", + + range: [168, 173], + loc: { + start: { column: 4, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + optional: false, + + range: [168, 175], + loc: { + start: { column: 4, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [168, 176], + loc: { + start: { column: 4, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + ], + + range: [162, 180], + loc: { + start: { column: 38, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: "TSParameterProperty", + override: true, + parameter: Identifier { + type: "Identifier", + name: "param", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [154, 160], + loc: { + start: { column: 30, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + + range: [152, 160], + loc: { + start: { column: 28, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + + range: [147, 160], + loc: { + start: { column: 23, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + + range: [138, 160], + loc: { + start: { column: 14, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + ], + + range: [137, 180], + loc: { + start: { column: 13, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [126, 180], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + ], + + range: [122, 182], + loc: { + start: { column: 49, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "SpecializedComponent", + + range: [79, 99], + loc: { + start: { column: 6, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "SomeComponent", + + range: [108, 121], + loc: { + start: { column: 35, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + + range: [73, 182], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 183], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..e20822e9dac3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,196 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-parameter-proptery-with-override-modifier TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "SpecializedComponent", + + range: [79, 99], + loc: { + start: { column: 6, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [100, 107], + loc: { + start: { column: 27, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "SomeComponent", + + range: [108, 121], + loc: { + start: { column: 35, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [122, 123], + loc: { + start: { column: 49, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [126, 137], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [137, 138], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "override", + + range: [138, 146], + loc: { + start: { column: 14, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "param", + + range: [147, 152], + loc: { + start: { column: 23, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [152, 153], + loc: { + start: { column: 28, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [154, 160], + loc: { + start: { column: 30, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [160, 161], + loc: { + start: { column: 36, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [162, 163], + loc: { + start: { column: 38, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "super", + + range: [168, 173], + loc: { + start: { column: 4, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [173, 174], + loc: { + start: { column: 9, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [174, 175], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [175, 176], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [179, 180], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [181, 182], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..4c99c6346512 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/3-Babel-AST.shot @@ -0,0 +1,171 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-parameter-proptery-with-override-modifier Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [126, 137], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: "constructor", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Super { + type: "Super", + + range: [168, 173], + loc: { + start: { column: 4, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + optional: false, + + range: [168, 175], + loc: { + start: { column: 4, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [168, 176], + loc: { + start: { column: 4, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + ], + + range: [162, 180], + loc: { + start: { column: 38, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: "TSParameterProperty", + override: true, + parameter: Identifier { + type: "Identifier", + name: "param", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [154, 160], + loc: { + start: { column: 30, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + + range: [152, 160], + loc: { + start: { column: 28, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + + range: [147, 160], + loc: { + start: { column: 23, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + + range: [138, 160], + loc: { + start: { column: 14, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + ], + + range: [137, 180], + loc: { + start: { column: 13, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [126, 180], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + ], + + range: [122, 182], + loc: { + start: { column: 49, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "SpecializedComponent", + + range: [79, 99], + loc: { + start: { column: 6, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "SomeComponent", + + range: [108, 121], + loc: { + start: { column: 35, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + + range: [73, 182], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 183], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..18e1e8d37a98 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,196 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-parameter-proptery-with-override-modifier Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "SpecializedComponent", + + range: [79, 99], + loc: { + start: { column: 6, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [100, 107], + loc: { + start: { column: 27, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "SomeComponent", + + range: [108, 121], + loc: { + start: { column: 35, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [122, 123], + loc: { + start: { column: 49, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [126, 137], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [137, 138], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "override", + + range: [138, 146], + loc: { + start: { column: 14, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "param", + + range: [147, 152], + loc: { + start: { column: 23, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [152, 153], + loc: { + start: { column: 28, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [154, 160], + loc: { + start: { column: 30, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [160, 161], + loc: { + start: { column: 36, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [162, 163], + loc: { + start: { column: 38, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "super", + + range: [168, 173], + loc: { + start: { column: 4, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [173, 174], + loc: { + start: { column: 9, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [174, 175], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [175, 176], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [179, 180], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [181, 182], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..fa57caf9773b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-parameter-proptery-with-override-modifier AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'constructor', + + range: [126, 137], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: 'constructor', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ExpressionStatement { + type: 'ExpressionStatement', + expression: CallExpression { + type: 'CallExpression', + arguments: Array [], + callee: Super { + type: 'Super', + + range: [168, 173], + loc: { + start: { column: 4, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + optional: false, + + range: [168, 175], + loc: { + start: { column: 4, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [168, 176], + loc: { + start: { column: 4, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + ], + + range: [162, 180], + loc: { + start: { column: 38, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: 'TSParameterProperty', + override: true, + parameter: Identifier { + type: 'Identifier', + name: 'param', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [154, 160], + loc: { + start: { column: 30, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + + range: [152, 160], + loc: { + start: { column: 28, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + + range: [147, 160], + loc: { + start: { column: 23, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + + range: [138, 160], + loc: { + start: { column: 14, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + ], + + range: [137, 180], + loc: { + start: { column: 13, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [126, 180], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + ], + + range: [122, 182], + loc: { + start: { column: 49, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'SpecializedComponent', + + range: [79, 99], + loc: { + start: { column: 6, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + superClass: Identifier { + type: 'Identifier', + name: 'SomeComponent', + + range: [108, 121], + loc: { + start: { column: 35, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + + range: [73, 182], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 183], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..bc581c1e67b0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-parameter-proptery-with-override-modifier AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/fixture.ts new file mode 100644 index 000000000000..bc4d636ab1b5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/fixture.ts @@ -0,0 +1,7 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class C { + constructor(): number {} + + ['constructor'](): number {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..8f34afd368c4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,178 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-return-type TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [85, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: "constructor", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [107, 109], + loc: { + start: { column: 24, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [100, 106], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [98, 106], + loc: { + start: { column: 15, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [96, 109], + loc: { + start: { column: 13, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + + range: [85, 109], + loc: { + start: { column: 2, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: true, + key: Literal { + type: "Literal", + raw: "'constructor'", + value: "constructor", + + range: [114, 127], + loc: { + start: { column: 3, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [139, 141], + loc: { + start: { column: 28, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [132, 138], + loc: { + start: { column: 21, line: 6 }, + end: { column: 27, line: 6 }, + }, + }, + + range: [130, 138], + loc: { + start: { column: 19, line: 6 }, + end: { column: 27, line: 6 }, + }, + }, + + range: [128, 141], + loc: { + start: { column: 17, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + + range: [113, 141], + loc: { + start: { column: 2, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + ], + + range: [81, 143], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "C", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 143], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 144], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..df074b887802 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,206 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-return-type TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [85, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [96, 97], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [97, 98], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [98, 99], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [100, 106], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [107, 108], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [108, 109], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [113, 114], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + String { + type: "String", + value: "'constructor'", + + range: [114, 127], + loc: { + start: { column: 3, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [127, 128], + loc: { + start: { column: 16, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [128, 129], + loc: { + start: { column: 17, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [129, 130], + loc: { + start: { column: 18, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [130, 131], + loc: { + start: { column: 19, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [132, 138], + loc: { + start: { column: 21, line: 6 }, + end: { column: 27, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [139, 140], + loc: { + start: { column: 28, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [140, 141], + loc: { + start: { column: 29, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [142, 143], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..d35c28cc3c2a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/3-Babel-AST.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-return-type Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [85, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: "constructor", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [107, 109], + loc: { + start: { column: 24, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [100, 106], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [98, 106], + loc: { + start: { column: 15, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [96, 109], + loc: { + start: { column: 13, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + + range: [85, 109], + loc: { + start: { column: 2, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: true, + key: Literal { + type: "Literal", + raw: "'constructor'", + value: "constructor", + + range: [114, 127], + loc: { + start: { column: 3, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [139, 141], + loc: { + start: { column: 28, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [132, 138], + loc: { + start: { column: 21, line: 6 }, + end: { column: 27, line: 6 }, + }, + }, + + range: [130, 138], + loc: { + start: { column: 19, line: 6 }, + end: { column: 27, line: 6 }, + }, + }, + + range: [128, 141], + loc: { + start: { column: 17, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + + range: [113, 141], + loc: { + start: { column: 2, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + ], + + range: [81, 143], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "C", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 143], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 144], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..c2759421a4ed --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,206 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-return-type Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [85, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [96, 97], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [97, 98], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [98, 99], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [100, 106], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [107, 108], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [108, 109], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [113, 114], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + String { + type: "String", + value: "'constructor'", + + range: [114, 127], + loc: { + start: { column: 3, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [127, 128], + loc: { + start: { column: 16, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [128, 129], + loc: { + start: { column: 17, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [129, 130], + loc: { + start: { column: 18, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [130, 131], + loc: { + start: { column: 19, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [132, 138], + loc: { + start: { column: 21, line: 6 }, + end: { column: 27, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [139, 140], + loc: { + start: { column: 28, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [140, 141], + loc: { + start: { column: 29, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [142, 143], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..6cb5474d6646 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,182 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-return-type AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'constructor', + + range: [85, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: 'constructor', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [107, 109], + loc: { + start: { column: 24, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [100, 106], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [98, 106], + loc: { + start: { column: 15, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [96, 109], + loc: { + start: { column: 13, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + + range: [85, 109], + loc: { + start: { column: 2, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + computed: true, + key: Literal { + type: 'Literal', + raw: '\\\\'constructor\\\\'', + value: 'constructor', + + range: [114, 127], + loc: { + start: { column: 3, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [139, 141], + loc: { + start: { column: 28, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [132, 138], + loc: { + start: { column: 21, line: 6 }, + end: { column: 27, line: 6 }, + }, + }, + + range: [130, 138], + loc: { + start: { column: 19, line: 6 }, + end: { column: 27, line: 6 }, + }, + }, + + range: [128, 141], + loc: { + start: { column: 17, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + + range: [113, 141], + loc: { + start: { column: 2, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + ], + + range: [81, 143], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'C', + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 143], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 144], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..c3aaeeaae465 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-return-type AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/fixture.ts new file mode 100644 index 000000000000..f82ccb18b699 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/fixture.ts @@ -0,0 +1,11 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class DeclProps { + declare prop1: string; + public declare prop2: string; + declare static prop3: string; + declare readonly prop3: string; + public declare readonly prop4: string; + public declare static prop5: string; + public declare static readonly prop6: string; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..ec98ef7f34f2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,348 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-declare-properties TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop1", + + range: [101, 106], + loc: { + start: { column: 10, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [108, 114], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [106, 114], + loc: { + start: { column: 15, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + value: null, + + range: [93, 115], + loc: { + start: { column: 2, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + accessibility: "public", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop2", + + range: [133, 138], + loc: { + start: { column: 17, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [140, 146], + loc: { + start: { column: 24, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + + range: [138, 146], + loc: { + start: { column: 22, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + value: null, + + range: [118, 147], + loc: { + start: { column: 2, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop3", + + range: [165, 170], + loc: { + start: { column: 17, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, + override: false, + static: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [172, 178], + loc: { + start: { column: 24, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + + range: [170, 178], + loc: { + start: { column: 22, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + value: null, + + range: [150, 179], + loc: { + start: { column: 2, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop3", + + range: [199, 204], + loc: { + start: { column: 19, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + override: false, + readonly: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [206, 212], + loc: { + start: { column: 26, line: 7 }, + end: { column: 32, line: 7 }, + }, + }, + + range: [204, 212], + loc: { + start: { column: 24, line: 7 }, + end: { column: 32, line: 7 }, + }, + }, + value: null, + + range: [182, 213], + loc: { + start: { column: 2, line: 7 }, + end: { column: 33, line: 7 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + accessibility: "public", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop4", + + range: [240, 245], + loc: { + start: { column: 26, line: 8 }, + end: { column: 31, line: 8 }, + }, + }, + override: false, + readonly: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [247, 253], + loc: { + start: { column: 33, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + + range: [245, 253], + loc: { + start: { column: 31, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + value: null, + + range: [216, 254], + loc: { + start: { column: 2, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + accessibility: "public", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop5", + + range: [279, 284], + loc: { + start: { column: 24, line: 9 }, + end: { column: 29, line: 9 }, + }, + }, + override: false, + static: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [286, 292], + loc: { + start: { column: 31, line: 9 }, + end: { column: 37, line: 9 }, + }, + }, + + range: [284, 292], + loc: { + start: { column: 29, line: 9 }, + end: { column: 37, line: 9 }, + }, + }, + value: null, + + range: [257, 293], + loc: { + start: { column: 2, line: 9 }, + end: { column: 38, line: 9 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + accessibility: "public", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop6", + + range: [327, 332], + loc: { + start: { column: 33, line: 10 }, + end: { column: 38, line: 10 }, + }, + }, + override: false, + readonly: true, + static: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [334, 340], + loc: { + start: { column: 40, line: 10 }, + end: { column: 46, line: 10 }, + }, + }, + + range: [332, 340], + loc: { + start: { column: 38, line: 10 }, + end: { column: 46, line: 10 }, + }, + }, + value: null, + + range: [296, 341], + loc: { + start: { column: 2, line: 10 }, + end: { column: 47, line: 10 }, + }, + }, + ], + + range: [89, 343], + loc: { + start: { column: 16, line: 3 }, + end: { column: 1, line: 11 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "DeclProps", + + range: [79, 88], + loc: { + start: { column: 6, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + superClass: null, + + range: [73, 343], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 11 }, + }, + }, + ], + sourceType: "script", + + range: [73, 344], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 12 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..0cfcd64acdf2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,496 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-declare-properties TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "DeclProps", + + range: [79, 88], + loc: { + start: { column: 6, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [93, 100], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop1", + + range: [101, 106], + loc: { + start: { column: 10, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [106, 107], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [108, 114], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [114, 115], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [118, 124], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [125, 132], + loc: { + start: { column: 9, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop2", + + range: [133, 138], + loc: { + start: { column: 17, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [138, 139], + loc: { + start: { column: 22, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [140, 146], + loc: { + start: { column: 24, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [146, 147], + loc: { + start: { column: 30, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [150, 157], + loc: { + start: { column: 2, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [158, 164], + loc: { + start: { column: 10, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop3", + + range: [165, 170], + loc: { + start: { column: 17, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [170, 171], + loc: { + start: { column: 22, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [172, 178], + loc: { + start: { column: 24, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [178, 179], + loc: { + start: { column: 30, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [182, 189], + loc: { + start: { column: 2, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [190, 198], + loc: { + start: { column: 10, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop3", + + range: [199, 204], + loc: { + start: { column: 19, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [204, 205], + loc: { + start: { column: 24, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [206, 212], + loc: { + start: { column: 26, line: 7 }, + end: { column: 32, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [212, 213], + loc: { + start: { column: 32, line: 7 }, + end: { column: 33, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [216, 222], + loc: { + start: { column: 2, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [223, 230], + loc: { + start: { column: 9, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [231, 239], + loc: { + start: { column: 17, line: 8 }, + end: { column: 25, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop4", + + range: [240, 245], + loc: { + start: { column: 26, line: 8 }, + end: { column: 31, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [245, 246], + loc: { + start: { column: 31, line: 8 }, + end: { column: 32, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [247, 253], + loc: { + start: { column: 33, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [253, 254], + loc: { + start: { column: 39, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [257, 263], + loc: { + start: { column: 2, line: 9 }, + end: { column: 8, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [264, 271], + loc: { + start: { column: 9, line: 9 }, + end: { column: 16, line: 9 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [272, 278], + loc: { + start: { column: 17, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop5", + + range: [279, 284], + loc: { + start: { column: 24, line: 9 }, + end: { column: 29, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [284, 285], + loc: { + start: { column: 29, line: 9 }, + end: { column: 30, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [286, 292], + loc: { + start: { column: 31, line: 9 }, + end: { column: 37, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [292, 293], + loc: { + start: { column: 37, line: 9 }, + end: { column: 38, line: 9 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [296, 302], + loc: { + start: { column: 2, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [303, 310], + loc: { + start: { column: 9, line: 10 }, + end: { column: 16, line: 10 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [311, 317], + loc: { + start: { column: 17, line: 10 }, + end: { column: 23, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [318, 326], + loc: { + start: { column: 24, line: 10 }, + end: { column: 32, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop6", + + range: [327, 332], + loc: { + start: { column: 33, line: 10 }, + end: { column: 38, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [332, 333], + loc: { + start: { column: 38, line: 10 }, + end: { column: 39, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [334, 340], + loc: { + start: { column: 40, line: 10 }, + end: { column: 46, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [340, 341], + loc: { + start: { column: 46, line: 10 }, + end: { column: 47, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [342, 343], + loc: { + start: { column: 0, line: 11 }, + end: { column: 1, line: 11 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..56654b6bdd2b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/3-Babel-AST.shot @@ -0,0 +1,341 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-declare-properties Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop1", + + range: [101, 106], + loc: { + start: { column: 10, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [108, 114], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [106, 114], + loc: { + start: { column: 15, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + value: null, + + range: [93, 115], + loc: { + start: { column: 2, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + accessibility: "public", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop2", + + range: [133, 138], + loc: { + start: { column: 17, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [140, 146], + loc: { + start: { column: 24, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + + range: [138, 146], + loc: { + start: { column: 22, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + value: null, + + range: [118, 147], + loc: { + start: { column: 2, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop3", + + range: [165, 170], + loc: { + start: { column: 17, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, + static: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [172, 178], + loc: { + start: { column: 24, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + + range: [170, 178], + loc: { + start: { column: 22, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + value: null, + + range: [150, 179], + loc: { + start: { column: 2, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop3", + + range: [199, 204], + loc: { + start: { column: 19, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + readonly: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [206, 212], + loc: { + start: { column: 26, line: 7 }, + end: { column: 32, line: 7 }, + }, + }, + + range: [204, 212], + loc: { + start: { column: 24, line: 7 }, + end: { column: 32, line: 7 }, + }, + }, + value: null, + + range: [182, 213], + loc: { + start: { column: 2, line: 7 }, + end: { column: 33, line: 7 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + accessibility: "public", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop4", + + range: [240, 245], + loc: { + start: { column: 26, line: 8 }, + end: { column: 31, line: 8 }, + }, + }, + readonly: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [247, 253], + loc: { + start: { column: 33, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + + range: [245, 253], + loc: { + start: { column: 31, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + value: null, + + range: [216, 254], + loc: { + start: { column: 2, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + accessibility: "public", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop5", + + range: [279, 284], + loc: { + start: { column: 24, line: 9 }, + end: { column: 29, line: 9 }, + }, + }, + static: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [286, 292], + loc: { + start: { column: 31, line: 9 }, + end: { column: 37, line: 9 }, + }, + }, + + range: [284, 292], + loc: { + start: { column: 29, line: 9 }, + end: { column: 37, line: 9 }, + }, + }, + value: null, + + range: [257, 293], + loc: { + start: { column: 2, line: 9 }, + end: { column: 38, line: 9 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + accessibility: "public", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "prop6", + + range: [327, 332], + loc: { + start: { column: 33, line: 10 }, + end: { column: 38, line: 10 }, + }, + }, + readonly: true, + static: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [334, 340], + loc: { + start: { column: 40, line: 10 }, + end: { column: 46, line: 10 }, + }, + }, + + range: [332, 340], + loc: { + start: { column: 38, line: 10 }, + end: { column: 46, line: 10 }, + }, + }, + value: null, + + range: [296, 341], + loc: { + start: { column: 2, line: 10 }, + end: { column: 47, line: 10 }, + }, + }, + ], + + range: [89, 343], + loc: { + start: { column: 16, line: 3 }, + end: { column: 1, line: 11 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "DeclProps", + + range: [79, 88], + loc: { + start: { column: 6, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + superClass: null, + + range: [73, 343], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 11 }, + }, + }, + ], + sourceType: "script", + + range: [73, 344], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 12 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..7fb590d56bbd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,496 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-declare-properties Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "DeclProps", + + range: [79, 88], + loc: { + start: { column: 6, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [93, 100], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop1", + + range: [101, 106], + loc: { + start: { column: 10, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [106, 107], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [108, 114], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [114, 115], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [118, 124], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [125, 132], + loc: { + start: { column: 9, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop2", + + range: [133, 138], + loc: { + start: { column: 17, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [138, 139], + loc: { + start: { column: 22, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [140, 146], + loc: { + start: { column: 24, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [146, 147], + loc: { + start: { column: 30, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [150, 157], + loc: { + start: { column: 2, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [158, 164], + loc: { + start: { column: 10, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop3", + + range: [165, 170], + loc: { + start: { column: 17, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [170, 171], + loc: { + start: { column: 22, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [172, 178], + loc: { + start: { column: 24, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [178, 179], + loc: { + start: { column: 30, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [182, 189], + loc: { + start: { column: 2, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [190, 198], + loc: { + start: { column: 10, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop3", + + range: [199, 204], + loc: { + start: { column: 19, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [204, 205], + loc: { + start: { column: 24, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [206, 212], + loc: { + start: { column: 26, line: 7 }, + end: { column: 32, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [212, 213], + loc: { + start: { column: 32, line: 7 }, + end: { column: 33, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [216, 222], + loc: { + start: { column: 2, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [223, 230], + loc: { + start: { column: 9, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [231, 239], + loc: { + start: { column: 17, line: 8 }, + end: { column: 25, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop4", + + range: [240, 245], + loc: { + start: { column: 26, line: 8 }, + end: { column: 31, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [245, 246], + loc: { + start: { column: 31, line: 8 }, + end: { column: 32, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [247, 253], + loc: { + start: { column: 33, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [253, 254], + loc: { + start: { column: 39, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [257, 263], + loc: { + start: { column: 2, line: 9 }, + end: { column: 8, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [264, 271], + loc: { + start: { column: 9, line: 9 }, + end: { column: 16, line: 9 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [272, 278], + loc: { + start: { column: 17, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop5", + + range: [279, 284], + loc: { + start: { column: 24, line: 9 }, + end: { column: 29, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [284, 285], + loc: { + start: { column: 29, line: 9 }, + end: { column: 30, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [286, 292], + loc: { + start: { column: 31, line: 9 }, + end: { column: 37, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [292, 293], + loc: { + start: { column: 37, line: 9 }, + end: { column: 38, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [296, 302], + loc: { + start: { column: 2, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [303, 310], + loc: { + start: { column: 9, line: 10 }, + end: { column: 16, line: 10 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [311, 317], + loc: { + start: { column: 17, line: 10 }, + end: { column: 23, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [318, 326], + loc: { + start: { column: 24, line: 10 }, + end: { column: 32, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop6", + + range: [327, 332], + loc: { + start: { column: 33, line: 10 }, + end: { column: 38, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [332, 333], + loc: { + start: { column: 38, line: 10 }, + end: { column: 39, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [334, 340], + loc: { + start: { column: 40, line: 10 }, + end: { column: 46, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [340, 341], + loc: { + start: { column: 46, line: 10 }, + end: { column: 47, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [342, 343], + loc: { + start: { column: 0, line: 11 }, + end: { column: 1, line: 11 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..66ba0b556620 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,352 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-declare-properties AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, + declare: true, + key: Identifier { + type: 'Identifier', + name: 'prop1', + + range: [101, 106], + loc: { + start: { column: 10, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [108, 114], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [106, 114], + loc: { + start: { column: 15, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + value: null, + + range: [93, 115], + loc: { + start: { column: 2, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + accessibility: 'public', + computed: false, + declare: true, + key: Identifier { + type: 'Identifier', + name: 'prop2', + + range: [133, 138], + loc: { + start: { column: 17, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [140, 146], + loc: { + start: { column: 24, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + + range: [138, 146], + loc: { + start: { column: 22, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + value: null, + + range: [118, 147], + loc: { + start: { column: 2, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, + declare: true, + key: Identifier { + type: 'Identifier', + name: 'prop3', + + range: [165, 170], + loc: { + start: { column: 17, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, +- override: false, + static: true, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [172, 178], + loc: { + start: { column: 24, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + + range: [170, 178], + loc: { + start: { column: 22, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + value: null, + + range: [150, 179], + loc: { + start: { column: 2, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, + declare: true, + key: Identifier { + type: 'Identifier', + name: 'prop3', + + range: [199, 204], + loc: { + start: { column: 19, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, +- override: false, + readonly: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [206, 212], + loc: { + start: { column: 26, line: 7 }, + end: { column: 32, line: 7 }, + }, + }, + + range: [204, 212], + loc: { + start: { column: 24, line: 7 }, + end: { column: 32, line: 7 }, + }, + }, + value: null, + + range: [182, 213], + loc: { + start: { column: 2, line: 7 }, + end: { column: 33, line: 7 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + accessibility: 'public', + computed: false, + declare: true, + key: Identifier { + type: 'Identifier', + name: 'prop4', + + range: [240, 245], + loc: { + start: { column: 26, line: 8 }, + end: { column: 31, line: 8 }, + }, + }, +- override: false, + readonly: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [247, 253], + loc: { + start: { column: 33, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + + range: [245, 253], + loc: { + start: { column: 31, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + value: null, + + range: [216, 254], + loc: { + start: { column: 2, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + accessibility: 'public', + computed: false, + declare: true, + key: Identifier { + type: 'Identifier', + name: 'prop5', + + range: [279, 284], + loc: { + start: { column: 24, line: 9 }, + end: { column: 29, line: 9 }, + }, + }, +- override: false, + static: true, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [286, 292], + loc: { + start: { column: 31, line: 9 }, + end: { column: 37, line: 9 }, + }, + }, + + range: [284, 292], + loc: { + start: { column: 29, line: 9 }, + end: { column: 37, line: 9 }, + }, + }, + value: null, + + range: [257, 293], + loc: { + start: { column: 2, line: 9 }, + end: { column: 38, line: 9 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + accessibility: 'public', + computed: false, + declare: true, + key: Identifier { + type: 'Identifier', + name: 'prop6', + + range: [327, 332], + loc: { + start: { column: 33, line: 10 }, + end: { column: 38, line: 10 }, + }, + }, +- override: false, + readonly: true, + static: true, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [334, 340], + loc: { + start: { column: 40, line: 10 }, + end: { column: 46, line: 10 }, + }, + }, + + range: [332, 340], + loc: { + start: { column: 38, line: 10 }, + end: { column: 46, line: 10 }, + }, + }, + value: null, + + range: [296, 341], + loc: { + start: { column: 2, line: 10 }, + end: { column: 47, line: 10 }, + }, + }, + ], + + range: [89, 343], + loc: { + start: { column: 16, line: 3 }, + end: { column: 1, line: 11 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'DeclProps', + + range: [79, 88], + loc: { + start: { column: 6, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + superClass: null, + + range: [73, 343], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 11 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 344], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 12 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..ff73e77c30e4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,508 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-declare-properties AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'DeclProps', + + range: [79, 88], + loc: { + start: { column: 6, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'declare', + + range: [93, 100], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'prop1', + + range: [101, 106], + loc: { + start: { column: 10, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [106, 107], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [108, 114], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [114, 115], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [118, 124], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'declare', + + range: [125, 132], + loc: { + start: { column: 9, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'prop2', + + range: [133, 138], + loc: { + start: { column: 17, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [138, 139], + loc: { + start: { column: 22, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [140, 146], + loc: { + start: { column: 24, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [146, 147], + loc: { + start: { column: 30, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'declare', + + range: [150, 157], + loc: { + start: { column: 2, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'static', + + range: [158, 164], + loc: { + start: { column: 10, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'prop3', + + range: [165, 170], + loc: { + start: { column: 17, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [170, 171], + loc: { + start: { column: 22, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [172, 178], + loc: { + start: { column: 24, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [178, 179], + loc: { + start: { column: 30, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'declare', + + range: [182, 189], + loc: { + start: { column: 2, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'readonly', + + range: [190, 198], + loc: { + start: { column: 10, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'prop3', + + range: [199, 204], + loc: { + start: { column: 19, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [204, 205], + loc: { + start: { column: 24, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [206, 212], + loc: { + start: { column: 26, line: 7 }, + end: { column: 32, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [212, 213], + loc: { + start: { column: 32, line: 7 }, + end: { column: 33, line: 7 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [216, 222], + loc: { + start: { column: 2, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'declare', + + range: [223, 230], + loc: { + start: { column: 9, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'readonly', + + range: [231, 239], + loc: { + start: { column: 17, line: 8 }, + end: { column: 25, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'prop4', + + range: [240, 245], + loc: { + start: { column: 26, line: 8 }, + end: { column: 31, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [245, 246], + loc: { + start: { column: 31, line: 8 }, + end: { column: 32, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [247, 253], + loc: { + start: { column: 33, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [253, 254], + loc: { + start: { column: 39, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [257, 263], + loc: { + start: { column: 2, line: 9 }, + end: { column: 8, line: 9 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'declare', + + range: [264, 271], + loc: { + start: { column: 9, line: 9 }, + end: { column: 16, line: 9 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'static', + + range: [272, 278], + loc: { + start: { column: 17, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'prop5', + + range: [279, 284], + loc: { + start: { column: 24, line: 9 }, + end: { column: 29, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [284, 285], + loc: { + start: { column: 29, line: 9 }, + end: { column: 30, line: 9 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [286, 292], + loc: { + start: { column: 31, line: 9 }, + end: { column: 37, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [292, 293], + loc: { + start: { column: 37, line: 9 }, + end: { column: 38, line: 9 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [296, 302], + loc: { + start: { column: 2, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'declare', + + range: [303, 310], + loc: { + start: { column: 9, line: 10 }, + end: { column: 16, line: 10 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'static', + + range: [311, 317], + loc: { + start: { column: 17, line: 10 }, + end: { column: 23, line: 10 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'readonly', + + range: [318, 326], + loc: { + start: { column: 24, line: 10 }, + end: { column: 32, line: 10 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'prop6', + + range: [327, 332], + loc: { + start: { column: 33, line: 10 }, + end: { column: 38, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [332, 333], + loc: { + start: { column: 38, line: 10 }, + end: { column: 39, line: 10 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [334, 340], + loc: { + start: { column: 40, line: 10 }, + end: { column: 46, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [340, 341], + loc: { + start: { column: 46, line: 10 }, + end: { column: 47, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [342, 343], + loc: { + start: { column: 0, line: 11 }, + end: { column: 1, line: 11 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/fixture.ts new file mode 100644 index 000000000000..96cc1bccbcb1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class X { + a!: string; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..cb2932887fda --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,90 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-definite-assignment TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + definite: true, + key: Identifier { + type: "Identifier", + name: "a", + + range: [85, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [89, 95], + loc: { + start: { column: 6, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + + range: [87, 95], + loc: { + start: { column: 4, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + value: null, + + range: [85, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + ], + + range: [81, 98], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "X", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 99], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..2e55263d9636 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-definite-assignment TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [85, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [86, 87], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [87, 88], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [89, 95], + loc: { + start: { column: 6, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [95, 96], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [97, 98], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..57f31c5e2e6c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/3-Babel-AST.shot @@ -0,0 +1,88 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-definite-assignment Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + definite: true, + key: Identifier { + type: "Identifier", + name: "a", + + range: [85, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [89, 95], + loc: { + start: { column: 6, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + + range: [87, 95], + loc: { + start: { column: 4, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + value: null, + + range: [85, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + ], + + range: [81, 98], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "X", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 99], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..47e0fb38992b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-definite-assignment Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [85, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [86, 87], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [87, 88], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [89, 95], + loc: { + start: { column: 6, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [95, 96], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [97, 98], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..12dd36c717ab --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,94 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-definite-assignment AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + definite: true, + key: Identifier { + type: 'Identifier', + name: 'a', + + range: [85, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [89, 95], + loc: { + start: { column: 6, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + + range: [87, 95], + loc: { + start: { column: 4, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + value: null, + + range: [85, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + ], + + range: [81, 98], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'X', + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 99], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..113c879b966c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-definite-assignment AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/fixture.ts new file mode 100644 index 000000000000..b76f95ee88ee --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class ClassWithParentAndInterface extends MyOtherClass implements MyInterface {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..b2121f97ee83 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-extends-and-implements TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [151, 153], + loc: { + start: { column: 78, line: 3 }, + end: { column: 80, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "ClassWithParentAndInterface", + + range: [79, 106], + loc: { + start: { column: 6, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + implements: Array [ + TSClassImplements { + type: "TSClassImplements", + expression: Identifier { + type: "Identifier", + name: "MyInterface", + + range: [139, 150], + loc: { + start: { column: 66, line: 3 }, + end: { column: 77, line: 3 }, + }, + }, + + range: [139, 150], + loc: { + start: { column: 66, line: 3 }, + end: { column: 77, line: 3 }, + }, + }, + ], + superClass: Identifier { + type: "Identifier", + name: "MyOtherClass", + + range: [115, 127], + loc: { + start: { column: 42, line: 3 }, + end: { column: 54, line: 3 }, + }, + }, + + range: [73, 153], + loc: { + start: { column: 0, line: 3 }, + end: { column: 80, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 154], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..ebbad0721bee --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-extends-and-implements TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "ClassWithParentAndInterface", + + range: [79, 106], + loc: { + start: { column: 6, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [107, 114], + loc: { + start: { column: 34, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "MyOtherClass", + + range: [115, 127], + loc: { + start: { column: 42, line: 3 }, + end: { column: 54, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "implements", + + range: [128, 138], + loc: { + start: { column: 55, line: 3 }, + end: { column: 65, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "MyInterface", + + range: [139, 150], + loc: { + start: { column: 66, line: 3 }, + end: { column: 77, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [151, 152], + loc: { + start: { column: 78, line: 3 }, + end: { column: 79, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [152, 153], + loc: { + start: { column: 79, line: 3 }, + end: { column: 80, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..4f47cd3fcc58 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/3-Babel-AST.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-extends-and-implements Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [151, 153], + loc: { + start: { column: 78, line: 3 }, + end: { column: 80, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "ClassWithParentAndInterface", + + range: [79, 106], + loc: { + start: { column: 6, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + implements: Array [ + TSExpressionWithTypeArguments { + type: "TSExpressionWithTypeArguments", + expression: Identifier { + type: "Identifier", + name: "MyInterface", + + range: [139, 150], + loc: { + start: { column: 66, line: 3 }, + end: { column: 77, line: 3 }, + }, + }, + + range: [139, 150], + loc: { + start: { column: 66, line: 3 }, + end: { column: 77, line: 3 }, + }, + }, + ], + superClass: Identifier { + type: "Identifier", + name: "MyOtherClass", + + range: [115, 127], + loc: { + start: { column: 42, line: 3 }, + end: { column: 54, line: 3 }, + }, + }, + + range: [73, 153], + loc: { + start: { column: 0, line: 3 }, + end: { column: 80, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 154], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..91dbadd5059e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-extends-and-implements Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "ClassWithParentAndInterface", + + range: [79, 106], + loc: { + start: { column: 6, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [107, 114], + loc: { + start: { column: 34, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "MyOtherClass", + + range: [115, 127], + loc: { + start: { column: 42, line: 3 }, + end: { column: 54, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "implements", + + range: [128, 138], + loc: { + start: { column: 55, line: 3 }, + end: { column: 65, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "MyInterface", + + range: [139, 150], + loc: { + start: { column: 66, line: 3 }, + end: { column: 77, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [151, 152], + loc: { + start: { column: 78, line: 3 }, + end: { column: 79, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [152, 153], + loc: { + start: { column: 79, line: 3 }, + end: { column: 80, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..bb0b1427d253 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,82 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-extends-and-implements AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [151, 153], + loc: { + start: { column: 78, line: 3 }, + end: { column: 80, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'ClassWithParentAndInterface', + + range: [79, 106], + loc: { + start: { column: 6, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + implements: Array [ +- TSClassImplements { +- type: 'TSClassImplements', ++ TSExpressionWithTypeArguments { ++ type: 'TSExpressionWithTypeArguments', + expression: Identifier { + type: 'Identifier', + name: 'MyInterface', + + range: [139, 150], + loc: { + start: { column: 66, line: 3 }, + end: { column: 77, line: 3 }, + }, + }, + + range: [139, 150], + loc: { + start: { column: 66, line: 3 }, + end: { column: 77, line: 3 }, + }, + }, + ], + superClass: Identifier { + type: 'Identifier', + name: 'MyOtherClass', + + range: [115, 127], + loc: { + start: { column: 42, line: 3 }, + end: { column: 54, line: 3 }, + }, + }, + + range: [73, 153], + loc: { + start: { column: 0, line: 3 }, + end: { column: 80, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 154], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..7239767c7c70 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,92 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-extends-and-implements AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'ClassWithParentAndInterface', + + range: [79, 106], + loc: { + start: { column: 6, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'extends', + + range: [107, 114], + loc: { + start: { column: 34, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'MyOtherClass', + + range: [115, 127], + loc: { + start: { column: 42, line: 3 }, + end: { column: 54, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'implements', + + range: [128, 138], + loc: { + start: { column: 55, line: 3 }, + end: { column: 65, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'MyInterface', + + range: [139, 150], + loc: { + start: { column: 66, line: 3 }, + end: { column: 77, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [151, 152], + loc: { + start: { column: 78, line: 3 }, + end: { column: 79, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [152, 153], + loc: { + start: { column: 79, line: 3 }, + end: { column: 80, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/fixture.ts new file mode 100644 index 000000000000..b2d2adabbbfe --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo extends Bar {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..3859f9dbe851 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,155 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic-multiple TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [114, 116], + loc: { + start: { column: 41, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "Bar", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + superTypeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "C", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "D", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + ], + + range: [107, 113], + loc: { + start: { column: 34, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + constraint: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "B", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "A", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + out: false, + + range: [83, 94], + loc: { + start: { column: 10, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + + range: [82, 95], + loc: { + start: { column: 9, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [73, 116], + loc: { + start: { column: 0, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 117], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..207a40b6540c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic-multiple TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [85, 92], + loc: { + start: { column: 12, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [96, 103], + loc: { + start: { column: 23, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "D", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..e621b5ec2139 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/3-Babel-AST.shot @@ -0,0 +1,144 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic-multiple Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [114, 116], + loc: { + start: { column: 41, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "Bar", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + superTypeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "C", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "D", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + ], + + range: [107, 113], + loc: { + start: { column: 34, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + constraint: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "B", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + name: "A", + + range: [83, 94], + loc: { + start: { column: 10, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + + range: [82, 95], + loc: { + start: { column: 9, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [73, 116], + loc: { + start: { column: 0, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 117], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..807fedabe1e3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic-multiple Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [85, 92], + loc: { + start: { column: 12, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [96, 103], + loc: { + start: { column: 23, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "D", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..543de450f926 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,160 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic-multiple AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [114, 116], + loc: { + start: { column: 41, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: Identifier { + type: 'Identifier', + name: 'Bar', + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + superTypeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'C', + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'D', + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + ], + + range: [107, 113], + loc: { + start: { column: 34, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'B', + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'A', +- +- range: [83, 84], +- loc: { +- start: { column: 10, line: 3 }, +- end: { column: 11, line: 3 }, +- }, +- }, +- out: false, ++ name: 'A', + + range: [83, 94], + loc: { + start: { column: 10, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + + range: [82, 95], + loc: { + start: { column: 9, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [73, 116], + loc: { + start: { column: 0, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 117], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..d8216cea6492 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic-multiple AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/fixture.ts new file mode 100644 index 000000000000..d051486769a2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo extends Bar {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..9251113d68d8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,117 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [101, 103], + loc: { + start: { column: 28, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "Bar", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + superTypeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "B", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + + range: [97, 100], + loc: { + start: { column: 24, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "A", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + out: false, + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + ], + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..2c1fe4770f77 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [86, 93], + loc: { + start: { column: 13, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..3436184a21b6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/3-Babel-AST.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [101, 103], + loc: { + start: { column: 28, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "Bar", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + superTypeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "B", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + + range: [97, 100], + loc: { + start: { column: 24, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "A", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + ], + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..27177f46a80d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [86, 93], + loc: { + start: { column: 13, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..ac8187f43683 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,122 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [101, 103], + loc: { + start: { column: 28, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: Identifier { + type: 'Identifier', + name: 'Bar', + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + superTypeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'B', + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + + range: [97, 100], + loc: { + start: { column: 24, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'A', +- +- range: [83, 84], +- loc: { +- start: { column: 10, line: 3 }, +- end: { column: 11, line: 3 }, +- }, +- }, +- out: false, ++ name: 'A', + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + ], + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..5278786ece9d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/fixture.ts new file mode 100644 index 000000000000..b8ba88f0bb8f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + getBar() {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..b39f7d0995d2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,145 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-generic-method-default TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "getBar", + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [105, 107], + loc: { + start: { column: 20, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + default: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Bar", + + range: [98, 101], + loc: { + start: { column: 13, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [98, 101], + loc: { + start: { column: 13, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [94, 95], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + out: false, + + range: [94, 101], + loc: { + start: { column: 9, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + ], + + range: [93, 102], + loc: { + start: { column: 8, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + + range: [93, 107], + loc: { + start: { column: 8, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [87, 107], + loc: { + start: { column: 2, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + ], + + range: [83, 109], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..24cd92f3b7c5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-generic-method-default TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "getBar", + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [93, 94], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [94, 95], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [96, 97], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [98, 101], + loc: { + start: { column: 13, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [101, 102], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [102, 103], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [103, 104], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [105, 106], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [106, 107], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [108, 109], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..205a2cde7ac2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/3-Babel-AST.shot @@ -0,0 +1,133 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-generic-method-default Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "getBar", + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [105, 107], + loc: { + start: { column: 20, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + default: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Bar", + + range: [98, 101], + loc: { + start: { column: 13, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [98, 101], + loc: { + start: { column: 13, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + name: "T", + + range: [94, 101], + loc: { + start: { column: 9, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + ], + + range: [93, 102], + loc: { + start: { column: 8, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + + range: [102, 107], + loc: { + start: { column: 17, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [87, 107], + loc: { + start: { column: 2, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + ], + + range: [83, 109], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..ebddc84403a3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-generic-method-default Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "getBar", + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [93, 94], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [94, 95], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [96, 97], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [98, 101], + loc: { + start: { column: 13, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [101, 102], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [102, 103], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [103, 104], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [105, 106], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [106, 107], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [108, 109], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..72b1fa15c47e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,152 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-generic-method-default AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'getBar', + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [105, 107], + loc: { + start: { column: 20, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + default: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'Bar', + + range: [98, 101], + loc: { + start: { column: 13, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [98, 101], + loc: { + start: { column: 13, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [94, 95], +- loc: { +- start: { column: 9, line: 4 }, +- end: { column: 10, line: 4 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [94, 101], + loc: { + start: { column: 9, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + ], + + range: [93, 102], + loc: { + start: { column: 8, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + +- range: [93, 107], ++ range: [102, 107], + loc: { +- start: { column: 8, line: 4 }, ++ start: { column: 17, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [87, 107], + loc: { + start: { column: 2, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + ], + + range: [83, 109], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..a43ddc381cf6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-generic-method-default AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/fixture.ts new file mode 100644 index 000000000000..4e44ff218afc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + getBar() {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..4cb9045a5efb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-generic-method TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "getBar", + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [99, 101], + loc: { + start: { column: 14, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [94, 95], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + out: false, + + range: [94, 95], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + ], + + range: [93, 96], + loc: { + start: { column: 8, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + + range: [93, 101], + loc: { + start: { column: 8, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [87, 101], + loc: { + start: { column: 2, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + ], + + range: [83, 103], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..5b37f7eea578 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-generic-method TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "getBar", + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [93, 94], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [94, 95], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [95, 96], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [96, 97], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [97, 98], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [99, 100], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [100, 101], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [102, 103], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..18bc4df01884 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/3-Babel-AST.shot @@ -0,0 +1,114 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-generic-method Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "getBar", + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [99, 101], + loc: { + start: { column: 14, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [94, 95], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + ], + + range: [93, 96], + loc: { + start: { column: 8, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + + range: [96, 101], + loc: { + start: { column: 11, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [87, 101], + loc: { + start: { column: 2, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + ], + + range: [83, 103], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..62db153af136 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-generic-method Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "getBar", + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [93, 94], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [94, 95], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [95, 96], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [96, 97], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [97, 98], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [99, 100], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [100, 101], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [102, 103], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..6ec0c4dc7794 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,133 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-generic-method AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'getBar', + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [99, 101], + loc: { + start: { column: 14, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [94, 95], +- loc: { +- start: { column: 9, line: 4 }, +- end: { column: 10, line: 4 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [94, 95], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + ], + + range: [93, 96], + loc: { + start: { column: 8, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + +- range: [93, 101], ++ range: [96, 101], + loc: { +- start: { column: 8, line: 4 }, ++ start: { column: 11, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [87, 101], + loc: { + start: { column: 2, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + ], + + range: [83, 103], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..bd2dbba8cf51 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-generic-method AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/fixture.ts new file mode 100644 index 000000000000..9bc600076d64 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo implements Bar {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..d8f94104032d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic-multiple TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [104, 106], + loc: { + start: { column: 31, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + implements: Array [ + TSClassImplements { + type: "TSClassImplements", + expression: Identifier { + type: "Identifier", + name: "Bar", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "S", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + + range: [97, 103], + loc: { + start: { column: 24, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [94, 103], + loc: { + start: { column: 21, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + superClass: null, + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..fa18b3f0c852 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic-multiple TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "implements", + + range: [83, 93], + loc: { + start: { column: 10, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "S", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..af9a433f52df --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/3-Babel-AST.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic-multiple Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [104, 106], + loc: { + start: { column: 31, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + implements: Array [ + TSExpressionWithTypeArguments { + type: "TSExpressionWithTypeArguments", + expression: Identifier { + type: "Identifier", + name: "Bar", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "S", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + + range: [97, 103], + loc: { + start: { column: 24, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [94, 103], + loc: { + start: { column: 21, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + superClass: null, + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..2e7fe4c9ba17 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic-multiple Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "implements", + + range: [83, 93], + loc: { + start: { column: 10, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "S", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..41b0e58926bb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,122 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic-multiple AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [104, 106], + loc: { + start: { column: 31, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + implements: Array [ +- TSClassImplements { +- type: 'TSClassImplements', ++ TSExpressionWithTypeArguments { ++ type: 'TSExpressionWithTypeArguments', + expression: Identifier { + type: 'Identifier', + name: 'Bar', + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'S', + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + + range: [97, 103], + loc: { + start: { column: 24, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [94, 103], + loc: { + start: { column: 21, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + superClass: null, + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..51fb50cb8f70 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,122 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic-multiple AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'implements', + + range: [83, 93], + loc: { + start: { column: 10, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Bar', + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'S', + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/fixture.ts new file mode 100644 index 000000000000..e47da9f61695 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo implements Bar {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..137d4920b364 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,97 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [101, 103], + loc: { + start: { column: 28, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + implements: Array [ + TSClassImplements { + type: "TSClassImplements", + expression: Identifier { + type: "Identifier", + name: "Bar", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "S", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + + range: [97, 100], + loc: { + start: { column: 24, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [94, 100], + loc: { + start: { column: 21, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + superClass: null, + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..8e38935390c5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "implements", + + range: [83, 93], + loc: { + start: { column: 10, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "S", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..ee18de9e7b77 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/3-Babel-AST.shot @@ -0,0 +1,97 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [101, 103], + loc: { + start: { column: 28, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + implements: Array [ + TSExpressionWithTypeArguments { + type: "TSExpressionWithTypeArguments", + expression: Identifier { + type: "Identifier", + name: "Bar", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "S", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + + range: [97, 100], + loc: { + start: { column: 24, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [94, 100], + loc: { + start: { column: 21, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + superClass: null, + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..058890cf74d3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "implements", + + range: [83, 93], + loc: { + start: { column: 10, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "S", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..74cc49838e1f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,103 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [101, 103], + loc: { + start: { column: 28, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + implements: Array [ +- TSClassImplements { +- type: 'TSClassImplements', ++ TSExpressionWithTypeArguments { ++ type: 'TSExpressionWithTypeArguments', + expression: Identifier { + type: 'Identifier', + name: 'Bar', + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'S', + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + + range: [97, 100], + loc: { + start: { column: 24, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [94, 100], + loc: { + start: { column: 21, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + superClass: null, + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..619c0b6f148f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,102 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'implements', + + range: [83, 93], + loc: { + start: { column: 10, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Bar', + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'S', + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/fixture.ts new file mode 100644 index 000000000000..047477013de1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo implements Bar {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..b2bb085367b8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,67 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-implements TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [98, 100], + loc: { + start: { column: 25, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + implements: Array [ + TSClassImplements { + type: "TSClassImplements", + expression: Identifier { + type: "Identifier", + name: "Bar", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + superClass: null, + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..f5fa4af25814 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-implements TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "implements", + + range: [83, 93], + loc: { + start: { column: 10, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..166d373388dd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/3-Babel-AST.shot @@ -0,0 +1,67 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-implements Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [98, 100], + loc: { + start: { column: 25, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + implements: Array [ + TSExpressionWithTypeArguments { + type: "TSExpressionWithTypeArguments", + expression: Identifier { + type: "Identifier", + name: "Bar", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + superClass: null, + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..0b3f0990c5a6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-implements Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "implements", + + range: [83, 93], + loc: { + start: { column: 10, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..67f56c863706 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,73 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-implements AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [98, 100], + loc: { + start: { column: 25, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + implements: Array [ +- TSClassImplements { +- type: 'TSClassImplements', ++ TSExpressionWithTypeArguments { ++ type: 'TSExpressionWithTypeArguments', + expression: Identifier { + type: 'Identifier', + name: 'Bar', + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + superClass: null, + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..dd0501e4607a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,72 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-implements AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'implements', + + range: [83, 93], + loc: { + start: { column: 10, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Bar', + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/fixture.ts new file mode 100644 index 000000000000..f78d5403f66a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/fixture.ts @@ -0,0 +1,7 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class C { + foo(): number {} + bar() {} + baz() {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..d86b4174035c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,238 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-method TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [85, 88], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [99, 101], + loc: { + start: { column: 16, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [92, 98], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [90, 98], + loc: { + start: { column: 7, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [88, 101], + loc: { + start: { column: 5, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [85, 101], + loc: { + start: { column: 2, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [104, 107], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [113, 115], + loc: { + start: { column: 11, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [108, 109], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + out: false, + + range: [108, 109], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + ], + + range: [107, 110], + loc: { + start: { column: 5, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + + range: [107, 115], + loc: { + start: { column: 5, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [104, 115], + loc: { + start: { column: 2, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [118, 121], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [124, 126], + loc: { + start: { column: 8, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [121, 126], + loc: { + start: { column: 5, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + + range: [118, 126], + loc: { + start: { column: 2, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + ], + + range: [81, 128], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "C", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 128], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 129], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..d77985007b4d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,246 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-method TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [85, 88], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [88, 89], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [89, 90], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [90, 91], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [92, 98], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [99, 100], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [100, 101], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [104, 107], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [107, 108], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [108, 109], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [109, 110], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [110, 111], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [111, 112], + loc: { + start: { column: 9, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [113, 114], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [114, 115], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [118, 121], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [121, 122], + loc: { + start: { column: 5, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [122, 123], + loc: { + start: { column: 6, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [124, 125], + loc: { + start: { column: 8, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [125, 126], + loc: { + start: { column: 9, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [127, 128], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..4eacbdf0c57d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/3-Babel-AST.shot @@ -0,0 +1,224 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-method Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [85, 88], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [99, 101], + loc: { + start: { column: 16, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [92, 98], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [90, 98], + loc: { + start: { column: 7, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [88, 101], + loc: { + start: { column: 5, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [85, 101], + loc: { + start: { column: 2, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [104, 107], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [113, 115], + loc: { + start: { column: 11, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [108, 109], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + ], + + range: [107, 110], + loc: { + start: { column: 5, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + + range: [110, 115], + loc: { + start: { column: 8, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [104, 115], + loc: { + start: { column: 2, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [118, 121], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [124, 126], + loc: { + start: { column: 8, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [121, 126], + loc: { + start: { column: 5, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + + range: [118, 126], + loc: { + start: { column: 2, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + ], + + range: [81, 128], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "C", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 128], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 129], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..81ca1b4a04ab --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,246 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-method Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [85, 88], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [88, 89], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [89, 90], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [90, 91], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [92, 98], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [99, 100], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [100, 101], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [104, 107], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [107, 108], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [108, 109], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [109, 110], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [110, 111], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [111, 112], + loc: { + start: { column: 9, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [113, 114], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [114, 115], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [118, 121], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [121, 122], + loc: { + start: { column: 5, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [122, 123], + loc: { + start: { column: 6, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [124, 125], + loc: { + start: { column: 8, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [125, 126], + loc: { + start: { column: 9, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [127, 128], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..fa3122911f78 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,245 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-method AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'foo', + + range: [85, 88], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [99, 101], + loc: { + start: { column: 16, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [92, 98], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [90, 98], + loc: { + start: { column: 7, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [88, 101], + loc: { + start: { column: 5, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [85, 101], + loc: { + start: { column: 2, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'bar', + + range: [104, 107], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [113, 115], + loc: { + start: { column: 11, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [108, 109], +- loc: { +- start: { column: 6, line: 5 }, +- end: { column: 7, line: 5 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [108, 109], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + ], + + range: [107, 110], + loc: { + start: { column: 5, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + +- range: [107, 115], ++ range: [110, 115], + loc: { +- start: { column: 5, line: 5 }, ++ start: { column: 8, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [104, 115], + loc: { + start: { column: 2, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'baz', + + range: [118, 121], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [124, 126], + loc: { + start: { column: 8, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [121, 126], + loc: { + start: { column: 5, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + + range: [118, 126], + loc: { + start: { column: 2, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + ], + + range: [81, 128], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'C', + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 128], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 129], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..4778e22eb6d3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-method AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/fixture.ts new file mode 100644 index 000000000000..5062cd781804 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function M>(Base: T) {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..ab072a5f07b5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,169 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-mixin-reference TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [119, 121], + loc: { + start: { column: 46, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "M", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "Base", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [114, 117], + loc: { + start: { column: 41, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [110, 117], + loc: { + start: { column: 37, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + ], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + constraint: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Constructor", + + range: [94, 105], + loc: { + start: { column: 21, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "M", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + + range: [105, 108], + loc: { + start: { column: 32, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + + range: [94, 108], + loc: { + start: { column: 21, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + out: false, + + range: [84, 108], + loc: { + start: { column: 11, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + ], + + range: [83, 109], + loc: { + start: { column: 10, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..136f0b95fb78 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-mixin-reference TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "M", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [86, 93], + loc: { + start: { column: 13, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Constructor", + + range: [94, 105], + loc: { + start: { column: 21, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "M", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Base", + + range: [110, 114], + loc: { + start: { column: 37, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [120, 121], + loc: { + start: { column: 47, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..3346d740c356 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/3-Babel-AST.shot @@ -0,0 +1,158 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-mixin-reference Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [119, 121], + loc: { + start: { column: 46, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "M", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "Base", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [114, 117], + loc: { + start: { column: 41, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [110, 117], + loc: { + start: { column: 37, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + ], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + constraint: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Constructor", + + range: [94, 105], + loc: { + start: { column: 21, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "M", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + + range: [105, 108], + loc: { + start: { column: 32, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + + range: [94, 108], + loc: { + start: { column: 21, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + name: "T", + + range: [84, 108], + loc: { + start: { column: 11, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + ], + + range: [83, 109], + loc: { + start: { column: 10, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..83e5e5733533 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-mixin-reference Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "M", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [86, 93], + loc: { + start: { column: 13, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Constructor", + + range: [94, 105], + loc: { + start: { column: 21, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "M", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Base", + + range: [110, 114], + loc: { + start: { column: 37, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [120, 121], + loc: { + start: { column: 47, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..24ee207bc651 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,174 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-mixin-reference AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + FunctionDeclaration { + type: 'FunctionDeclaration', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [119, 121], + loc: { + start: { column: 46, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: 'Identifier', + name: 'M', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: 'Identifier', + name: 'Base', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [114, 117], + loc: { + start: { column: 41, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [110, 117], + loc: { + start: { column: 37, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + ], + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'Constructor', + + range: [94, 105], + loc: { + start: { column: 21, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'M', + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + + range: [105, 108], + loc: { + start: { column: 32, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + + range: [94, 108], + loc: { + start: { column: 21, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [84, 85], +- loc: { +- start: { column: 11, line: 3 }, +- end: { column: 12, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [84, 108], + loc: { + start: { column: 11, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + ], + + range: [83, 109], + loc: { + start: { column: 10, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..cdb3e2d4bbcf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-mixin-reference AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/fixture.ts new file mode 100644 index 000000000000..10f4d28f749b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/fixture.ts @@ -0,0 +1,11 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function M>(Base: T) { + return class extends Base {}; +} + +class X extends M(C) implements I {} + +class C {} +interface I {} +type Constructor = new (...args: any[]) => T; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..5a3bdce9ce18 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,498 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-mixin TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: ClassExpression { + type: "ClassExpression", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [150, 152], + loc: { + start: { column: 28, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + id: null, + superClass: Identifier { + type: "Identifier", + name: "Base", + + range: [145, 149], + loc: { + start: { column: 23, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + + range: [131, 152], + loc: { + start: { column: 9, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + + range: [124, 153], + loc: { + start: { column: 2, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + ], + + range: [120, 155], + loc: { + start: { column: 47, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "M", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "Base", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + + range: [115, 118], + loc: { + start: { column: 42, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + + range: [111, 118], + loc: { + start: { column: 38, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + ], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + constraint: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Constructor", + + range: [94, 105], + loc: { + start: { column: 21, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [], + + range: [106, 108], + loc: { + start: { column: 33, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + ], + + range: [105, 109], + loc: { + start: { column: 32, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [94, 109], + loc: { + start: { column: 21, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + out: false, + + range: [84, 109], + loc: { + start: { column: 11, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + + range: [83, 110], + loc: { + start: { column: 10, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + + range: [73, 155], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [196, 198], + loc: { + start: { column: 39, line: 7 }, + end: { column: 41, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "X", + + range: [163, 164], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + implements: Array [ + TSClassImplements { + type: "TSClassImplements", + expression: Identifier { + type: "Identifier", + name: "I", + + range: [194, 195], + loc: { + start: { column: 37, line: 7 }, + end: { column: 38, line: 7 }, + }, + }, + + range: [194, 195], + loc: { + start: { column: 37, line: 7 }, + end: { column: 38, line: 7 }, + }, + }, + ], + superClass: CallExpression { + type: "CallExpression", + arguments: Array [ + Identifier { + type: "Identifier", + name: "C", + + range: [180, 181], + loc: { + start: { column: 23, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "M", + + range: [173, 174], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + optional: false, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSAnyKeyword { + type: "TSAnyKeyword", + + range: [175, 178], + loc: { + start: { column: 18, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + ], + + range: [174, 179], + loc: { + start: { column: 17, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + + range: [173, 182], + loc: { + start: { column: 16, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + + range: [157, 198], + loc: { + start: { column: 0, line: 7 }, + end: { column: 41, line: 7 }, + }, + }, + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [208, 210], + loc: { + start: { column: 8, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "C", + + range: [206, 207], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + superClass: null, + + range: [200, 210], + loc: { + start: { column: 0, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [223, 225], + loc: { + start: { column: 12, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "I", + + range: [221, 222], + loc: { + start: { column: 10, line: 10 }, + end: { column: 11, line: 10 }, + }, + }, + + range: [211, 225], + loc: { + start: { column: 0, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Constructor", + + range: [231, 242], + loc: { + start: { column: 5, line: 11 }, + end: { column: 16, line: 11 }, + }, + }, + typeAnnotation: TSConstructorType { + type: "TSConstructorType", + abstract: false, + params: Array [ + RestElement { + type: "RestElement", + argument: Identifier { + type: "Identifier", + name: "args", + + range: [256, 260], + loc: { + start: { column: 30, line: 11 }, + end: { column: 34, line: 11 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSArrayType { + type: "TSArrayType", + elementType: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [262, 265], + loc: { + start: { column: 36, line: 11 }, + end: { column: 39, line: 11 }, + }, + }, + + range: [262, 267], + loc: { + start: { column: 36, line: 11 }, + end: { column: 41, line: 11 }, + }, + }, + + range: [260, 267], + loc: { + start: { column: 34, line: 11 }, + end: { column: 41, line: 11 }, + }, + }, + + range: [253, 267], + loc: { + start: { column: 27, line: 11 }, + end: { column: 41, line: 11 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [272, 273], + loc: { + start: { column: 46, line: 11 }, + end: { column: 47, line: 11 }, + }, + }, + + range: [272, 273], + loc: { + start: { column: 46, line: 11 }, + end: { column: 47, line: 11 }, + }, + }, + + range: [269, 273], + loc: { + start: { column: 43, line: 11 }, + end: { column: 47, line: 11 }, + }, + }, + + range: [248, 273], + loc: { + start: { column: 22, line: 11 }, + end: { column: 47, line: 11 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [243, 244], + loc: { + start: { column: 17, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + out: false, + + range: [243, 244], + loc: { + start: { column: 17, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + ], + + range: [242, 245], + loc: { + start: { column: 16, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + + range: [226, 274], + loc: { + start: { column: 0, line: 11 }, + end: { column: 48, line: 11 }, + }, + }, + ], + sourceType: "script", + + range: [73, 275], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 12 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..b4ccdf578dbb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,656 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-mixin TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "M", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [86, 93], + loc: { + start: { column: 13, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Constructor", + + range: [94, 105], + loc: { + start: { column: 21, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Base", + + range: [111, 115], + loc: { + start: { column: 38, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [118, 119], + loc: { + start: { column: 45, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [120, 121], + loc: { + start: { column: 47, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [124, 130], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [131, 136], + loc: { + start: { column: 9, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [137, 144], + loc: { + start: { column: 15, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Base", + + range: [145, 149], + loc: { + start: { column: 23, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [150, 151], + loc: { + start: { column: 28, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [151, 152], + loc: { + start: { column: 29, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [152, 153], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [154, 155], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [157, 162], + loc: { + start: { column: 0, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [163, 164], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [165, 172], + loc: { + start: { column: 8, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "M", + + range: [173, 174], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [174, 175], + loc: { + start: { column: 17, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [175, 178], + loc: { + start: { column: 18, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [178, 179], + loc: { + start: { column: 21, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [179, 180], + loc: { + start: { column: 22, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [180, 181], + loc: { + start: { column: 23, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [181, 182], + loc: { + start: { column: 24, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "implements", + + range: [183, 193], + loc: { + start: { column: 26, line: 7 }, + end: { column: 36, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "I", + + range: [194, 195], + loc: { + start: { column: 37, line: 7 }, + end: { column: 38, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [196, 197], + loc: { + start: { column: 39, line: 7 }, + end: { column: 40, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [197, 198], + loc: { + start: { column: 40, line: 7 }, + end: { column: 41, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [200, 205], + loc: { + start: { column: 0, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [206, 207], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [208, 209], + loc: { + start: { column: 8, line: 9 }, + end: { column: 9, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [209, 210], + loc: { + start: { column: 9, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + Keyword { + type: "Keyword", + value: "interface", + + range: [211, 220], + loc: { + start: { column: 0, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "I", + + range: [221, 222], + loc: { + start: { column: 10, line: 10 }, + end: { column: 11, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [223, 224], + loc: { + start: { column: 12, line: 10 }, + end: { column: 13, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [224, 225], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [226, 230], + loc: { + start: { column: 0, line: 11 }, + end: { column: 4, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "Constructor", + + range: [231, 242], + loc: { + start: { column: 5, line: 11 }, + end: { column: 16, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [242, 243], + loc: { + start: { column: 16, line: 11 }, + end: { column: 17, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [243, 244], + loc: { + start: { column: 17, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [244, 245], + loc: { + start: { column: 18, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [246, 247], + loc: { + start: { column: 20, line: 11 }, + end: { column: 21, line: 11 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [248, 251], + loc: { + start: { column: 22, line: 11 }, + end: { column: 25, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [252, 253], + loc: { + start: { column: 26, line: 11 }, + end: { column: 27, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "...", + + range: [253, 256], + loc: { + start: { column: 27, line: 11 }, + end: { column: 30, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "args", + + range: [256, 260], + loc: { + start: { column: 30, line: 11 }, + end: { column: 34, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [260, 261], + loc: { + start: { column: 34, line: 11 }, + end: { column: 35, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [262, 265], + loc: { + start: { column: 36, line: 11 }, + end: { column: 39, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [265, 266], + loc: { + start: { column: 39, line: 11 }, + end: { column: 40, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [266, 267], + loc: { + start: { column: 40, line: 11 }, + end: { column: 41, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [267, 268], + loc: { + start: { column: 41, line: 11 }, + end: { column: 42, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [269, 271], + loc: { + start: { column: 43, line: 11 }, + end: { column: 45, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [272, 273], + loc: { + start: { column: 46, line: 11 }, + end: { column: 47, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [273, 274], + loc: { + start: { column: 47, line: 11 }, + end: { column: 48, line: 11 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..c1653cb98b1a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/3-Babel-AST.shot @@ -0,0 +1,476 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-mixin Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: ClassExpression { + type: "ClassExpression", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [150, 152], + loc: { + start: { column: 28, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + id: null, + superClass: Identifier { + type: "Identifier", + name: "Base", + + range: [145, 149], + loc: { + start: { column: 23, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + + range: [131, 152], + loc: { + start: { column: 9, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + + range: [124, 153], + loc: { + start: { column: 2, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + ], + + range: [120, 155], + loc: { + start: { column: 47, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "M", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "Base", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + + range: [115, 118], + loc: { + start: { column: 42, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + + range: [111, 118], + loc: { + start: { column: 38, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + ], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + constraint: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Constructor", + + range: [94, 105], + loc: { + start: { column: 21, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [], + + range: [106, 108], + loc: { + start: { column: 33, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + ], + + range: [105, 109], + loc: { + start: { column: 32, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [94, 109], + loc: { + start: { column: 21, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + name: "T", + + range: [84, 109], + loc: { + start: { column: 11, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + + range: [83, 110], + loc: { + start: { column: 10, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + + range: [73, 155], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [196, 198], + loc: { + start: { column: 39, line: 7 }, + end: { column: 41, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "X", + + range: [163, 164], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + implements: Array [ + TSExpressionWithTypeArguments { + type: "TSExpressionWithTypeArguments", + expression: Identifier { + type: "Identifier", + name: "I", + + range: [194, 195], + loc: { + start: { column: 37, line: 7 }, + end: { column: 38, line: 7 }, + }, + }, + + range: [194, 195], + loc: { + start: { column: 37, line: 7 }, + end: { column: 38, line: 7 }, + }, + }, + ], + superClass: CallExpression { + type: "CallExpression", + arguments: Array [ + Identifier { + type: "Identifier", + name: "C", + + range: [180, 181], + loc: { + start: { column: 23, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "M", + + range: [173, 174], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + optional: false, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSAnyKeyword { + type: "TSAnyKeyword", + + range: [175, 178], + loc: { + start: { column: 18, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + ], + + range: [174, 179], + loc: { + start: { column: 17, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + + range: [173, 182], + loc: { + start: { column: 16, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + + range: [157, 198], + loc: { + start: { column: 0, line: 7 }, + end: { column: 41, line: 7 }, + }, + }, + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [208, 210], + loc: { + start: { column: 8, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "C", + + range: [206, 207], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + superClass: null, + + range: [200, 210], + loc: { + start: { column: 0, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [223, 225], + loc: { + start: { column: 12, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "I", + + range: [221, 222], + loc: { + start: { column: 10, line: 10 }, + end: { column: 11, line: 10 }, + }, + }, + + range: [211, 225], + loc: { + start: { column: 0, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Constructor", + + range: [231, 242], + loc: { + start: { column: 5, line: 11 }, + end: { column: 16, line: 11 }, + }, + }, + typeAnnotation: TSConstructorType { + type: "TSConstructorType", + abstract: false, + parameters: Array [ + RestElement { + type: "RestElement", + argument: Identifier { + type: "Identifier", + name: "args", + + range: [256, 260], + loc: { + start: { column: 30, line: 11 }, + end: { column: 34, line: 11 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSArrayType { + type: "TSArrayType", + elementType: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [262, 265], + loc: { + start: { column: 36, line: 11 }, + end: { column: 39, line: 11 }, + }, + }, + + range: [262, 267], + loc: { + start: { column: 36, line: 11 }, + end: { column: 41, line: 11 }, + }, + }, + + range: [260, 267], + loc: { + start: { column: 34, line: 11 }, + end: { column: 41, line: 11 }, + }, + }, + + range: [253, 267], + loc: { + start: { column: 27, line: 11 }, + end: { column: 41, line: 11 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [272, 273], + loc: { + start: { column: 46, line: 11 }, + end: { column: 47, line: 11 }, + }, + }, + + range: [272, 273], + loc: { + start: { column: 46, line: 11 }, + end: { column: 47, line: 11 }, + }, + }, + + range: [269, 273], + loc: { + start: { column: 43, line: 11 }, + end: { column: 47, line: 11 }, + }, + }, + + range: [248, 273], + loc: { + start: { column: 22, line: 11 }, + end: { column: 47, line: 11 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [243, 244], + loc: { + start: { column: 17, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + ], + + range: [242, 245], + loc: { + start: { column: 16, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + + range: [226, 274], + loc: { + start: { column: 0, line: 11 }, + end: { column: 48, line: 11 }, + }, + }, + ], + sourceType: "script", + + range: [73, 275], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 12 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..68a1e7bce3d0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,656 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-mixin Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "M", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [86, 93], + loc: { + start: { column: 13, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Constructor", + + range: [94, 105], + loc: { + start: { column: 21, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Base", + + range: [111, 115], + loc: { + start: { column: 38, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [118, 119], + loc: { + start: { column: 45, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [120, 121], + loc: { + start: { column: 47, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [124, 130], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [131, 136], + loc: { + start: { column: 9, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [137, 144], + loc: { + start: { column: 15, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Base", + + range: [145, 149], + loc: { + start: { column: 23, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [150, 151], + loc: { + start: { column: 28, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [151, 152], + loc: { + start: { column: 29, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [152, 153], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [154, 155], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [157, 162], + loc: { + start: { column: 0, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [163, 164], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [165, 172], + loc: { + start: { column: 8, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "M", + + range: [173, 174], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [174, 175], + loc: { + start: { column: 17, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [175, 178], + loc: { + start: { column: 18, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [178, 179], + loc: { + start: { column: 21, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [179, 180], + loc: { + start: { column: 22, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [180, 181], + loc: { + start: { column: 23, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [181, 182], + loc: { + start: { column: 24, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "implements", + + range: [183, 193], + loc: { + start: { column: 26, line: 7 }, + end: { column: 36, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "I", + + range: [194, 195], + loc: { + start: { column: 37, line: 7 }, + end: { column: 38, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [196, 197], + loc: { + start: { column: 39, line: 7 }, + end: { column: 40, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [197, 198], + loc: { + start: { column: 40, line: 7 }, + end: { column: 41, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [200, 205], + loc: { + start: { column: 0, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [206, 207], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [208, 209], + loc: { + start: { column: 8, line: 9 }, + end: { column: 9, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [209, 210], + loc: { + start: { column: 9, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "interface", + + range: [211, 220], + loc: { + start: { column: 0, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "I", + + range: [221, 222], + loc: { + start: { column: 10, line: 10 }, + end: { column: 11, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [223, 224], + loc: { + start: { column: 12, line: 10 }, + end: { column: 13, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [224, 225], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [226, 230], + loc: { + start: { column: 0, line: 11 }, + end: { column: 4, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "Constructor", + + range: [231, 242], + loc: { + start: { column: 5, line: 11 }, + end: { column: 16, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [242, 243], + loc: { + start: { column: 16, line: 11 }, + end: { column: 17, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [243, 244], + loc: { + start: { column: 17, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [244, 245], + loc: { + start: { column: 18, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [246, 247], + loc: { + start: { column: 20, line: 11 }, + end: { column: 21, line: 11 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [248, 251], + loc: { + start: { column: 22, line: 11 }, + end: { column: 25, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [252, 253], + loc: { + start: { column: 26, line: 11 }, + end: { column: 27, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "...", + + range: [253, 256], + loc: { + start: { column: 27, line: 11 }, + end: { column: 30, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "args", + + range: [256, 260], + loc: { + start: { column: 30, line: 11 }, + end: { column: 34, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [260, 261], + loc: { + start: { column: 34, line: 11 }, + end: { column: 35, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [262, 265], + loc: { + start: { column: 36, line: 11 }, + end: { column: 39, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [265, 266], + loc: { + start: { column: 39, line: 11 }, + end: { column: 40, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [266, 267], + loc: { + start: { column: 40, line: 11 }, + end: { column: 41, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [267, 268], + loc: { + start: { column: 41, line: 11 }, + end: { column: 42, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [269, 271], + loc: { + start: { column: 43, line: 11 }, + end: { column: 45, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [272, 273], + loc: { + start: { column: 46, line: 11 }, + end: { column: 47, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [273, 274], + loc: { + start: { column: 47, line: 11 }, + end: { column: 48, line: 11 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..8801f524ccc5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,508 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + FunctionDeclaration { + type: 'FunctionDeclaration', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: ClassExpression { + type: 'ClassExpression', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [150, 152], + loc: { + start: { column: 28, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + id: null, + superClass: Identifier { + type: 'Identifier', + name: 'Base', + + range: [145, 149], + loc: { + start: { column: 23, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + + range: [131, 152], + loc: { + start: { column: 9, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + + range: [124, 153], + loc: { + start: { column: 2, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + ], + + range: [120, 155], + loc: { + start: { column: 47, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: 'Identifier', + name: 'M', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: 'Identifier', + name: 'Base', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + + range: [115, 118], + loc: { + start: { column: 42, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + + range: [111, 118], + loc: { + start: { column: 38, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + ], + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'Constructor', + + range: [94, 105], + loc: { + start: { column: 21, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSTypeLiteral { + type: 'TSTypeLiteral', + members: Array [], + + range: [106, 108], + loc: { + start: { column: 33, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + ], + + range: [105, 109], + loc: { + start: { column: 32, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [94, 109], + loc: { + start: { column: 21, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [84, 85], +- loc: { +- start: { column: 11, line: 3 }, +- end: { column: 12, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [84, 109], + loc: { + start: { column: 11, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + + range: [83, 110], + loc: { + start: { column: 10, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + + range: [73, 155], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [196, 198], + loc: { + start: { column: 39, line: 7 }, + end: { column: 41, line: 7 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'X', + + range: [163, 164], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + implements: Array [ +- TSClassImplements { +- type: 'TSClassImplements', ++ TSExpressionWithTypeArguments { ++ type: 'TSExpressionWithTypeArguments', + expression: Identifier { + type: 'Identifier', + name: 'I', + + range: [194, 195], + loc: { + start: { column: 37, line: 7 }, + end: { column: 38, line: 7 }, + }, + }, + + range: [194, 195], + loc: { + start: { column: 37, line: 7 }, + end: { column: 38, line: 7 }, + }, + }, + ], + superClass: CallExpression { + type: 'CallExpression', + arguments: Array [ + Identifier { + type: 'Identifier', + name: 'C', + + range: [180, 181], + loc: { + start: { column: 23, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + ], + callee: Identifier { + type: 'Identifier', + name: 'M', + + range: [173, 174], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + optional: false, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSAnyKeyword { + type: 'TSAnyKeyword', + + range: [175, 178], + loc: { + start: { column: 18, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + ], + + range: [174, 179], + loc: { + start: { column: 17, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + + range: [173, 182], + loc: { + start: { column: 16, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + + range: [157, 198], + loc: { + start: { column: 0, line: 7 }, + end: { column: 41, line: 7 }, + }, + }, + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [208, 210], + loc: { + start: { column: 8, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'C', + + range: [206, 207], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + superClass: null, + + range: [200, 210], + loc: { + start: { column: 0, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [], + + range: [223, 225], + loc: { + start: { column: 12, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'I', + + range: [221, 222], + loc: { + start: { column: 10, line: 10 }, + end: { column: 11, line: 10 }, + }, + }, + + range: [211, 225], + loc: { + start: { column: 0, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'Constructor', + + range: [231, 242], + loc: { + start: { column: 5, line: 11 }, + end: { column: 16, line: 11 }, + }, + }, + typeAnnotation: TSConstructorType { + type: 'TSConstructorType', + abstract: false, +- params: Array [ ++ parameters: Array [ + RestElement { + type: 'RestElement', + argument: Identifier { + type: 'Identifier', + name: 'args', + + range: [256, 260], + loc: { + start: { column: 30, line: 11 }, + end: { column: 34, line: 11 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSArrayType { + type: 'TSArrayType', + elementType: TSAnyKeyword { + type: 'TSAnyKeyword', + + range: [262, 265], + loc: { + start: { column: 36, line: 11 }, + end: { column: 39, line: 11 }, + }, + }, + + range: [262, 267], + loc: { + start: { column: 36, line: 11 }, + end: { column: 41, line: 11 }, + }, + }, + + range: [260, 267], + loc: { + start: { column: 34, line: 11 }, + end: { column: 41, line: 11 }, + }, + }, + + range: [253, 267], + loc: { + start: { column: 27, line: 11 }, + end: { column: 41, line: 11 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [272, 273], + loc: { + start: { column: 46, line: 11 }, + end: { column: 47, line: 11 }, + }, + }, + + range: [272, 273], + loc: { + start: { column: 46, line: 11 }, + end: { column: 47, line: 11 }, + }, + }, + + range: [269, 273], + loc: { + start: { column: 43, line: 11 }, + end: { column: 47, line: 11 }, + }, + }, + + range: [248, 273], + loc: { + start: { column: 22, line: 11 }, + end: { column: 47, line: 11 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [243, 244], +- loc: { +- start: { column: 17, line: 11 }, +- end: { column: 18, line: 11 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [243, 244], + loc: { + start: { column: 17, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + ], + + range: [242, 245], + loc: { + start: { column: 16, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + + range: [226, 274], + loc: { + start: { column: 0, line: 11 }, + end: { column: 48, line: 11 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 275], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 12 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..f0e70c50e5ed --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,664 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'function', + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'M', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'extends', + + range: [86, 93], + loc: { + start: { column: 13, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Constructor', + + range: [94, 105], + loc: { + start: { column: 21, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Base', + + range: [111, 115], + loc: { + start: { column: 38, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [118, 119], + loc: { + start: { column: 45, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [120, 121], + loc: { + start: { column: 47, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'return', + + range: [124, 130], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'class', + + range: [131, 136], + loc: { + start: { column: 9, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'extends', + + range: [137, 144], + loc: { + start: { column: 15, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Base', + + range: [145, 149], + loc: { + start: { column: 23, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [150, 151], + loc: { + start: { column: 28, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [151, 152], + loc: { + start: { column: 29, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [152, 153], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [154, 155], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'class', + + range: [157, 162], + loc: { + start: { column: 0, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'X', + + range: [163, 164], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'extends', + + range: [165, 172], + loc: { + start: { column: 8, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'M', + + range: [173, 174], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [174, 175], + loc: { + start: { column: 17, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'any', + + range: [175, 178], + loc: { + start: { column: 18, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [178, 179], + loc: { + start: { column: 21, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [179, 180], + loc: { + start: { column: 22, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'C', + + range: [180, 181], + loc: { + start: { column: 23, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [181, 182], + loc: { + start: { column: 24, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'implements', + + range: [183, 193], + loc: { + start: { column: 26, line: 7 }, + end: { column: 36, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'I', + + range: [194, 195], + loc: { + start: { column: 37, line: 7 }, + end: { column: 38, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [196, 197], + loc: { + start: { column: 39, line: 7 }, + end: { column: 40, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [197, 198], + loc: { + start: { column: 40, line: 7 }, + end: { column: 41, line: 7 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'class', + + range: [200, 205], + loc: { + start: { column: 0, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'C', + + range: [206, 207], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [208, 209], + loc: { + start: { column: 8, line: 9 }, + end: { column: 9, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [209, 210], + loc: { + start: { column: 9, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [211, 220], + loc: { + start: { column: 0, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'I', + + range: [221, 222], + loc: { + start: { column: 10, line: 10 }, + end: { column: 11, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [223, 224], + loc: { + start: { column: 12, line: 10 }, + end: { column: 13, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [224, 225], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'type', + + range: [226, 230], + loc: { + start: { column: 0, line: 11 }, + end: { column: 4, line: 11 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Constructor', + + range: [231, 242], + loc: { + start: { column: 5, line: 11 }, + end: { column: 16, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [242, 243], + loc: { + start: { column: 16, line: 11 }, + end: { column: 17, line: 11 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [243, 244], + loc: { + start: { column: 17, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [244, 245], + loc: { + start: { column: 18, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [246, 247], + loc: { + start: { column: 20, line: 11 }, + end: { column: 21, line: 11 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'new', + + range: [248, 251], + loc: { + start: { column: 22, line: 11 }, + end: { column: 25, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [252, 253], + loc: { + start: { column: 26, line: 11 }, + end: { column: 27, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '...', + + range: [253, 256], + loc: { + start: { column: 27, line: 11 }, + end: { column: 30, line: 11 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'args', + + range: [256, 260], + loc: { + start: { column: 30, line: 11 }, + end: { column: 34, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [260, 261], + loc: { + start: { column: 34, line: 11 }, + end: { column: 35, line: 11 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'any', + + range: [262, 265], + loc: { + start: { column: 36, line: 11 }, + end: { column: 39, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [265, 266], + loc: { + start: { column: 39, line: 11 }, + end: { column: 40, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [266, 267], + loc: { + start: { column: 40, line: 11 }, + end: { column: 41, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [267, 268], + loc: { + start: { column: 41, line: 11 }, + end: { column: 42, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=>', + + range: [269, 271], + loc: { + start: { column: 43, line: 11 }, + end: { column: 45, line: 11 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [272, 273], + loc: { + start: { column: 46, line: 11 }, + end: { column: 47, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [273, 274], + loc: { + start: { column: 47, line: 11 }, + end: { column: 48, line: 11 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/fixture.ts new file mode 100644 index 000000000000..7023869af0a2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/fixture.ts @@ -0,0 +1,19 @@ +// TODO: This fixture might be too large, and if so should be split up. + +const computed1 = 'buzz'; +const computed2 = 'bazz'; +const obj = { + member: 'member', + member2: 'member2', +}; +class X { + [computed1]?(); + [computed2]?() {} + [1]?(); + [2]?() {} + ['literal1']?(); + ['literal2']?() {} + [obj.member]?() {} + [obj.member2]?(); + [f()]?() {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..04e6998c422d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,694 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "computed1", + + range: [79, 88], + loc: { + start: { column: 6, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + init: Literal { + type: "Literal", + raw: "'buzz'", + value: "buzz", + + range: [91, 97], + loc: { + start: { column: 18, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [79, 97], + loc: { + start: { column: 6, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + kind: "const", + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "computed2", + + range: [105, 114], + loc: { + start: { column: 6, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + init: Literal { + type: "Literal", + raw: "'bazz'", + value: "bazz", + + range: [117, 123], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [105, 123], + loc: { + start: { column: 6, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + ], + kind: "const", + + range: [99, 124], + loc: { + start: { column: 0, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "obj", + + range: [131, 134], + loc: { + start: { column: 6, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + init: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "member", + + range: [141, 147], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: "'member'", + value: "member", + + range: [149, 157], + loc: { + start: { column: 10, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + + range: [141, 157], + loc: { + start: { column: 2, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "member2", + + range: [161, 168], + loc: { + start: { column: 2, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: "'member2'", + value: "member2", + + range: [170, 179], + loc: { + start: { column: 11, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + + range: [161, 179], + loc: { + start: { column: 2, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + ], + + range: [137, 182], + loc: { + start: { column: 12, line: 5 }, + end: { column: 1, line: 8 }, + }, + }, + + range: [131, 182], + loc: { + start: { column: 6, line: 5 }, + end: { column: 1, line: 8 }, + }, + }, + ], + kind: "const", + + range: [125, 183], + loc: { + start: { column: 0, line: 5 }, + end: { column: 2, line: 8 }, + }, + }, + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: true, + key: Identifier { + type: "Identifier", + name: "computed1", + + range: [197, 206], + loc: { + start: { column: 3, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + kind: "method", + optional: true, + override: false, + static: false, + value: TSEmptyBodyFunctionExpression { + type: "TSEmptyBodyFunctionExpression", + async: false, + body: null, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [208, 211], + loc: { + start: { column: 14, line: 10 }, + end: { column: 17, line: 10 }, + }, + }, + + range: [196, 211], + loc: { + start: { column: 2, line: 10 }, + end: { column: 17, line: 10 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: true, + key: Identifier { + type: "Identifier", + name: "computed2", + + range: [215, 224], + loc: { + start: { column: 3, line: 11 }, + end: { column: 12, line: 11 }, + }, + }, + kind: "method", + optional: true, + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [229, 231], + loc: { + start: { column: 17, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [226, 231], + loc: { + start: { column: 14, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + + range: [214, 231], + loc: { + start: { column: 2, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: true, + key: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [235, 236], + loc: { + start: { column: 3, line: 12 }, + end: { column: 4, line: 12 }, + }, + }, + kind: "method", + optional: true, + override: false, + static: false, + value: TSEmptyBodyFunctionExpression { + type: "TSEmptyBodyFunctionExpression", + async: false, + body: null, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [238, 241], + loc: { + start: { column: 6, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + + range: [234, 241], + loc: { + start: { column: 2, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: true, + key: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [245, 246], + loc: { + start: { column: 3, line: 13 }, + end: { column: 4, line: 13 }, + }, + }, + kind: "method", + optional: true, + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [251, 253], + loc: { + start: { column: 9, line: 13 }, + end: { column: 11, line: 13 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [248, 253], + loc: { + start: { column: 6, line: 13 }, + end: { column: 11, line: 13 }, + }, + }, + + range: [244, 253], + loc: { + start: { column: 2, line: 13 }, + end: { column: 11, line: 13 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: true, + key: Literal { + type: "Literal", + raw: "'literal1'", + value: "literal1", + + range: [257, 267], + loc: { + start: { column: 3, line: 14 }, + end: { column: 13, line: 14 }, + }, + }, + kind: "method", + optional: true, + override: false, + static: false, + value: TSEmptyBodyFunctionExpression { + type: "TSEmptyBodyFunctionExpression", + async: false, + body: null, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [269, 272], + loc: { + start: { column: 15, line: 14 }, + end: { column: 18, line: 14 }, + }, + }, + + range: [256, 272], + loc: { + start: { column: 2, line: 14 }, + end: { column: 18, line: 14 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: true, + key: Literal { + type: "Literal", + raw: "'literal2'", + value: "literal2", + + range: [276, 286], + loc: { + start: { column: 3, line: 15 }, + end: { column: 13, line: 15 }, + }, + }, + kind: "method", + optional: true, + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [291, 293], + loc: { + start: { column: 18, line: 15 }, + end: { column: 20, line: 15 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [288, 293], + loc: { + start: { column: 15, line: 15 }, + end: { column: 20, line: 15 }, + }, + }, + + range: [275, 293], + loc: { + start: { column: 2, line: 15 }, + end: { column: 20, line: 15 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: true, + key: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "obj", + + range: [297, 300], + loc: { + start: { column: 3, line: 16 }, + end: { column: 6, line: 16 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "member", + + range: [301, 307], + loc: { + start: { column: 7, line: 16 }, + end: { column: 13, line: 16 }, + }, + }, + + range: [297, 307], + loc: { + start: { column: 3, line: 16 }, + end: { column: 13, line: 16 }, + }, + }, + kind: "method", + optional: true, + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [312, 314], + loc: { + start: { column: 18, line: 16 }, + end: { column: 20, line: 16 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [309, 314], + loc: { + start: { column: 15, line: 16 }, + end: { column: 20, line: 16 }, + }, + }, + + range: [296, 314], + loc: { + start: { column: 2, line: 16 }, + end: { column: 20, line: 16 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: true, + key: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "obj", + + range: [318, 321], + loc: { + start: { column: 3, line: 17 }, + end: { column: 6, line: 17 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "member2", + + range: [322, 329], + loc: { + start: { column: 7, line: 17 }, + end: { column: 14, line: 17 }, + }, + }, + + range: [318, 329], + loc: { + start: { column: 3, line: 17 }, + end: { column: 14, line: 17 }, + }, + }, + kind: "method", + optional: true, + override: false, + static: false, + value: TSEmptyBodyFunctionExpression { + type: "TSEmptyBodyFunctionExpression", + async: false, + body: null, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [331, 334], + loc: { + start: { column: 16, line: 17 }, + end: { column: 19, line: 17 }, + }, + }, + + range: [317, 334], + loc: { + start: { column: 2, line: 17 }, + end: { column: 19, line: 17 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: true, + key: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "f", + + range: [338, 339], + loc: { + start: { column: 3, line: 18 }, + end: { column: 4, line: 18 }, + }, + }, + optional: false, + + range: [338, 341], + loc: { + start: { column: 3, line: 18 }, + end: { column: 6, line: 18 }, + }, + }, + kind: "method", + optional: true, + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [346, 348], + loc: { + start: { column: 11, line: 18 }, + end: { column: 13, line: 18 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [343, 348], + loc: { + start: { column: 8, line: 18 }, + end: { column: 13, line: 18 }, + }, + }, + + range: [337, 348], + loc: { + start: { column: 2, line: 18 }, + end: { column: 13, line: 18 }, + }, + }, + ], + + range: [192, 350], + loc: { + start: { column: 8, line: 9 }, + end: { column: 1, line: 19 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "X", + + range: [190, 191], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + superClass: null, + + range: [184, 350], + loc: { + start: { column: 0, line: 9 }, + end: { column: 1, line: 19 }, + }, + }, + ], + sourceType: "script", + + range: [73, 351], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 20 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..0678a3df7098 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,1026 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "const", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "computed1", + + range: [79, 88], + loc: { + start: { column: 6, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + String { + type: "String", + value: "'buzz'", + + range: [91, 97], + loc: { + start: { column: 18, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [99, 104], + loc: { + start: { column: 0, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "computed2", + + range: [105, 114], + loc: { + start: { column: 6, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [115, 116], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + String { + type: "String", + value: "'bazz'", + + range: [117, 123], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [123, 124], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [125, 130], + loc: { + start: { column: 0, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "obj", + + range: [131, 134], + loc: { + start: { column: 6, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [135, 136], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [137, 138], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "member", + + range: [141, 147], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [147, 148], + loc: { + start: { column: 8, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + String { + type: "String", + value: "'member'", + + range: [149, 157], + loc: { + start: { column: 10, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [157, 158], + loc: { + start: { column: 18, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "member2", + + range: [161, 168], + loc: { + start: { column: 2, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [168, 169], + loc: { + start: { column: 9, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + String { + type: "String", + value: "'member2'", + + range: [170, 179], + loc: { + start: { column: 11, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [179, 180], + loc: { + start: { column: 20, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [181, 182], + loc: { + start: { column: 0, line: 8 }, + end: { column: 1, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [182, 183], + loc: { + start: { column: 1, line: 8 }, + end: { column: 2, line: 8 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [184, 189], + loc: { + start: { column: 0, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [190, 191], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [192, 193], + loc: { + start: { column: 8, line: 9 }, + end: { column: 9, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [196, 197], + loc: { + start: { column: 2, line: 10 }, + end: { column: 3, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "computed1", + + range: [197, 206], + loc: { + start: { column: 3, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [206, 207], + loc: { + start: { column: 12, line: 10 }, + end: { column: 13, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [207, 208], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [208, 209], + loc: { + start: { column: 14, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [209, 210], + loc: { + start: { column: 15, line: 10 }, + end: { column: 16, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [210, 211], + loc: { + start: { column: 16, line: 10 }, + end: { column: 17, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [214, 215], + loc: { + start: { column: 2, line: 11 }, + end: { column: 3, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "computed2", + + range: [215, 224], + loc: { + start: { column: 3, line: 11 }, + end: { column: 12, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [224, 225], + loc: { + start: { column: 12, line: 11 }, + end: { column: 13, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [225, 226], + loc: { + start: { column: 13, line: 11 }, + end: { column: 14, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [226, 227], + loc: { + start: { column: 14, line: 11 }, + end: { column: 15, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [227, 228], + loc: { + start: { column: 15, line: 11 }, + end: { column: 16, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [229, 230], + loc: { + start: { column: 17, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [230, 231], + loc: { + start: { column: 18, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [234, 235], + loc: { + start: { column: 2, line: 12 }, + end: { column: 3, line: 12 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [235, 236], + loc: { + start: { column: 3, line: 12 }, + end: { column: 4, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [236, 237], + loc: { + start: { column: 4, line: 12 }, + end: { column: 5, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [237, 238], + loc: { + start: { column: 5, line: 12 }, + end: { column: 6, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [238, 239], + loc: { + start: { column: 6, line: 12 }, + end: { column: 7, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [239, 240], + loc: { + start: { column: 7, line: 12 }, + end: { column: 8, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [240, 241], + loc: { + start: { column: 8, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [244, 245], + loc: { + start: { column: 2, line: 13 }, + end: { column: 3, line: 13 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [245, 246], + loc: { + start: { column: 3, line: 13 }, + end: { column: 4, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [246, 247], + loc: { + start: { column: 4, line: 13 }, + end: { column: 5, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [247, 248], + loc: { + start: { column: 5, line: 13 }, + end: { column: 6, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [248, 249], + loc: { + start: { column: 6, line: 13 }, + end: { column: 7, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [249, 250], + loc: { + start: { column: 7, line: 13 }, + end: { column: 8, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [251, 252], + loc: { + start: { column: 9, line: 13 }, + end: { column: 10, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [252, 253], + loc: { + start: { column: 10, line: 13 }, + end: { column: 11, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [256, 257], + loc: { + start: { column: 2, line: 14 }, + end: { column: 3, line: 14 }, + }, + }, + String { + type: "String", + value: "'literal1'", + + range: [257, 267], + loc: { + start: { column: 3, line: 14 }, + end: { column: 13, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [267, 268], + loc: { + start: { column: 13, line: 14 }, + end: { column: 14, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [268, 269], + loc: { + start: { column: 14, line: 14 }, + end: { column: 15, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [269, 270], + loc: { + start: { column: 15, line: 14 }, + end: { column: 16, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [270, 271], + loc: { + start: { column: 16, line: 14 }, + end: { column: 17, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [271, 272], + loc: { + start: { column: 17, line: 14 }, + end: { column: 18, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [275, 276], + loc: { + start: { column: 2, line: 15 }, + end: { column: 3, line: 15 }, + }, + }, + String { + type: "String", + value: "'literal2'", + + range: [276, 286], + loc: { + start: { column: 3, line: 15 }, + end: { column: 13, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [286, 287], + loc: { + start: { column: 13, line: 15 }, + end: { column: 14, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [287, 288], + loc: { + start: { column: 14, line: 15 }, + end: { column: 15, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [288, 289], + loc: { + start: { column: 15, line: 15 }, + end: { column: 16, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [289, 290], + loc: { + start: { column: 16, line: 15 }, + end: { column: 17, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [291, 292], + loc: { + start: { column: 18, line: 15 }, + end: { column: 19, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [292, 293], + loc: { + start: { column: 19, line: 15 }, + end: { column: 20, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [296, 297], + loc: { + start: { column: 2, line: 16 }, + end: { column: 3, line: 16 }, + }, + }, + Identifier { + type: "Identifier", + value: "obj", + + range: [297, 300], + loc: { + start: { column: 3, line: 16 }, + end: { column: 6, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [300, 301], + loc: { + start: { column: 6, line: 16 }, + end: { column: 7, line: 16 }, + }, + }, + Identifier { + type: "Identifier", + value: "member", + + range: [301, 307], + loc: { + start: { column: 7, line: 16 }, + end: { column: 13, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [307, 308], + loc: { + start: { column: 13, line: 16 }, + end: { column: 14, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [308, 309], + loc: { + start: { column: 14, line: 16 }, + end: { column: 15, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [309, 310], + loc: { + start: { column: 15, line: 16 }, + end: { column: 16, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [310, 311], + loc: { + start: { column: 16, line: 16 }, + end: { column: 17, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [312, 313], + loc: { + start: { column: 18, line: 16 }, + end: { column: 19, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [313, 314], + loc: { + start: { column: 19, line: 16 }, + end: { column: 20, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [317, 318], + loc: { + start: { column: 2, line: 17 }, + end: { column: 3, line: 17 }, + }, + }, + Identifier { + type: "Identifier", + value: "obj", + + range: [318, 321], + loc: { + start: { column: 3, line: 17 }, + end: { column: 6, line: 17 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [321, 322], + loc: { + start: { column: 6, line: 17 }, + end: { column: 7, line: 17 }, + }, + }, + Identifier { + type: "Identifier", + value: "member2", + + range: [322, 329], + loc: { + start: { column: 7, line: 17 }, + end: { column: 14, line: 17 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [329, 330], + loc: { + start: { column: 14, line: 17 }, + end: { column: 15, line: 17 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [330, 331], + loc: { + start: { column: 15, line: 17 }, + end: { column: 16, line: 17 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [331, 332], + loc: { + start: { column: 16, line: 17 }, + end: { column: 17, line: 17 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [332, 333], + loc: { + start: { column: 17, line: 17 }, + end: { column: 18, line: 17 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [333, 334], + loc: { + start: { column: 18, line: 17 }, + end: { column: 19, line: 17 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [337, 338], + loc: { + start: { column: 2, line: 18 }, + end: { column: 3, line: 18 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [338, 339], + loc: { + start: { column: 3, line: 18 }, + end: { column: 4, line: 18 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [339, 340], + loc: { + start: { column: 4, line: 18 }, + end: { column: 5, line: 18 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [340, 341], + loc: { + start: { column: 5, line: 18 }, + end: { column: 6, line: 18 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [341, 342], + loc: { + start: { column: 6, line: 18 }, + end: { column: 7, line: 18 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [342, 343], + loc: { + start: { column: 7, line: 18 }, + end: { column: 8, line: 18 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [343, 344], + loc: { + start: { column: 8, line: 18 }, + end: { column: 9, line: 18 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [344, 345], + loc: { + start: { column: 9, line: 18 }, + end: { column: 10, line: 18 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [346, 347], + loc: { + start: { column: 11, line: 18 }, + end: { column: 12, line: 18 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [347, 348], + loc: { + start: { column: 12, line: 18 }, + end: { column: 13, line: 18 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [349, 350], + loc: { + start: { column: 0, line: 19 }, + end: { column: 1, line: 19 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..0d0768747ef0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/3-Babel-AST.shot @@ -0,0 +1,681 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "computed1", + + range: [79, 88], + loc: { + start: { column: 6, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + init: Literal { + type: "Literal", + raw: "'buzz'", + value: "buzz", + + range: [91, 97], + loc: { + start: { column: 18, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [79, 97], + loc: { + start: { column: 6, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + kind: "const", + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "computed2", + + range: [105, 114], + loc: { + start: { column: 6, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + init: Literal { + type: "Literal", + raw: "'bazz'", + value: "bazz", + + range: [117, 123], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [105, 123], + loc: { + start: { column: 6, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + ], + kind: "const", + + range: [99, 124], + loc: { + start: { column: 0, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "obj", + + range: [131, 134], + loc: { + start: { column: 6, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + init: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "member", + + range: [141, 147], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: "'member'", + value: "member", + + range: [149, 157], + loc: { + start: { column: 10, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + + range: [141, 157], + loc: { + start: { column: 2, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "member2", + + range: [161, 168], + loc: { + start: { column: 2, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: "'member2'", + value: "member2", + + range: [170, 179], + loc: { + start: { column: 11, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + + range: [161, 179], + loc: { + start: { column: 2, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + ], + + range: [137, 182], + loc: { + start: { column: 12, line: 5 }, + end: { column: 1, line: 8 }, + }, + }, + + range: [131, 182], + loc: { + start: { column: 6, line: 5 }, + end: { column: 1, line: 8 }, + }, + }, + ], + kind: "const", + + range: [125, 183], + loc: { + start: { column: 0, line: 5 }, + end: { column: 2, line: 8 }, + }, + }, + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: true, + key: Identifier { + type: "Identifier", + name: "computed1", + + range: [197, 206], + loc: { + start: { column: 3, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + kind: "method", + optional: true, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [208, 211], + loc: { + start: { column: 14, line: 10 }, + end: { column: 17, line: 10 }, + }, + }, + + range: [196, 211], + loc: { + start: { column: 2, line: 10 }, + end: { column: 17, line: 10 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: true, + key: Identifier { + type: "Identifier", + name: "computed2", + + range: [215, 224], + loc: { + start: { column: 3, line: 11 }, + end: { column: 12, line: 11 }, + }, + }, + kind: "method", + optional: true, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [229, 231], + loc: { + start: { column: 17, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [226, 231], + loc: { + start: { column: 14, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + + range: [214, 231], + loc: { + start: { column: 2, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: true, + key: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [235, 236], + loc: { + start: { column: 3, line: 12 }, + end: { column: 4, line: 12 }, + }, + }, + kind: "method", + optional: true, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [238, 241], + loc: { + start: { column: 6, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + + range: [234, 241], + loc: { + start: { column: 2, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: true, + key: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [245, 246], + loc: { + start: { column: 3, line: 13 }, + end: { column: 4, line: 13 }, + }, + }, + kind: "method", + optional: true, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [251, 253], + loc: { + start: { column: 9, line: 13 }, + end: { column: 11, line: 13 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [248, 253], + loc: { + start: { column: 6, line: 13 }, + end: { column: 11, line: 13 }, + }, + }, + + range: [244, 253], + loc: { + start: { column: 2, line: 13 }, + end: { column: 11, line: 13 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: true, + key: Literal { + type: "Literal", + raw: "'literal1'", + value: "literal1", + + range: [257, 267], + loc: { + start: { column: 3, line: 14 }, + end: { column: 13, line: 14 }, + }, + }, + kind: "method", + optional: true, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [269, 272], + loc: { + start: { column: 15, line: 14 }, + end: { column: 18, line: 14 }, + }, + }, + + range: [256, 272], + loc: { + start: { column: 2, line: 14 }, + end: { column: 18, line: 14 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: true, + key: Literal { + type: "Literal", + raw: "'literal2'", + value: "literal2", + + range: [276, 286], + loc: { + start: { column: 3, line: 15 }, + end: { column: 13, line: 15 }, + }, + }, + kind: "method", + optional: true, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [291, 293], + loc: { + start: { column: 18, line: 15 }, + end: { column: 20, line: 15 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [288, 293], + loc: { + start: { column: 15, line: 15 }, + end: { column: 20, line: 15 }, + }, + }, + + range: [275, 293], + loc: { + start: { column: 2, line: 15 }, + end: { column: 20, line: 15 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: true, + key: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "obj", + + range: [297, 300], + loc: { + start: { column: 3, line: 16 }, + end: { column: 6, line: 16 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "member", + + range: [301, 307], + loc: { + start: { column: 7, line: 16 }, + end: { column: 13, line: 16 }, + }, + }, + + range: [297, 307], + loc: { + start: { column: 3, line: 16 }, + end: { column: 13, line: 16 }, + }, + }, + kind: "method", + optional: true, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [312, 314], + loc: { + start: { column: 18, line: 16 }, + end: { column: 20, line: 16 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [309, 314], + loc: { + start: { column: 15, line: 16 }, + end: { column: 20, line: 16 }, + }, + }, + + range: [296, 314], + loc: { + start: { column: 2, line: 16 }, + end: { column: 20, line: 16 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: true, + key: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "obj", + + range: [318, 321], + loc: { + start: { column: 3, line: 17 }, + end: { column: 6, line: 17 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "member2", + + range: [322, 329], + loc: { + start: { column: 7, line: 17 }, + end: { column: 14, line: 17 }, + }, + }, + + range: [318, 329], + loc: { + start: { column: 3, line: 17 }, + end: { column: 14, line: 17 }, + }, + }, + kind: "method", + optional: true, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [331, 334], + loc: { + start: { column: 16, line: 17 }, + end: { column: 19, line: 17 }, + }, + }, + + range: [317, 334], + loc: { + start: { column: 2, line: 17 }, + end: { column: 19, line: 17 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: true, + key: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "f", + + range: [338, 339], + loc: { + start: { column: 3, line: 18 }, + end: { column: 4, line: 18 }, + }, + }, + optional: false, + + range: [338, 341], + loc: { + start: { column: 3, line: 18 }, + end: { column: 6, line: 18 }, + }, + }, + kind: "method", + optional: true, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [346, 348], + loc: { + start: { column: 11, line: 18 }, + end: { column: 13, line: 18 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [343, 348], + loc: { + start: { column: 8, line: 18 }, + end: { column: 13, line: 18 }, + }, + }, + + range: [337, 348], + loc: { + start: { column: 2, line: 18 }, + end: { column: 13, line: 18 }, + }, + }, + ], + + range: [192, 350], + loc: { + start: { column: 8, line: 9 }, + end: { column: 1, line: 19 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "X", + + range: [190, 191], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + superClass: null, + + range: [184, 350], + loc: { + start: { column: 0, line: 9 }, + end: { column: 1, line: 19 }, + }, + }, + ], + sourceType: "script", + + range: [73, 351], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 20 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..703dad7d5e62 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,1026 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "const", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "computed1", + + range: [79, 88], + loc: { + start: { column: 6, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + String { + type: "String", + value: "'buzz'", + + range: [91, 97], + loc: { + start: { column: 18, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [99, 104], + loc: { + start: { column: 0, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "computed2", + + range: [105, 114], + loc: { + start: { column: 6, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [115, 116], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + String { + type: "String", + value: "'bazz'", + + range: [117, 123], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [123, 124], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [125, 130], + loc: { + start: { column: 0, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "obj", + + range: [131, 134], + loc: { + start: { column: 6, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [135, 136], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [137, 138], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "member", + + range: [141, 147], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [147, 148], + loc: { + start: { column: 8, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + String { + type: "String", + value: "'member'", + + range: [149, 157], + loc: { + start: { column: 10, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [157, 158], + loc: { + start: { column: 18, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "member2", + + range: [161, 168], + loc: { + start: { column: 2, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [168, 169], + loc: { + start: { column: 9, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + String { + type: "String", + value: "'member2'", + + range: [170, 179], + loc: { + start: { column: 11, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [179, 180], + loc: { + start: { column: 20, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [181, 182], + loc: { + start: { column: 0, line: 8 }, + end: { column: 1, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [182, 183], + loc: { + start: { column: 1, line: 8 }, + end: { column: 2, line: 8 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [184, 189], + loc: { + start: { column: 0, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [190, 191], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [192, 193], + loc: { + start: { column: 8, line: 9 }, + end: { column: 9, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [196, 197], + loc: { + start: { column: 2, line: 10 }, + end: { column: 3, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "computed1", + + range: [197, 206], + loc: { + start: { column: 3, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [206, 207], + loc: { + start: { column: 12, line: 10 }, + end: { column: 13, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [207, 208], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [208, 209], + loc: { + start: { column: 14, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [209, 210], + loc: { + start: { column: 15, line: 10 }, + end: { column: 16, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [210, 211], + loc: { + start: { column: 16, line: 10 }, + end: { column: 17, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [214, 215], + loc: { + start: { column: 2, line: 11 }, + end: { column: 3, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "computed2", + + range: [215, 224], + loc: { + start: { column: 3, line: 11 }, + end: { column: 12, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [224, 225], + loc: { + start: { column: 12, line: 11 }, + end: { column: 13, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [225, 226], + loc: { + start: { column: 13, line: 11 }, + end: { column: 14, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [226, 227], + loc: { + start: { column: 14, line: 11 }, + end: { column: 15, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [227, 228], + loc: { + start: { column: 15, line: 11 }, + end: { column: 16, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [229, 230], + loc: { + start: { column: 17, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [230, 231], + loc: { + start: { column: 18, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [234, 235], + loc: { + start: { column: 2, line: 12 }, + end: { column: 3, line: 12 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [235, 236], + loc: { + start: { column: 3, line: 12 }, + end: { column: 4, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [236, 237], + loc: { + start: { column: 4, line: 12 }, + end: { column: 5, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [237, 238], + loc: { + start: { column: 5, line: 12 }, + end: { column: 6, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [238, 239], + loc: { + start: { column: 6, line: 12 }, + end: { column: 7, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [239, 240], + loc: { + start: { column: 7, line: 12 }, + end: { column: 8, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [240, 241], + loc: { + start: { column: 8, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [244, 245], + loc: { + start: { column: 2, line: 13 }, + end: { column: 3, line: 13 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [245, 246], + loc: { + start: { column: 3, line: 13 }, + end: { column: 4, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [246, 247], + loc: { + start: { column: 4, line: 13 }, + end: { column: 5, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [247, 248], + loc: { + start: { column: 5, line: 13 }, + end: { column: 6, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [248, 249], + loc: { + start: { column: 6, line: 13 }, + end: { column: 7, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [249, 250], + loc: { + start: { column: 7, line: 13 }, + end: { column: 8, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [251, 252], + loc: { + start: { column: 9, line: 13 }, + end: { column: 10, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [252, 253], + loc: { + start: { column: 10, line: 13 }, + end: { column: 11, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [256, 257], + loc: { + start: { column: 2, line: 14 }, + end: { column: 3, line: 14 }, + }, + }, + String { + type: "String", + value: "'literal1'", + + range: [257, 267], + loc: { + start: { column: 3, line: 14 }, + end: { column: 13, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [267, 268], + loc: { + start: { column: 13, line: 14 }, + end: { column: 14, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [268, 269], + loc: { + start: { column: 14, line: 14 }, + end: { column: 15, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [269, 270], + loc: { + start: { column: 15, line: 14 }, + end: { column: 16, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [270, 271], + loc: { + start: { column: 16, line: 14 }, + end: { column: 17, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [271, 272], + loc: { + start: { column: 17, line: 14 }, + end: { column: 18, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [275, 276], + loc: { + start: { column: 2, line: 15 }, + end: { column: 3, line: 15 }, + }, + }, + String { + type: "String", + value: "'literal2'", + + range: [276, 286], + loc: { + start: { column: 3, line: 15 }, + end: { column: 13, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [286, 287], + loc: { + start: { column: 13, line: 15 }, + end: { column: 14, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [287, 288], + loc: { + start: { column: 14, line: 15 }, + end: { column: 15, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [288, 289], + loc: { + start: { column: 15, line: 15 }, + end: { column: 16, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [289, 290], + loc: { + start: { column: 16, line: 15 }, + end: { column: 17, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [291, 292], + loc: { + start: { column: 18, line: 15 }, + end: { column: 19, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [292, 293], + loc: { + start: { column: 19, line: 15 }, + end: { column: 20, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [296, 297], + loc: { + start: { column: 2, line: 16 }, + end: { column: 3, line: 16 }, + }, + }, + Identifier { + type: "Identifier", + value: "obj", + + range: [297, 300], + loc: { + start: { column: 3, line: 16 }, + end: { column: 6, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [300, 301], + loc: { + start: { column: 6, line: 16 }, + end: { column: 7, line: 16 }, + }, + }, + Identifier { + type: "Identifier", + value: "member", + + range: [301, 307], + loc: { + start: { column: 7, line: 16 }, + end: { column: 13, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [307, 308], + loc: { + start: { column: 13, line: 16 }, + end: { column: 14, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [308, 309], + loc: { + start: { column: 14, line: 16 }, + end: { column: 15, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [309, 310], + loc: { + start: { column: 15, line: 16 }, + end: { column: 16, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [310, 311], + loc: { + start: { column: 16, line: 16 }, + end: { column: 17, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [312, 313], + loc: { + start: { column: 18, line: 16 }, + end: { column: 19, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [313, 314], + loc: { + start: { column: 19, line: 16 }, + end: { column: 20, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [317, 318], + loc: { + start: { column: 2, line: 17 }, + end: { column: 3, line: 17 }, + }, + }, + Identifier { + type: "Identifier", + value: "obj", + + range: [318, 321], + loc: { + start: { column: 3, line: 17 }, + end: { column: 6, line: 17 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [321, 322], + loc: { + start: { column: 6, line: 17 }, + end: { column: 7, line: 17 }, + }, + }, + Identifier { + type: "Identifier", + value: "member2", + + range: [322, 329], + loc: { + start: { column: 7, line: 17 }, + end: { column: 14, line: 17 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [329, 330], + loc: { + start: { column: 14, line: 17 }, + end: { column: 15, line: 17 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [330, 331], + loc: { + start: { column: 15, line: 17 }, + end: { column: 16, line: 17 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [331, 332], + loc: { + start: { column: 16, line: 17 }, + end: { column: 17, line: 17 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [332, 333], + loc: { + start: { column: 17, line: 17 }, + end: { column: 18, line: 17 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [333, 334], + loc: { + start: { column: 18, line: 17 }, + end: { column: 19, line: 17 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [337, 338], + loc: { + start: { column: 2, line: 18 }, + end: { column: 3, line: 18 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [338, 339], + loc: { + start: { column: 3, line: 18 }, + end: { column: 4, line: 18 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [339, 340], + loc: { + start: { column: 4, line: 18 }, + end: { column: 5, line: 18 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [340, 341], + loc: { + start: { column: 5, line: 18 }, + end: { column: 6, line: 18 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [341, 342], + loc: { + start: { column: 6, line: 18 }, + end: { column: 7, line: 18 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [342, 343], + loc: { + start: { column: 7, line: 18 }, + end: { column: 8, line: 18 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [343, 344], + loc: { + start: { column: 8, line: 18 }, + end: { column: 9, line: 18 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [344, 345], + loc: { + start: { column: 9, line: 18 }, + end: { column: 10, line: 18 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [346, 347], + loc: { + start: { column: 11, line: 18 }, + end: { column: 12, line: 18 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [347, 348], + loc: { + start: { column: 12, line: 18 }, + end: { column: 13, line: 18 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [349, 350], + loc: { + start: { column: 0, line: 19 }, + end: { column: 1, line: 19 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..0adc9129ec5d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,706 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'computed1', + + range: [79, 88], + loc: { + start: { column: 6, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '\\\\'buzz\\\\'', + value: 'buzz', + + range: [91, 97], + loc: { + start: { column: 18, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [79, 97], + loc: { + start: { column: 6, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + kind: 'const', + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'computed2', + + range: [105, 114], + loc: { + start: { column: 6, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '\\\\'bazz\\\\'', + value: 'bazz', + + range: [117, 123], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [105, 123], + loc: { + start: { column: 6, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + ], + kind: 'const', + + range: [99, 124], + loc: { + start: { column: 0, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'obj', + + range: [131, 134], + loc: { + start: { column: 6, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + init: ObjectExpression { + type: 'ObjectExpression', + properties: Array [ + Property { + type: 'Property', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'member', + + range: [141, 147], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + kind: 'init', + method: false, + shorthand: false, + value: Literal { + type: 'Literal', + raw: '\\\\'member\\\\'', + value: 'member', + + range: [149, 157], + loc: { + start: { column: 10, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + + range: [141, 157], + loc: { + start: { column: 2, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + Property { + type: 'Property', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'member2', + + range: [161, 168], + loc: { + start: { column: 2, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + kind: 'init', + method: false, + shorthand: false, + value: Literal { + type: 'Literal', + raw: '\\\\'member2\\\\'', + value: 'member2', + + range: [170, 179], + loc: { + start: { column: 11, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + + range: [161, 179], + loc: { + start: { column: 2, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + ], + + range: [137, 182], + loc: { + start: { column: 12, line: 5 }, + end: { column: 1, line: 8 }, + }, + }, + + range: [131, 182], + loc: { + start: { column: 6, line: 5 }, + end: { column: 1, line: 8 }, + }, + }, + ], + kind: 'const', + + range: [125, 183], + loc: { + start: { column: 0, line: 5 }, + end: { column: 2, line: 8 }, + }, + }, + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: true, + key: Identifier { + type: 'Identifier', + name: 'computed1', + + range: [197, 206], + loc: { + start: { column: 3, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + kind: 'method', + optional: true, +- override: false, + static: false, +- value: TSEmptyBodyFunctionExpression { +- type: 'TSEmptyBodyFunctionExpression', ++ value: FunctionExpression { ++ type: 'FunctionExpression', + async: false, +- body: null, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [208, 211], + loc: { + start: { column: 14, line: 10 }, + end: { column: 17, line: 10 }, + }, + }, + + range: [196, 211], + loc: { + start: { column: 2, line: 10 }, + end: { column: 17, line: 10 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + computed: true, + key: Identifier { + type: 'Identifier', + name: 'computed2', + + range: [215, 224], + loc: { + start: { column: 3, line: 11 }, + end: { column: 12, line: 11 }, + }, + }, + kind: 'method', + optional: true, +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [229, 231], + loc: { + start: { column: 17, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [226, 231], + loc: { + start: { column: 14, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + + range: [214, 231], + loc: { + start: { column: 2, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + computed: true, + key: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [235, 236], + loc: { + start: { column: 3, line: 12 }, + end: { column: 4, line: 12 }, + }, + }, + kind: 'method', + optional: true, +- override: false, + static: false, +- value: TSEmptyBodyFunctionExpression { +- type: 'TSEmptyBodyFunctionExpression', ++ value: FunctionExpression { ++ type: 'FunctionExpression', + async: false, +- body: null, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [238, 241], + loc: { + start: { column: 6, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + + range: [234, 241], + loc: { + start: { column: 2, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + computed: true, + key: Literal { + type: 'Literal', + raw: '2', + value: 2, + + range: [245, 246], + loc: { + start: { column: 3, line: 13 }, + end: { column: 4, line: 13 }, + }, + }, + kind: 'method', + optional: true, +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [251, 253], + loc: { + start: { column: 9, line: 13 }, + end: { column: 11, line: 13 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [248, 253], + loc: { + start: { column: 6, line: 13 }, + end: { column: 11, line: 13 }, + }, + }, + + range: [244, 253], + loc: { + start: { column: 2, line: 13 }, + end: { column: 11, line: 13 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + computed: true, + key: Literal { + type: 'Literal', + raw: '\\\\'literal1\\\\'', + value: 'literal1', + + range: [257, 267], + loc: { + start: { column: 3, line: 14 }, + end: { column: 13, line: 14 }, + }, + }, + kind: 'method', + optional: true, +- override: false, + static: false, +- value: TSEmptyBodyFunctionExpression { +- type: 'TSEmptyBodyFunctionExpression', ++ value: FunctionExpression { ++ type: 'FunctionExpression', + async: false, +- body: null, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [269, 272], + loc: { + start: { column: 15, line: 14 }, + end: { column: 18, line: 14 }, + }, + }, + + range: [256, 272], + loc: { + start: { column: 2, line: 14 }, + end: { column: 18, line: 14 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + computed: true, + key: Literal { + type: 'Literal', + raw: '\\\\'literal2\\\\'', + value: 'literal2', + + range: [276, 286], + loc: { + start: { column: 3, line: 15 }, + end: { column: 13, line: 15 }, + }, + }, + kind: 'method', + optional: true, +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [291, 293], + loc: { + start: { column: 18, line: 15 }, + end: { column: 20, line: 15 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [288, 293], + loc: { + start: { column: 15, line: 15 }, + end: { column: 20, line: 15 }, + }, + }, + + range: [275, 293], + loc: { + start: { column: 2, line: 15 }, + end: { column: 20, line: 15 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + computed: true, + key: MemberExpression { + type: 'MemberExpression', + computed: false, + object: Identifier { + type: 'Identifier', + name: 'obj', + + range: [297, 300], + loc: { + start: { column: 3, line: 16 }, + end: { column: 6, line: 16 }, + }, + }, + optional: false, + property: Identifier { + type: 'Identifier', + name: 'member', + + range: [301, 307], + loc: { + start: { column: 7, line: 16 }, + end: { column: 13, line: 16 }, + }, + }, + + range: [297, 307], + loc: { + start: { column: 3, line: 16 }, + end: { column: 13, line: 16 }, + }, + }, + kind: 'method', + optional: true, +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [312, 314], + loc: { + start: { column: 18, line: 16 }, + end: { column: 20, line: 16 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [309, 314], + loc: { + start: { column: 15, line: 16 }, + end: { column: 20, line: 16 }, + }, + }, + + range: [296, 314], + loc: { + start: { column: 2, line: 16 }, + end: { column: 20, line: 16 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + computed: true, + key: MemberExpression { + type: 'MemberExpression', + computed: false, + object: Identifier { + type: 'Identifier', + name: 'obj', + + range: [318, 321], + loc: { + start: { column: 3, line: 17 }, + end: { column: 6, line: 17 }, + }, + }, + optional: false, + property: Identifier { + type: 'Identifier', + name: 'member2', + + range: [322, 329], + loc: { + start: { column: 7, line: 17 }, + end: { column: 14, line: 17 }, + }, + }, + + range: [318, 329], + loc: { + start: { column: 3, line: 17 }, + end: { column: 14, line: 17 }, + }, + }, + kind: 'method', + optional: true, +- override: false, + static: false, +- value: TSEmptyBodyFunctionExpression { +- type: 'TSEmptyBodyFunctionExpression', ++ value: FunctionExpression { ++ type: 'FunctionExpression', + async: false, +- body: null, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [331, 334], + loc: { + start: { column: 16, line: 17 }, + end: { column: 19, line: 17 }, + }, + }, + + range: [317, 334], + loc: { + start: { column: 2, line: 17 }, + end: { column: 19, line: 17 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + computed: true, + key: CallExpression { + type: 'CallExpression', + arguments: Array [], + callee: Identifier { + type: 'Identifier', + name: 'f', + + range: [338, 339], + loc: { + start: { column: 3, line: 18 }, + end: { column: 4, line: 18 }, + }, + }, + optional: false, + + range: [338, 341], + loc: { + start: { column: 3, line: 18 }, + end: { column: 6, line: 18 }, + }, + }, + kind: 'method', + optional: true, +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [346, 348], + loc: { + start: { column: 11, line: 18 }, + end: { column: 13, line: 18 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [343, 348], + loc: { + start: { column: 8, line: 18 }, + end: { column: 13, line: 18 }, + }, + }, + + range: [337, 348], + loc: { + start: { column: 2, line: 18 }, + end: { column: 13, line: 18 }, + }, + }, + ], + + range: [192, 350], + loc: { + start: { column: 8, line: 9 }, + end: { column: 1, line: 19 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'X', + + range: [190, 191], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + superClass: null, + + range: [184, 350], + loc: { + start: { column: 0, line: 9 }, + end: { column: 1, line: 19 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 351], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 20 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..e315074278aa --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/fixture.ts new file mode 100644 index 000000000000..b1723dd08230 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class X { + private ['foo']? = undefined; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..86bb58bff3ca --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,83 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-property TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + accessibility: "private", + computed: true, + declare: false, + key: Literal { + type: "Literal", + raw: "'foo'", + value: "foo", + + range: [94, 99], + loc: { + start: { column: 11, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + optional: true, + override: false, + static: false, + value: Identifier { + type: "Identifier", + name: "undefined", + + range: [104, 113], + loc: { + start: { column: 21, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + + range: [85, 114], + loc: { + start: { column: 2, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + ], + + range: [81, 116], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "X", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 116], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 117], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..e2b859392af9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-property TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "private", + + range: [85, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [93, 94], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + String { + type: "String", + value: "'foo'", + + range: [94, 99], + loc: { + start: { column: 11, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [99, 100], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [100, 101], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [102, 103], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "undefined", + + range: [104, 113], + loc: { + start: { column: 21, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [113, 114], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [115, 116], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..d103b93133b4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/3-Babel-AST.shot @@ -0,0 +1,81 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-property Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + accessibility: "private", + computed: true, + key: Literal { + type: "Literal", + raw: "'foo'", + value: "foo", + + range: [94, 99], + loc: { + start: { column: 11, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + optional: true, + static: false, + value: Identifier { + type: "Identifier", + name: "undefined", + + range: [104, 113], + loc: { + start: { column: 21, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + + range: [85, 114], + loc: { + start: { column: 2, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + ], + + range: [81, 116], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "X", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 116], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 117], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..e2f50b5e0c9e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-property Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "private", + + range: [85, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [93, 94], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + String { + type: "String", + value: "'foo'", + + range: [94, 99], + loc: { + start: { column: 11, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [99, 100], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [100, 101], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [102, 103], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "undefined", + + range: [104, 113], + loc: { + start: { column: 21, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [113, 114], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [115, 116], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..f12e57a2e68b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,87 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-property AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + accessibility: 'private', + computed: true, +- declare: false, + key: Literal { + type: 'Literal', + raw: '\\\\'foo\\\\'', + value: 'foo', + + range: [94, 99], + loc: { + start: { column: 11, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + optional: true, +- override: false, + static: false, + value: Identifier { + type: 'Identifier', + name: 'undefined', + + range: [104, 113], + loc: { + start: { column: 21, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + + range: [85, 114], + loc: { + start: { column: 2, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + ], + + range: [81, 116], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'X', + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 116], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 117], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..9c2e0ad06a1d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,132 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-property AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'X', + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'private', + + range: [85, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [93, 94], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + String { + type: 'String', + value: '\\\\'foo\\\\'', + + range: [94, 99], + loc: { + start: { column: 11, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [99, 100], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [100, 101], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [102, 103], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'undefined', + + range: [104, 113], + loc: { + start: { column: 21, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [113, 114], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [115, 116], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/fixture.ts new file mode 100644 index 000000000000..43a6b1f5b780 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/fixture.ts @@ -0,0 +1,7 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + foo?(); + bar?(): string; + private baz?(): string; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..fe3c85982bf9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,201 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-methods TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [87, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + kind: "method", + optional: true, + override: false, + static: false, + value: TSEmptyBodyFunctionExpression { + type: "TSEmptyBodyFunctionExpression", + async: false, + body: null, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [91, 94], + loc: { + start: { column: 6, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [87, 94], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [97, 100], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + kind: "method", + optional: true, + override: false, + static: false, + value: TSEmptyBodyFunctionExpression { + type: "TSEmptyBodyFunctionExpression", + async: false, + body: null, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [105, 111], + loc: { + start: { column: 10, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + + range: [103, 111], + loc: { + start: { column: 8, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + + range: [101, 112], + loc: { + start: { column: 6, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [97, 112], + loc: { + start: { column: 2, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + accessibility: "private", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [123, 126], + loc: { + start: { column: 10, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + kind: "method", + optional: true, + override: false, + static: false, + value: TSEmptyBodyFunctionExpression { + type: "TSEmptyBodyFunctionExpression", + async: false, + body: null, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [131, 137], + loc: { + start: { column: 18, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [129, 137], + loc: { + start: { column: 16, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [127, 138], + loc: { + start: { column: 14, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + + range: [115, 138], + loc: { + start: { column: 2, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + ], + + range: [83, 140], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 140], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 141], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..7e27407053eb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,246 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-methods TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [87, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [90, 91], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [91, 92], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [92, 93], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [93, 94], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [97, 100], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [100, 101], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [101, 102], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [102, 103], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [103, 104], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [105, 111], + loc: { + start: { column: 10, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [111, 112], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "private", + + range: [115, 122], + loc: { + start: { column: 2, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [123, 126], + loc: { + start: { column: 10, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [126, 127], + loc: { + start: { column: 13, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [127, 128], + loc: { + start: { column: 14, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [128, 129], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [129, 130], + loc: { + start: { column: 16, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [131, 137], + loc: { + start: { column: 18, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [137, 138], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [139, 140], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..4c638ba2c7a8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/3-Babel-AST.shot @@ -0,0 +1,195 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-methods Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [87, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + kind: "method", + optional: true, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [91, 94], + loc: { + start: { column: 6, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [87, 94], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [97, 100], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + kind: "method", + optional: true, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [105, 111], + loc: { + start: { column: 10, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + + range: [103, 111], + loc: { + start: { column: 8, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + + range: [101, 112], + loc: { + start: { column: 6, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [97, 112], + loc: { + start: { column: 2, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + accessibility: "private", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [123, 126], + loc: { + start: { column: 10, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + kind: "method", + optional: true, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [131, 137], + loc: { + start: { column: 18, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [129, 137], + loc: { + start: { column: 16, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [127, 138], + loc: { + start: { column: 14, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + + range: [115, 138], + loc: { + start: { column: 2, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + ], + + range: [83, 140], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 140], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 141], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..70c78b57b9a9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,246 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-methods Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [87, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [90, 91], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [91, 92], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [92, 93], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [93, 94], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [97, 100], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [100, 101], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [101, 102], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [102, 103], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [103, 104], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [105, 111], + loc: { + start: { column: 10, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [111, 112], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "private", + + range: [115, 122], + loc: { + start: { column: 2, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [123, 126], + loc: { + start: { column: 10, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [126, 127], + loc: { + start: { column: 13, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [127, 128], + loc: { + start: { column: 14, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [128, 129], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [129, 130], + loc: { + start: { column: 16, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [131, 137], + loc: { + start: { column: 18, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [137, 138], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [139, 140], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..9e3032b56954 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,211 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-methods AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'foo', + + range: [87, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + kind: 'method', + optional: true, +- override: false, + static: false, +- value: TSEmptyBodyFunctionExpression { +- type: 'TSEmptyBodyFunctionExpression', ++ value: FunctionExpression { ++ type: 'FunctionExpression', + async: false, +- body: null, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [91, 94], + loc: { + start: { column: 6, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [87, 94], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'bar', + + range: [97, 100], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + kind: 'method', + optional: true, +- override: false, + static: false, +- value: TSEmptyBodyFunctionExpression { +- type: 'TSEmptyBodyFunctionExpression', ++ value: FunctionExpression { ++ type: 'FunctionExpression', + async: false, +- body: null, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [105, 111], + loc: { + start: { column: 10, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + + range: [103, 111], + loc: { + start: { column: 8, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + + range: [101, 112], + loc: { + start: { column: 6, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [97, 112], + loc: { + start: { column: 2, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + accessibility: 'private', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'baz', + + range: [123, 126], + loc: { + start: { column: 10, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + kind: 'method', + optional: true, +- override: false, + static: false, +- value: TSEmptyBodyFunctionExpression { +- type: 'TSEmptyBodyFunctionExpression', ++ value: FunctionExpression { ++ type: 'FunctionExpression', + async: false, +- body: null, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [131, 137], + loc: { + start: { column: 18, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [129, 137], + loc: { + start: { column: 16, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [127, 138], + loc: { + start: { column: 14, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + + range: [115, 138], + loc: { + start: { column: 2, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + ], + + range: [83, 140], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 140], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 141], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..0c88f1128b02 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,252 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-methods AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'foo', + + range: [87, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [90, 91], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [91, 92], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [92, 93], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [93, 94], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar', + + range: [97, 100], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [100, 101], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [101, 102], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [102, 103], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [103, 104], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [105, 111], + loc: { + start: { column: 10, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [111, 112], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'private', + + range: [115, 122], + loc: { + start: { column: 2, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'baz', + + range: [123, 126], + loc: { + start: { column: 10, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [126, 127], + loc: { + start: { column: 13, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [127, 128], + loc: { + start: { column: 14, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [128, 129], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [129, 130], + loc: { + start: { column: 16, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [131, 137], + loc: { + start: { column: 18, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [137, 138], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [139, 140], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/fixture.ts new file mode 100644 index 000000000000..4c850ac4198e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/fixture.ts @@ -0,0 +1,15 @@ +// TODO: This fixture might be too large, and if so should be split up. + +const computed = 'buzz'; +const computed2 = 'bazz'; +class Foo { + foo?; + bar?: string; + private baz?: string; + [computed]?; + ['literal']?; + [1]?; + [computed2]?: string; + ['literal2']?: string; + [2]?: string; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..7a053a8b1af1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,451 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "computed", + + range: [79, 87], + loc: { + start: { column: 6, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + init: Literal { + type: "Literal", + raw: "'buzz'", + value: "buzz", + + range: [90, 96], + loc: { + start: { column: 17, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [79, 96], + loc: { + start: { column: 6, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + kind: "const", + + range: [73, 97], + loc: { + start: { column: 0, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "computed2", + + range: [104, 113], + loc: { + start: { column: 6, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + init: Literal { + type: "Literal", + raw: "'bazz'", + value: "bazz", + + range: [116, 122], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [104, 122], + loc: { + start: { column: 6, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + ], + kind: "const", + + range: [98, 123], + loc: { + start: { column: 0, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [138, 141], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + optional: true, + override: false, + static: false, + value: null, + + range: [138, 143], + loc: { + start: { column: 2, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [146, 149], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + optional: true, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [152, 158], + loc: { + start: { column: 8, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + + range: [150, 158], + loc: { + start: { column: 6, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + value: null, + + range: [146, 159], + loc: { + start: { column: 2, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + accessibility: "private", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [170, 173], + loc: { + start: { column: 10, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + optional: true, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [176, 182], + loc: { + start: { column: 16, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [174, 182], + loc: { + start: { column: 14, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + value: null, + + range: [162, 183], + loc: { + start: { column: 2, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + declare: false, + key: Identifier { + type: "Identifier", + name: "computed", + + range: [187, 195], + loc: { + start: { column: 3, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + optional: true, + override: false, + static: false, + value: null, + + range: [186, 198], + loc: { + start: { column: 2, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + declare: false, + key: Literal { + type: "Literal", + raw: "'literal'", + value: "literal", + + range: [202, 211], + loc: { + start: { column: 3, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + optional: true, + override: false, + static: false, + value: null, + + range: [201, 214], + loc: { + start: { column: 2, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + declare: false, + key: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [218, 219], + loc: { + start: { column: 3, line: 11 }, + end: { column: 4, line: 11 }, + }, + }, + optional: true, + override: false, + static: false, + value: null, + + range: [217, 222], + loc: { + start: { column: 2, line: 11 }, + end: { column: 7, line: 11 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + declare: false, + key: Identifier { + type: "Identifier", + name: "computed2", + + range: [226, 235], + loc: { + start: { column: 3, line: 12 }, + end: { column: 12, line: 12 }, + }, + }, + optional: true, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [239, 245], + loc: { + start: { column: 16, line: 12 }, + end: { column: 22, line: 12 }, + }, + }, + + range: [237, 245], + loc: { + start: { column: 14, line: 12 }, + end: { column: 22, line: 12 }, + }, + }, + value: null, + + range: [225, 246], + loc: { + start: { column: 2, line: 12 }, + end: { column: 23, line: 12 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + declare: false, + key: Literal { + type: "Literal", + raw: "'literal2'", + value: "literal2", + + range: [250, 260], + loc: { + start: { column: 3, line: 13 }, + end: { column: 13, line: 13 }, + }, + }, + optional: true, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [264, 270], + loc: { + start: { column: 17, line: 13 }, + end: { column: 23, line: 13 }, + }, + }, + + range: [262, 270], + loc: { + start: { column: 15, line: 13 }, + end: { column: 23, line: 13 }, + }, + }, + value: null, + + range: [249, 271], + loc: { + start: { column: 2, line: 13 }, + end: { column: 24, line: 13 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + declare: false, + key: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [275, 276], + loc: { + start: { column: 3, line: 14 }, + end: { column: 4, line: 14 }, + }, + }, + optional: true, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [280, 286], + loc: { + start: { column: 8, line: 14 }, + end: { column: 14, line: 14 }, + }, + }, + + range: [278, 286], + loc: { + start: { column: 6, line: 14 }, + end: { column: 14, line: 14 }, + }, + }, + value: null, + + range: [274, 287], + loc: { + start: { column: 2, line: 14 }, + end: { column: 15, line: 14 }, + }, + }, + ], + + range: [134, 289], + loc: { + start: { column: 10, line: 5 }, + end: { column: 1, line: 15 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [130, 133], + loc: { + start: { column: 6, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + superClass: null, + + range: [124, 289], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 15 }, + }, + }, + ], + sourceType: "script", + + range: [73, 290], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 16 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..b42176fc680d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,646 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "const", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "computed", + + range: [79, 87], + loc: { + start: { column: 6, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + String { + type: "String", + value: "'buzz'", + + range: [90, 96], + loc: { + start: { column: 17, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [98, 103], + loc: { + start: { column: 0, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "computed2", + + range: [104, 113], + loc: { + start: { column: 6, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [114, 115], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + String { + type: "String", + value: "'bazz'", + + range: [116, 122], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [122, 123], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [124, 129], + loc: { + start: { column: 0, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [130, 133], + loc: { + start: { column: 6, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [134, 135], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [138, 141], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [141, 142], + loc: { + start: { column: 5, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [142, 143], + loc: { + start: { column: 6, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [146, 149], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [149, 150], + loc: { + start: { column: 5, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [150, 151], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [152, 158], + loc: { + start: { column: 8, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [158, 159], + loc: { + start: { column: 14, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "private", + + range: [162, 169], + loc: { + start: { column: 2, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [170, 173], + loc: { + start: { column: 10, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [173, 174], + loc: { + start: { column: 13, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [174, 175], + loc: { + start: { column: 14, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [176, 182], + loc: { + start: { column: 16, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [182, 183], + loc: { + start: { column: 22, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [186, 187], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "computed", + + range: [187, 195], + loc: { + start: { column: 3, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [195, 196], + loc: { + start: { column: 11, line: 9 }, + end: { column: 12, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [196, 197], + loc: { + start: { column: 12, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [197, 198], + loc: { + start: { column: 13, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [201, 202], + loc: { + start: { column: 2, line: 10 }, + end: { column: 3, line: 10 }, + }, + }, + String { + type: "String", + value: "'literal'", + + range: [202, 211], + loc: { + start: { column: 3, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [211, 212], + loc: { + start: { column: 12, line: 10 }, + end: { column: 13, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [212, 213], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [213, 214], + loc: { + start: { column: 14, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [217, 218], + loc: { + start: { column: 2, line: 11 }, + end: { column: 3, line: 11 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [218, 219], + loc: { + start: { column: 3, line: 11 }, + end: { column: 4, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [219, 220], + loc: { + start: { column: 4, line: 11 }, + end: { column: 5, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [220, 221], + loc: { + start: { column: 5, line: 11 }, + end: { column: 6, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [221, 222], + loc: { + start: { column: 6, line: 11 }, + end: { column: 7, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [225, 226], + loc: { + start: { column: 2, line: 12 }, + end: { column: 3, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + value: "computed2", + + range: [226, 235], + loc: { + start: { column: 3, line: 12 }, + end: { column: 12, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [235, 236], + loc: { + start: { column: 12, line: 12 }, + end: { column: 13, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [236, 237], + loc: { + start: { column: 13, line: 12 }, + end: { column: 14, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [237, 238], + loc: { + start: { column: 14, line: 12 }, + end: { column: 15, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [239, 245], + loc: { + start: { column: 16, line: 12 }, + end: { column: 22, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [245, 246], + loc: { + start: { column: 22, line: 12 }, + end: { column: 23, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [249, 250], + loc: { + start: { column: 2, line: 13 }, + end: { column: 3, line: 13 }, + }, + }, + String { + type: "String", + value: "'literal2'", + + range: [250, 260], + loc: { + start: { column: 3, line: 13 }, + end: { column: 13, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [260, 261], + loc: { + start: { column: 13, line: 13 }, + end: { column: 14, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [261, 262], + loc: { + start: { column: 14, line: 13 }, + end: { column: 15, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [262, 263], + loc: { + start: { column: 15, line: 13 }, + end: { column: 16, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [264, 270], + loc: { + start: { column: 17, line: 13 }, + end: { column: 23, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [270, 271], + loc: { + start: { column: 23, line: 13 }, + end: { column: 24, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [274, 275], + loc: { + start: { column: 2, line: 14 }, + end: { column: 3, line: 14 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [275, 276], + loc: { + start: { column: 3, line: 14 }, + end: { column: 4, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [276, 277], + loc: { + start: { column: 4, line: 14 }, + end: { column: 5, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [277, 278], + loc: { + start: { column: 5, line: 14 }, + end: { column: 6, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [278, 279], + loc: { + start: { column: 6, line: 14 }, + end: { column: 7, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [280, 286], + loc: { + start: { column: 8, line: 14 }, + end: { column: 14, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [286, 287], + loc: { + start: { column: 14, line: 14 }, + end: { column: 15, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [288, 289], + loc: { + start: { column: 0, line: 15 }, + end: { column: 1, line: 15 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..f8fd559f9844 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/3-Babel-AST.shot @@ -0,0 +1,433 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "computed", + + range: [79, 87], + loc: { + start: { column: 6, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + init: Literal { + type: "Literal", + raw: "'buzz'", + value: "buzz", + + range: [90, 96], + loc: { + start: { column: 17, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [79, 96], + loc: { + start: { column: 6, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + kind: "const", + + range: [73, 97], + loc: { + start: { column: 0, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "computed2", + + range: [104, 113], + loc: { + start: { column: 6, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + init: Literal { + type: "Literal", + raw: "'bazz'", + value: "bazz", + + range: [116, 122], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [104, 122], + loc: { + start: { column: 6, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + ], + kind: "const", + + range: [98, 123], + loc: { + start: { column: 0, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [138, 141], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + optional: true, + static: false, + value: null, + + range: [138, 143], + loc: { + start: { column: 2, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [146, 149], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + optional: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [152, 158], + loc: { + start: { column: 8, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + + range: [150, 158], + loc: { + start: { column: 6, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + value: null, + + range: [146, 159], + loc: { + start: { column: 2, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + accessibility: "private", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [170, 173], + loc: { + start: { column: 10, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + optional: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [176, 182], + loc: { + start: { column: 16, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [174, 182], + loc: { + start: { column: 14, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + value: null, + + range: [162, 183], + loc: { + start: { column: 2, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + key: Identifier { + type: "Identifier", + name: "computed", + + range: [187, 195], + loc: { + start: { column: 3, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + optional: true, + static: false, + value: null, + + range: [186, 198], + loc: { + start: { column: 2, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + key: Literal { + type: "Literal", + raw: "'literal'", + value: "literal", + + range: [202, 211], + loc: { + start: { column: 3, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + optional: true, + static: false, + value: null, + + range: [201, 214], + loc: { + start: { column: 2, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + key: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [218, 219], + loc: { + start: { column: 3, line: 11 }, + end: { column: 4, line: 11 }, + }, + }, + optional: true, + static: false, + value: null, + + range: [217, 222], + loc: { + start: { column: 2, line: 11 }, + end: { column: 7, line: 11 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + key: Identifier { + type: "Identifier", + name: "computed2", + + range: [226, 235], + loc: { + start: { column: 3, line: 12 }, + end: { column: 12, line: 12 }, + }, + }, + optional: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [239, 245], + loc: { + start: { column: 16, line: 12 }, + end: { column: 22, line: 12 }, + }, + }, + + range: [237, 245], + loc: { + start: { column: 14, line: 12 }, + end: { column: 22, line: 12 }, + }, + }, + value: null, + + range: [225, 246], + loc: { + start: { column: 2, line: 12 }, + end: { column: 23, line: 12 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + key: Literal { + type: "Literal", + raw: "'literal2'", + value: "literal2", + + range: [250, 260], + loc: { + start: { column: 3, line: 13 }, + end: { column: 13, line: 13 }, + }, + }, + optional: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [264, 270], + loc: { + start: { column: 17, line: 13 }, + end: { column: 23, line: 13 }, + }, + }, + + range: [262, 270], + loc: { + start: { column: 15, line: 13 }, + end: { column: 23, line: 13 }, + }, + }, + value: null, + + range: [249, 271], + loc: { + start: { column: 2, line: 13 }, + end: { column: 24, line: 13 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: true, + key: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [275, 276], + loc: { + start: { column: 3, line: 14 }, + end: { column: 4, line: 14 }, + }, + }, + optional: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [280, 286], + loc: { + start: { column: 8, line: 14 }, + end: { column: 14, line: 14 }, + }, + }, + + range: [278, 286], + loc: { + start: { column: 6, line: 14 }, + end: { column: 14, line: 14 }, + }, + }, + value: null, + + range: [274, 287], + loc: { + start: { column: 2, line: 14 }, + end: { column: 15, line: 14 }, + }, + }, + ], + + range: [134, 289], + loc: { + start: { column: 10, line: 5 }, + end: { column: 1, line: 15 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [130, 133], + loc: { + start: { column: 6, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + superClass: null, + + range: [124, 289], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 15 }, + }, + }, + ], + sourceType: "script", + + range: [73, 290], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 16 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..62dfc7488724 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,646 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "const", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "computed", + + range: [79, 87], + loc: { + start: { column: 6, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + String { + type: "String", + value: "'buzz'", + + range: [90, 96], + loc: { + start: { column: 17, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [98, 103], + loc: { + start: { column: 0, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "computed2", + + range: [104, 113], + loc: { + start: { column: 6, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [114, 115], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + String { + type: "String", + value: "'bazz'", + + range: [116, 122], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [122, 123], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [124, 129], + loc: { + start: { column: 0, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [130, 133], + loc: { + start: { column: 6, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [134, 135], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [138, 141], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [141, 142], + loc: { + start: { column: 5, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [142, 143], + loc: { + start: { column: 6, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [146, 149], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [149, 150], + loc: { + start: { column: 5, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [150, 151], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [152, 158], + loc: { + start: { column: 8, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [158, 159], + loc: { + start: { column: 14, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "private", + + range: [162, 169], + loc: { + start: { column: 2, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [170, 173], + loc: { + start: { column: 10, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [173, 174], + loc: { + start: { column: 13, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [174, 175], + loc: { + start: { column: 14, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [176, 182], + loc: { + start: { column: 16, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [182, 183], + loc: { + start: { column: 22, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [186, 187], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "computed", + + range: [187, 195], + loc: { + start: { column: 3, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [195, 196], + loc: { + start: { column: 11, line: 9 }, + end: { column: 12, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [196, 197], + loc: { + start: { column: 12, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [197, 198], + loc: { + start: { column: 13, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [201, 202], + loc: { + start: { column: 2, line: 10 }, + end: { column: 3, line: 10 }, + }, + }, + String { + type: "String", + value: "'literal'", + + range: [202, 211], + loc: { + start: { column: 3, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [211, 212], + loc: { + start: { column: 12, line: 10 }, + end: { column: 13, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [212, 213], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [213, 214], + loc: { + start: { column: 14, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [217, 218], + loc: { + start: { column: 2, line: 11 }, + end: { column: 3, line: 11 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [218, 219], + loc: { + start: { column: 3, line: 11 }, + end: { column: 4, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [219, 220], + loc: { + start: { column: 4, line: 11 }, + end: { column: 5, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [220, 221], + loc: { + start: { column: 5, line: 11 }, + end: { column: 6, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [221, 222], + loc: { + start: { column: 6, line: 11 }, + end: { column: 7, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [225, 226], + loc: { + start: { column: 2, line: 12 }, + end: { column: 3, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + value: "computed2", + + range: [226, 235], + loc: { + start: { column: 3, line: 12 }, + end: { column: 12, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [235, 236], + loc: { + start: { column: 12, line: 12 }, + end: { column: 13, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [236, 237], + loc: { + start: { column: 13, line: 12 }, + end: { column: 14, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [237, 238], + loc: { + start: { column: 14, line: 12 }, + end: { column: 15, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [239, 245], + loc: { + start: { column: 16, line: 12 }, + end: { column: 22, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [245, 246], + loc: { + start: { column: 22, line: 12 }, + end: { column: 23, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [249, 250], + loc: { + start: { column: 2, line: 13 }, + end: { column: 3, line: 13 }, + }, + }, + String { + type: "String", + value: "'literal2'", + + range: [250, 260], + loc: { + start: { column: 3, line: 13 }, + end: { column: 13, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [260, 261], + loc: { + start: { column: 13, line: 13 }, + end: { column: 14, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [261, 262], + loc: { + start: { column: 14, line: 13 }, + end: { column: 15, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [262, 263], + loc: { + start: { column: 15, line: 13 }, + end: { column: 16, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [264, 270], + loc: { + start: { column: 17, line: 13 }, + end: { column: 23, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [270, 271], + loc: { + start: { column: 23, line: 13 }, + end: { column: 24, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [274, 275], + loc: { + start: { column: 2, line: 14 }, + end: { column: 3, line: 14 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [275, 276], + loc: { + start: { column: 3, line: 14 }, + end: { column: 4, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [276, 277], + loc: { + start: { column: 4, line: 14 }, + end: { column: 5, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [277, 278], + loc: { + start: { column: 5, line: 14 }, + end: { column: 6, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [278, 279], + loc: { + start: { column: 6, line: 14 }, + end: { column: 7, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [280, 286], + loc: { + start: { column: 8, line: 14 }, + end: { column: 14, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [286, 287], + loc: { + start: { column: 14, line: 14 }, + end: { column: 15, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [288, 289], + loc: { + start: { column: 0, line: 15 }, + end: { column: 1, line: 15 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..12a4a2288c9e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,455 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'computed', + + range: [79, 87], + loc: { + start: { column: 6, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '\\\\'buzz\\\\'', + value: 'buzz', + + range: [90, 96], + loc: { + start: { column: 17, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [79, 96], + loc: { + start: { column: 6, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + kind: 'const', + + range: [73, 97], + loc: { + start: { column: 0, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'computed2', + + range: [104, 113], + loc: { + start: { column: 6, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '\\\\'bazz\\\\'', + value: 'bazz', + + range: [116, 122], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [104, 122], + loc: { + start: { column: 6, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + ], + kind: 'const', + + range: [98, 123], + loc: { + start: { column: 0, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'foo', + + range: [138, 141], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + optional: true, +- override: false, + static: false, + value: null, + + range: [138, 143], + loc: { + start: { column: 2, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'bar', + + range: [146, 149], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + optional: true, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [152, 158], + loc: { + start: { column: 8, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + + range: [150, 158], + loc: { + start: { column: 6, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + value: null, + + range: [146, 159], + loc: { + start: { column: 2, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + accessibility: 'private', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'baz', + + range: [170, 173], + loc: { + start: { column: 10, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + optional: true, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [176, 182], + loc: { + start: { column: 16, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [174, 182], + loc: { + start: { column: 14, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + value: null, + + range: [162, 183], + loc: { + start: { column: 2, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: true, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'computed', + + range: [187, 195], + loc: { + start: { column: 3, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + optional: true, +- override: false, + static: false, + value: null, + + range: [186, 198], + loc: { + start: { column: 2, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: true, +- declare: false, + key: Literal { + type: 'Literal', + raw: '\\\\'literal\\\\'', + value: 'literal', + + range: [202, 211], + loc: { + start: { column: 3, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + optional: true, +- override: false, + static: false, + value: null, + + range: [201, 214], + loc: { + start: { column: 2, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: true, +- declare: false, + key: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [218, 219], + loc: { + start: { column: 3, line: 11 }, + end: { column: 4, line: 11 }, + }, + }, + optional: true, +- override: false, + static: false, + value: null, + + range: [217, 222], + loc: { + start: { column: 2, line: 11 }, + end: { column: 7, line: 11 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: true, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'computed2', + + range: [226, 235], + loc: { + start: { column: 3, line: 12 }, + end: { column: 12, line: 12 }, + }, + }, + optional: true, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [239, 245], + loc: { + start: { column: 16, line: 12 }, + end: { column: 22, line: 12 }, + }, + }, + + range: [237, 245], + loc: { + start: { column: 14, line: 12 }, + end: { column: 22, line: 12 }, + }, + }, + value: null, + + range: [225, 246], + loc: { + start: { column: 2, line: 12 }, + end: { column: 23, line: 12 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: true, +- declare: false, + key: Literal { + type: 'Literal', + raw: '\\\\'literal2\\\\'', + value: 'literal2', + + range: [250, 260], + loc: { + start: { column: 3, line: 13 }, + end: { column: 13, line: 13 }, + }, + }, + optional: true, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [264, 270], + loc: { + start: { column: 17, line: 13 }, + end: { column: 23, line: 13 }, + }, + }, + + range: [262, 270], + loc: { + start: { column: 15, line: 13 }, + end: { column: 23, line: 13 }, + }, + }, + value: null, + + range: [249, 271], + loc: { + start: { column: 2, line: 13 }, + end: { column: 24, line: 13 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: true, +- declare: false, + key: Literal { + type: 'Literal', + raw: '2', + value: 2, + + range: [275, 276], + loc: { + start: { column: 3, line: 14 }, + end: { column: 4, line: 14 }, + }, + }, + optional: true, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [280, 286], + loc: { + start: { column: 8, line: 14 }, + end: { column: 14, line: 14 }, + }, + }, + + range: [278, 286], + loc: { + start: { column: 6, line: 14 }, + end: { column: 14, line: 14 }, + }, + }, + value: null, + + range: [274, 287], + loc: { + start: { column: 2, line: 14 }, + end: { column: 15, line: 14 }, + }, + }, + ], + + range: [134, 289], + loc: { + start: { column: 10, line: 5 }, + end: { column: 1, line: 15 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [130, 133], + loc: { + start: { column: 6, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + superClass: null, + + range: [124, 289], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 15 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 290], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 16 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..d45dfc7be1ad --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,652 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'const', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'computed', + + range: [79, 87], + loc: { + start: { column: 6, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + String { + type: 'String', + value: '\\\\'buzz\\\\'', + + range: [90, 96], + loc: { + start: { column: 17, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [98, 103], + loc: { + start: { column: 0, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'computed2', + + range: [104, 113], + loc: { + start: { column: 6, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [114, 115], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + String { + type: 'String', + value: '\\\\'bazz\\\\'', + + range: [116, 122], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [122, 123], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'class', + + range: [124, 129], + loc: { + start: { column: 0, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [130, 133], + loc: { + start: { column: 6, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [134, 135], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'foo', + + range: [138, 141], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [141, 142], + loc: { + start: { column: 5, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [142, 143], + loc: { + start: { column: 6, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar', + + range: [146, 149], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [149, 150], + loc: { + start: { column: 5, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [150, 151], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [152, 158], + loc: { + start: { column: 8, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [158, 159], + loc: { + start: { column: 14, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'private', + + range: [162, 169], + loc: { + start: { column: 2, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'baz', + + range: [170, 173], + loc: { + start: { column: 10, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [173, 174], + loc: { + start: { column: 13, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [174, 175], + loc: { + start: { column: 14, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [176, 182], + loc: { + start: { column: 16, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [182, 183], + loc: { + start: { column: 22, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [186, 187], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'computed', + + range: [187, 195], + loc: { + start: { column: 3, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [195, 196], + loc: { + start: { column: 11, line: 9 }, + end: { column: 12, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [196, 197], + loc: { + start: { column: 12, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [197, 198], + loc: { + start: { column: 13, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [201, 202], + loc: { + start: { column: 2, line: 10 }, + end: { column: 3, line: 10 }, + }, + }, + String { + type: 'String', + value: '\\\\'literal\\\\'', + + range: [202, 211], + loc: { + start: { column: 3, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [211, 212], + loc: { + start: { column: 12, line: 10 }, + end: { column: 13, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [212, 213], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [213, 214], + loc: { + start: { column: 14, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [217, 218], + loc: { + start: { column: 2, line: 11 }, + end: { column: 3, line: 11 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [218, 219], + loc: { + start: { column: 3, line: 11 }, + end: { column: 4, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [219, 220], + loc: { + start: { column: 4, line: 11 }, + end: { column: 5, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [220, 221], + loc: { + start: { column: 5, line: 11 }, + end: { column: 6, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [221, 222], + loc: { + start: { column: 6, line: 11 }, + end: { column: 7, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [225, 226], + loc: { + start: { column: 2, line: 12 }, + end: { column: 3, line: 12 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'computed2', + + range: [226, 235], + loc: { + start: { column: 3, line: 12 }, + end: { column: 12, line: 12 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [235, 236], + loc: { + start: { column: 12, line: 12 }, + end: { column: 13, line: 12 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [236, 237], + loc: { + start: { column: 13, line: 12 }, + end: { column: 14, line: 12 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [237, 238], + loc: { + start: { column: 14, line: 12 }, + end: { column: 15, line: 12 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [239, 245], + loc: { + start: { column: 16, line: 12 }, + end: { column: 22, line: 12 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [245, 246], + loc: { + start: { column: 22, line: 12 }, + end: { column: 23, line: 12 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [249, 250], + loc: { + start: { column: 2, line: 13 }, + end: { column: 3, line: 13 }, + }, + }, + String { + type: 'String', + value: '\\\\'literal2\\\\'', + + range: [250, 260], + loc: { + start: { column: 3, line: 13 }, + end: { column: 13, line: 13 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [260, 261], + loc: { + start: { column: 13, line: 13 }, + end: { column: 14, line: 13 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [261, 262], + loc: { + start: { column: 14, line: 13 }, + end: { column: 15, line: 13 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [262, 263], + loc: { + start: { column: 15, line: 13 }, + end: { column: 16, line: 13 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [264, 270], + loc: { + start: { column: 17, line: 13 }, + end: { column: 23, line: 13 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [270, 271], + loc: { + start: { column: 23, line: 13 }, + end: { column: 24, line: 13 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [274, 275], + loc: { + start: { column: 2, line: 14 }, + end: { column: 3, line: 14 }, + }, + }, + Numeric { + type: 'Numeric', + value: '2', + + range: [275, 276], + loc: { + start: { column: 3, line: 14 }, + end: { column: 4, line: 14 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [276, 277], + loc: { + start: { column: 4, line: 14 }, + end: { column: 5, line: 14 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [277, 278], + loc: { + start: { column: 5, line: 14 }, + end: { column: 6, line: 14 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [278, 279], + loc: { + start: { column: 6, line: 14 }, + end: { column: 7, line: 14 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [280, 286], + loc: { + start: { column: 8, line: 14 }, + end: { column: 14, line: 14 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [286, 287], + loc: { + start: { column: 14, line: 14 }, + end: { column: 15, line: 14 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [288, 289], + loc: { + start: { column: 0, line: 15 }, + end: { column: 1, line: 15 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/fixture.ts new file mode 100644 index 000000000000..8f44b492521d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class X { + private foo? = undefined; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..cf99a1d0ba5b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,82 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-property-undefined TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + accessibility: "private", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [93, 96], + loc: { + start: { column: 10, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + optional: true, + override: false, + static: false, + value: Identifier { + type: "Identifier", + name: "undefined", + + range: [100, 109], + loc: { + start: { column: 17, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + + range: [85, 110], + loc: { + start: { column: 2, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + ], + + range: [81, 112], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "X", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..3cd5819e3828 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-property-undefined TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "private", + + range: [85, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [93, 96], + loc: { + start: { column: 10, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [96, 97], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [98, 99], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "undefined", + + range: [100, 109], + loc: { + start: { column: 17, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [109, 110], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [111, 112], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..4dd7a48b6bc9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/3-Babel-AST.shot @@ -0,0 +1,80 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-property-undefined Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + accessibility: "private", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [93, 96], + loc: { + start: { column: 10, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + optional: true, + static: false, + value: Identifier { + type: "Identifier", + name: "undefined", + + range: [100, 109], + loc: { + start: { column: 17, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + + range: [85, 110], + loc: { + start: { column: 2, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + ], + + range: [81, 112], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "X", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..8f58ab3d0add --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-property-undefined Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "private", + + range: [85, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [93, 96], + loc: { + start: { column: 10, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [96, 97], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [98, 99], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "undefined", + + range: [100, 109], + loc: { + start: { column: 17, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [109, 110], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [111, 112], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..bf276da33e3e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-property-undefined AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + accessibility: 'private', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'foo', + + range: [93, 96], + loc: { + start: { column: 10, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + optional: true, +- override: false, + static: false, + value: Identifier { + type: 'Identifier', + name: 'undefined', + + range: [100, 109], + loc: { + start: { column: 17, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + + range: [85, 110], + loc: { + start: { column: 2, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + ], + + range: [81, 112], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'X', + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..5252f6a95e43 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,112 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-optional-property-undefined AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'X', + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'private', + + range: [85, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'foo', + + range: [93, 96], + loc: { + start: { column: 10, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [96, 97], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [98, 99], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'undefined', + + range: [100, 109], + loc: { + start: { column: 17, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [109, 110], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [111, 112], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/fixture.ts new file mode 100644 index 000000000000..603bfdff05da --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/fixture.ts @@ -0,0 +1,7 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class SpecializedComponent extends SomeComponent { + override show() { + // ... + } +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..2d3330021e78 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,103 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-override-method TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "show", + + range: [135, 139], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + kind: "method", + override: true, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [142, 158], + loc: { + start: { column: 18, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [139, 158], + loc: { + start: { column: 15, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [126, 158], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + ], + + range: [122, 160], + loc: { + start: { column: 49, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "SpecializedComponent", + + range: [79, 99], + loc: { + start: { column: 6, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "SomeComponent", + + range: [108, 121], + loc: { + start: { column: 35, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + + range: [73, 160], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 161], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..f1a7bc7261c4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-override-method TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "SpecializedComponent", + + range: [79, 99], + loc: { + start: { column: 6, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [100, 107], + loc: { + start: { column: 27, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "SomeComponent", + + range: [108, 121], + loc: { + start: { column: 35, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [122, 123], + loc: { + start: { column: 49, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "override", + + range: [126, 134], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "show", + + range: [135, 139], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [139, 140], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [140, 141], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [142, 143], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [157, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [159, 160], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..0bed820fe9bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/3-Babel-AST.shot @@ -0,0 +1,103 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-override-method Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "show", + + range: [135, 139], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + kind: "method", + override: true, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [142, 158], + loc: { + start: { column: 18, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [139, 158], + loc: { + start: { column: 15, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [126, 158], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + ], + + range: [122, 160], + loc: { + start: { column: 49, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "SpecializedComponent", + + range: [79, 99], + loc: { + start: { column: 6, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "SomeComponent", + + range: [108, 121], + loc: { + start: { column: 35, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + + range: [73, 160], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 161], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..9264f2956366 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-override-method Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "SpecializedComponent", + + range: [79, 99], + loc: { + start: { column: 6, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [100, 107], + loc: { + start: { column: 27, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "SomeComponent", + + range: [108, 121], + loc: { + start: { column: 35, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [122, 123], + loc: { + start: { column: 49, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "override", + + range: [126, 134], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "show", + + range: [135, 139], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [139, 140], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [140, 141], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [142, 143], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [157, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [159, 160], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..6d916c72d855 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-override-method AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..e01bbc6b58c9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-override-method AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/fixture.ts new file mode 100644 index 000000000000..1f6689d16a19 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class SpecializedComponent extends SomeComponent { + override foo = 1; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..38719494d527 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,90 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-override-property TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [135, 138], + loc: { + start: { column: 11, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + override: true, + static: false, + value: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [141, 142], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [126, 143], + loc: { + start: { column: 2, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + ], + + range: [122, 145], + loc: { + start: { column: 49, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "SpecializedComponent", + + range: [79, 99], + loc: { + start: { column: 6, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "SomeComponent", + + range: [108, 121], + loc: { + start: { column: 35, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + + range: [73, 145], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 146], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..ade6e1d26445 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-override-property TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "SpecializedComponent", + + range: [79, 99], + loc: { + start: { column: 6, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [100, 107], + loc: { + start: { column: 27, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "SomeComponent", + + range: [108, 121], + loc: { + start: { column: 35, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [122, 123], + loc: { + start: { column: 49, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "override", + + range: [126, 134], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [135, 138], + loc: { + start: { column: 11, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [139, 140], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [141, 142], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [142, 143], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [144, 145], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..3e2b08e1510c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/3-Babel-AST.shot @@ -0,0 +1,89 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-override-property Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [135, 138], + loc: { + start: { column: 11, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + override: true, + static: false, + value: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [141, 142], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [126, 143], + loc: { + start: { column: 2, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + ], + + range: [122, 145], + loc: { + start: { column: 49, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "SpecializedComponent", + + range: [79, 99], + loc: { + start: { column: 6, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "SomeComponent", + + range: [108, 121], + loc: { + start: { column: 35, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + + range: [73, 145], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 146], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..1ef96afa3e5e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-override-property Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "SpecializedComponent", + + range: [79, 99], + loc: { + start: { column: 6, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [100, 107], + loc: { + start: { column: 27, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "SomeComponent", + + range: [108, 121], + loc: { + start: { column: 35, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [122, 123], + loc: { + start: { column: 49, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "override", + + range: [126, 134], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [135, 138], + loc: { + start: { column: 11, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [139, 140], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [141, 142], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [142, 143], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [144, 145], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..644f6e34e871 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,94 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-override-property AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'foo', + + range: [135, 138], + loc: { + start: { column: 11, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + override: true, + static: false, + value: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [141, 142], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [126, 143], + loc: { + start: { column: 2, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + ], + + range: [122, 145], + loc: { + start: { column: 49, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'SpecializedComponent', + + range: [79, 99], + loc: { + start: { column: 6, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + superClass: Identifier { + type: 'Identifier', + name: 'SomeComponent', + + range: [108, 121], + loc: { + start: { column: 35, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + + range: [73, 145], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 146], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..5a19cb9cd5c2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-override-property AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/fixture.ts new file mode 100644 index 000000000000..6cf6e1526fd6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/fixture.ts @@ -0,0 +1,7 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + #prop?: string; + #propExplicitWithValue?: string = ''; + #propImplicitWithValue? = ''; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..c6c2cfcc51b7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,178 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-private-optional-property TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + key: PrivateIdentifier { + type: "PrivateIdentifier", + name: "prop", + + range: [87, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + optional: true, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [95, 101], + loc: { + start: { column: 10, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [93, 101], + loc: { + start: { column: 8, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + value: null, + + range: [87, 102], + loc: { + start: { column: 2, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + key: PrivateIdentifier { + type: "PrivateIdentifier", + name: "propExplicitWithValue", + + range: [105, 127], + loc: { + start: { column: 2, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + optional: true, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [130, 136], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + + range: [128, 136], + loc: { + start: { column: 25, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + value: Literal { + type: "Literal", + raw: "''", + value: "", + + range: [139, 141], + loc: { + start: { column: 36, line: 5 }, + end: { column: 38, line: 5 }, + }, + }, + + range: [105, 142], + loc: { + start: { column: 2, line: 5 }, + end: { column: 39, line: 5 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + key: PrivateIdentifier { + type: "PrivateIdentifier", + name: "propImplicitWithValue", + + range: [145, 167], + loc: { + start: { column: 2, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + optional: true, + override: false, + static: false, + value: Literal { + type: "Literal", + raw: "''", + value: "", + + range: [171, 173], + loc: { + start: { column: 28, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + + range: [145, 174], + loc: { + start: { column: 2, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + ], + + range: [83, 176], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 176], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 177], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..b5f775eb21b8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,216 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-private-optional-property TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "#prop", + + range: [87, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [92, 93], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [93, 94], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [95, 101], + loc: { + start: { column: 10, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [101, 102], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "#propExplicitWithValue", + + range: [105, 127], + loc: { + start: { column: 2, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [127, 128], + loc: { + start: { column: 24, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [128, 129], + loc: { + start: { column: 25, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [130, 136], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [137, 138], + loc: { + start: { column: 34, line: 5 }, + end: { column: 35, line: 5 }, + }, + }, + String { + type: "String", + value: "''", + + range: [139, 141], + loc: { + start: { column: 36, line: 5 }, + end: { column: 38, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [141, 142], + loc: { + start: { column: 38, line: 5 }, + end: { column: 39, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "#propImplicitWithValue", + + range: [145, 167], + loc: { + start: { column: 2, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [167, 168], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [169, 170], + loc: { + start: { column: 26, line: 6 }, + end: { column: 27, line: 6 }, + }, + }, + String { + type: "String", + value: "''", + + range: [171, 173], + loc: { + start: { column: 28, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [173, 174], + loc: { + start: { column: 30, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [175, 176], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..50dd62a7ed81 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/3-Babel-AST.shot @@ -0,0 +1,172 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-private-optional-property Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + key: PrivateIdentifier { + type: "PrivateIdentifier", + name: "prop", + + range: [87, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + optional: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [95, 101], + loc: { + start: { column: 10, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [93, 101], + loc: { + start: { column: 8, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + value: null, + + range: [87, 102], + loc: { + start: { column: 2, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + key: PrivateIdentifier { + type: "PrivateIdentifier", + name: "propExplicitWithValue", + + range: [105, 127], + loc: { + start: { column: 2, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + optional: true, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [130, 136], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + + range: [128, 136], + loc: { + start: { column: 25, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + value: Literal { + type: "Literal", + raw: "''", + value: "", + + range: [139, 141], + loc: { + start: { column: 36, line: 5 }, + end: { column: 38, line: 5 }, + }, + }, + + range: [105, 142], + loc: { + start: { column: 2, line: 5 }, + end: { column: 39, line: 5 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + key: PrivateIdentifier { + type: "PrivateIdentifier", + name: "propImplicitWithValue", + + range: [145, 167], + loc: { + start: { column: 2, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + optional: true, + static: false, + value: Literal { + type: "Literal", + raw: "''", + value: "", + + range: [171, 173], + loc: { + start: { column: 28, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + + range: [145, 174], + loc: { + start: { column: 2, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + ], + + range: [83, 176], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 176], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 177], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..0d555a483736 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,216 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-private-optional-property Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + PrivateIdentifier { + type: "PrivateIdentifier", + value: "prop", + + range: [87, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [92, 93], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [93, 94], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [95, 101], + loc: { + start: { column: 10, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [101, 102], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + PrivateIdentifier { + type: "PrivateIdentifier", + value: "propExplicitWithValue", + + range: [105, 127], + loc: { + start: { column: 2, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [127, 128], + loc: { + start: { column: 24, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [128, 129], + loc: { + start: { column: 25, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [130, 136], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [137, 138], + loc: { + start: { column: 34, line: 5 }, + end: { column: 35, line: 5 }, + }, + }, + String { + type: "String", + value: "''", + + range: [139, 141], + loc: { + start: { column: 36, line: 5 }, + end: { column: 38, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [141, 142], + loc: { + start: { column: 38, line: 5 }, + end: { column: 39, line: 5 }, + }, + }, + PrivateIdentifier { + type: "PrivateIdentifier", + value: "propImplicitWithValue", + + range: [145, 167], + loc: { + start: { column: 2, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [167, 168], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [169, 170], + loc: { + start: { column: 26, line: 6 }, + end: { column: 27, line: 6 }, + }, + }, + String { + type: "String", + value: "''", + + range: [171, 173], + loc: { + start: { column: 28, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [173, 174], + loc: { + start: { column: 30, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [175, 176], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..a6626a650842 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,182 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-private-optional-property AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + key: PrivateIdentifier { + type: 'PrivateIdentifier', + name: 'prop', + + range: [87, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + optional: true, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [95, 101], + loc: { + start: { column: 10, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [93, 101], + loc: { + start: { column: 8, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + value: null, + + range: [87, 102], + loc: { + start: { column: 2, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + key: PrivateIdentifier { + type: 'PrivateIdentifier', + name: 'propExplicitWithValue', + + range: [105, 127], + loc: { + start: { column: 2, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + optional: true, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [130, 136], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + + range: [128, 136], + loc: { + start: { column: 25, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + value: Literal { + type: 'Literal', + raw: '\\\\'\\\\'', + value: '', + + range: [139, 141], + loc: { + start: { column: 36, line: 5 }, + end: { column: 38, line: 5 }, + }, + }, + + range: [105, 142], + loc: { + start: { column: 2, line: 5 }, + end: { column: 39, line: 5 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + key: PrivateIdentifier { + type: 'PrivateIdentifier', + name: 'propImplicitWithValue', + + range: [145, 167], + loc: { + start: { column: 2, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + optional: true, +- override: false, + static: false, + value: Literal { + type: 'Literal', + raw: '\\\\'\\\\'', + value: '', + + range: [171, 173], + loc: { + start: { column: 28, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + + range: [145, 174], + loc: { + start: { column: 2, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + ], + + range: [83, 176], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 176], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 177], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..1409ad0e303e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,229 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-private-optional-property AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, +- Identifier { +- type: 'Identifier', +- value: '#prop', ++ PrivateIdentifier { ++ type: 'PrivateIdentifier', ++ value: 'prop', + + range: [87, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [92, 93], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [93, 94], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [95, 101], + loc: { + start: { column: 10, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [101, 102], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, +- Identifier { +- type: 'Identifier', +- value: '#propExplicitWithValue', ++ PrivateIdentifier { ++ type: 'PrivateIdentifier', ++ value: 'propExplicitWithValue', + + range: [105, 127], + loc: { + start: { column: 2, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [127, 128], + loc: { + start: { column: 24, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [128, 129], + loc: { + start: { column: 25, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [130, 136], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [137, 138], + loc: { + start: { column: 34, line: 5 }, + end: { column: 35, line: 5 }, + }, + }, + String { + type: 'String', + value: '\\\\'\\\\'', + + range: [139, 141], + loc: { + start: { column: 36, line: 5 }, + end: { column: 38, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [141, 142], + loc: { + start: { column: 38, line: 5 }, + end: { column: 39, line: 5 }, + }, + }, +- Identifier { +- type: 'Identifier', +- value: '#propImplicitWithValue', ++ PrivateIdentifier { ++ type: 'PrivateIdentifier', ++ value: 'propImplicitWithValue', + + range: [145, 167], + loc: { + start: { column: 2, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [167, 168], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [169, 170], + loc: { + start: { column: 26, line: 6 }, + end: { column: 27, line: 6 }, + }, + }, + String { + type: 'String', + value: '\\\\'\\\\'', + + range: [171, 173], + loc: { + start: { column: 28, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [173, 174], + loc: { + start: { column: 30, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [175, 176], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/fixture.ts new file mode 100644 index 000000000000..8884383e87a6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/fixture.ts @@ -0,0 +1,10 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + constructor( + private firstName: string, + private readonly lastName: string, + private age: number = 30, + private readonly student: boolean = false, + ) {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..fb43fe5900ed --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,289 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-private-parameter-properties TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [87, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: "constructor", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [251, 253], + loc: { + start: { column: 4, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "private", + parameter: Identifier { + type: "Identifier", + name: "firstName", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [123, 129], + loc: { + start: { column: 23, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + + range: [121, 129], + loc: { + start: { column: 21, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + + range: [112, 129], + loc: { + start: { column: 12, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + + range: [104, 129], + loc: { + start: { column: 4, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "private", + parameter: Identifier { + type: "Identifier", + name: "lastName", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [162, 168], + loc: { + start: { column: 31, line: 6 }, + end: { column: 37, line: 6 }, + }, + }, + + range: [160, 168], + loc: { + start: { column: 29, line: 6 }, + end: { column: 37, line: 6 }, + }, + }, + + range: [152, 168], + loc: { + start: { column: 21, line: 6 }, + end: { column: 37, line: 6 }, + }, + }, + readonly: true, + + range: [135, 168], + loc: { + start: { column: 4, line: 6 }, + end: { column: 37, line: 6 }, + }, + }, + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "private", + parameter: AssignmentPattern { + type: "AssignmentPattern", + left: Identifier { + type: "Identifier", + name: "age", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [187, 193], + loc: { + start: { column: 17, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + + range: [185, 193], + loc: { + start: { column: 15, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + + range: [182, 193], + loc: { + start: { column: 12, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + right: Literal { + type: "Literal", + raw: "30", + value: 30, + + range: [196, 198], + loc: { + start: { column: 26, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + + range: [182, 198], + loc: { + start: { column: 12, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + + range: [174, 198], + loc: { + start: { column: 4, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "private", + parameter: AssignmentPattern { + type: "AssignmentPattern", + left: Identifier { + type: "Identifier", + name: "student", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [230, 237], + loc: { + start: { column: 30, line: 8 }, + end: { column: 37, line: 8 }, + }, + }, + + range: [228, 237], + loc: { + start: { column: 28, line: 8 }, + end: { column: 37, line: 8 }, + }, + }, + + range: [221, 237], + loc: { + start: { column: 21, line: 8 }, + end: { column: 37, line: 8 }, + }, + }, + right: Literal { + type: "Literal", + raw: "false", + value: false, + + range: [240, 245], + loc: { + start: { column: 40, line: 8 }, + end: { column: 45, line: 8 }, + }, + }, + + range: [221, 245], + loc: { + start: { column: 21, line: 8 }, + end: { column: 45, line: 8 }, + }, + }, + readonly: true, + + range: [204, 245], + loc: { + start: { column: 4, line: 8 }, + end: { column: 45, line: 8 }, + }, + }, + ], + + range: [98, 253], + loc: { + start: { column: 13, line: 4 }, + end: { column: 6, line: 9 }, + }, + }, + + range: [87, 253], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 9 }, + }, + }, + ], + + range: [83, 255], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 255], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 256], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..198c29e2f3d2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,356 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-private-parameter-properties TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [87, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [98, 99], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "private", + + range: [104, 111], + loc: { + start: { column: 4, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "firstName", + + range: [112, 121], + loc: { + start: { column: 12, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [121, 122], + loc: { + start: { column: 21, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [123, 129], + loc: { + start: { column: 23, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [129, 130], + loc: { + start: { column: 29, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "private", + + range: [135, 142], + loc: { + start: { column: 4, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [143, 151], + loc: { + start: { column: 12, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "lastName", + + range: [152, 160], + loc: { + start: { column: 21, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [160, 161], + loc: { + start: { column: 29, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [162, 168], + loc: { + start: { column: 31, line: 6 }, + end: { column: 37, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [168, 169], + loc: { + start: { column: 37, line: 6 }, + end: { column: 38, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "private", + + range: [174, 181], + loc: { + start: { column: 4, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "age", + + range: [182, 185], + loc: { + start: { column: 12, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [185, 186], + loc: { + start: { column: 15, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [187, 193], + loc: { + start: { column: 17, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [194, 195], + loc: { + start: { column: 24, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + Numeric { + type: "Numeric", + value: "30", + + range: [196, 198], + loc: { + start: { column: 26, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [198, 199], + loc: { + start: { column: 28, line: 7 }, + end: { column: 29, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "private", + + range: [204, 211], + loc: { + start: { column: 4, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [212, 220], + loc: { + start: { column: 12, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "student", + + range: [221, 228], + loc: { + start: { column: 21, line: 8 }, + end: { column: 28, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [228, 229], + loc: { + start: { column: 28, line: 8 }, + end: { column: 29, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [230, 237], + loc: { + start: { column: 30, line: 8 }, + end: { column: 37, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [238, 239], + loc: { + start: { column: 38, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + Boolean { + type: "Boolean", + value: "false", + + range: [240, 245], + loc: { + start: { column: 40, line: 8 }, + end: { column: 45, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [245, 246], + loc: { + start: { column: 45, line: 8 }, + end: { column: 46, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [249, 250], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [251, 252], + loc: { + start: { column: 4, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [252, 253], + loc: { + start: { column: 5, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [254, 255], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..b6dff80a0b25 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/3-Babel-AST.shot @@ -0,0 +1,288 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-private-parameter-properties Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [87, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: "constructor", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [251, 253], + loc: { + start: { column: 4, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "private", + parameter: Identifier { + type: "Identifier", + name: "firstName", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [123, 129], + loc: { + start: { column: 23, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + + range: [121, 129], + loc: { + start: { column: 21, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + + range: [112, 129], + loc: { + start: { column: 12, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + + range: [104, 129], + loc: { + start: { column: 4, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "private", + parameter: Identifier { + type: "Identifier", + name: "lastName", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [162, 168], + loc: { + start: { column: 31, line: 6 }, + end: { column: 37, line: 6 }, + }, + }, + + range: [160, 168], + loc: { + start: { column: 29, line: 6 }, + end: { column: 37, line: 6 }, + }, + }, + + range: [152, 168], + loc: { + start: { column: 21, line: 6 }, + end: { column: 37, line: 6 }, + }, + }, + readonly: true, + + range: [135, 168], + loc: { + start: { column: 4, line: 6 }, + end: { column: 37, line: 6 }, + }, + }, + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "private", + parameter: AssignmentPattern { + type: "AssignmentPattern", + left: Identifier { + type: "Identifier", + name: "age", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [187, 193], + loc: { + start: { column: 17, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + + range: [185, 193], + loc: { + start: { column: 15, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + + range: [182, 193], + loc: { + start: { column: 12, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + right: Literal { + type: "Literal", + raw: "30", + value: 30, + + range: [196, 198], + loc: { + start: { column: 26, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + + range: [182, 198], + loc: { + start: { column: 12, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + + range: [174, 198], + loc: { + start: { column: 4, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "private", + parameter: AssignmentPattern { + type: "AssignmentPattern", + left: Identifier { + type: "Identifier", + name: "student", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [230, 237], + loc: { + start: { column: 30, line: 8 }, + end: { column: 37, line: 8 }, + }, + }, + + range: [228, 237], + loc: { + start: { column: 28, line: 8 }, + end: { column: 37, line: 8 }, + }, + }, + + range: [221, 237], + loc: { + start: { column: 21, line: 8 }, + end: { column: 37, line: 8 }, + }, + }, + right: Literal { + type: "Literal", + raw: "false", + value: false, + + range: [240, 245], + loc: { + start: { column: 40, line: 8 }, + end: { column: 45, line: 8 }, + }, + }, + + range: [221, 245], + loc: { + start: { column: 21, line: 8 }, + end: { column: 45, line: 8 }, + }, + }, + readonly: true, + + range: [204, 245], + loc: { + start: { column: 4, line: 8 }, + end: { column: 45, line: 8 }, + }, + }, + ], + + range: [98, 253], + loc: { + start: { column: 13, line: 4 }, + end: { column: 6, line: 9 }, + }, + }, + + range: [87, 253], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 9 }, + }, + }, + ], + + range: [83, 255], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 255], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 256], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..2aa7ab10e028 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,356 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-private-parameter-properties Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [87, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [98, 99], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "private", + + range: [104, 111], + loc: { + start: { column: 4, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "firstName", + + range: [112, 121], + loc: { + start: { column: 12, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [121, 122], + loc: { + start: { column: 21, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [123, 129], + loc: { + start: { column: 23, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [129, 130], + loc: { + start: { column: 29, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "private", + + range: [135, 142], + loc: { + start: { column: 4, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [143, 151], + loc: { + start: { column: 12, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "lastName", + + range: [152, 160], + loc: { + start: { column: 21, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [160, 161], + loc: { + start: { column: 29, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [162, 168], + loc: { + start: { column: 31, line: 6 }, + end: { column: 37, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [168, 169], + loc: { + start: { column: 37, line: 6 }, + end: { column: 38, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "private", + + range: [174, 181], + loc: { + start: { column: 4, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "age", + + range: [182, 185], + loc: { + start: { column: 12, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [185, 186], + loc: { + start: { column: 15, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [187, 193], + loc: { + start: { column: 17, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [194, 195], + loc: { + start: { column: 24, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + Numeric { + type: "Numeric", + value: "30", + + range: [196, 198], + loc: { + start: { column: 26, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [198, 199], + loc: { + start: { column: 28, line: 7 }, + end: { column: 29, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "private", + + range: [204, 211], + loc: { + start: { column: 4, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [212, 220], + loc: { + start: { column: 12, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "student", + + range: [221, 228], + loc: { + start: { column: 21, line: 8 }, + end: { column: 28, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [228, 229], + loc: { + start: { column: 28, line: 8 }, + end: { column: 29, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [230, 237], + loc: { + start: { column: 30, line: 8 }, + end: { column: 37, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [238, 239], + loc: { + start: { column: 38, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + Boolean { + type: "Boolean", + value: "false", + + range: [240, 245], + loc: { + start: { column: 40, line: 8 }, + end: { column: 45, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [245, 246], + loc: { + start: { column: 45, line: 8 }, + end: { column: 46, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [249, 250], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [251, 252], + loc: { + start: { column: 4, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [252, 253], + loc: { + start: { column: 5, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [254, 255], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..ff7c7f9bdd3b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,293 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-private-parameter-properties AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'constructor', + + range: [87, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: 'constructor', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [251, 253], + loc: { + start: { column: 4, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: 'TSParameterProperty', + accessibility: 'private', + parameter: Identifier { + type: 'Identifier', + name: 'firstName', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [123, 129], + loc: { + start: { column: 23, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + + range: [121, 129], + loc: { + start: { column: 21, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + + range: [112, 129], + loc: { + start: { column: 12, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + + range: [104, 129], + loc: { + start: { column: 4, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + TSParameterProperty { + type: 'TSParameterProperty', + accessibility: 'private', + parameter: Identifier { + type: 'Identifier', + name: 'lastName', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [162, 168], + loc: { + start: { column: 31, line: 6 }, + end: { column: 37, line: 6 }, + }, + }, + + range: [160, 168], + loc: { + start: { column: 29, line: 6 }, + end: { column: 37, line: 6 }, + }, + }, + + range: [152, 168], + loc: { + start: { column: 21, line: 6 }, + end: { column: 37, line: 6 }, + }, + }, + readonly: true, + + range: [135, 168], + loc: { + start: { column: 4, line: 6 }, + end: { column: 37, line: 6 }, + }, + }, + TSParameterProperty { + type: 'TSParameterProperty', + accessibility: 'private', + parameter: AssignmentPattern { + type: 'AssignmentPattern', + left: Identifier { + type: 'Identifier', + name: 'age', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [187, 193], + loc: { + start: { column: 17, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + + range: [185, 193], + loc: { + start: { column: 15, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + + range: [182, 193], + loc: { + start: { column: 12, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + right: Literal { + type: 'Literal', + raw: '30', + value: 30, + + range: [196, 198], + loc: { + start: { column: 26, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + + range: [182, 198], + loc: { + start: { column: 12, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + + range: [174, 198], + loc: { + start: { column: 4, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + TSParameterProperty { + type: 'TSParameterProperty', + accessibility: 'private', + parameter: AssignmentPattern { + type: 'AssignmentPattern', + left: Identifier { + type: 'Identifier', + name: 'student', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSBooleanKeyword { + type: 'TSBooleanKeyword', + + range: [230, 237], + loc: { + start: { column: 30, line: 8 }, + end: { column: 37, line: 8 }, + }, + }, + + range: [228, 237], + loc: { + start: { column: 28, line: 8 }, + end: { column: 37, line: 8 }, + }, + }, + + range: [221, 237], + loc: { + start: { column: 21, line: 8 }, + end: { column: 37, line: 8 }, + }, + }, + right: Literal { + type: 'Literal', + raw: 'false', + value: false, + + range: [240, 245], + loc: { + start: { column: 40, line: 8 }, + end: { column: 45, line: 8 }, + }, + }, + + range: [221, 245], + loc: { + start: { column: 21, line: 8 }, + end: { column: 45, line: 8 }, + }, + }, + readonly: true, + + range: [204, 245], + loc: { + start: { column: 4, line: 8 }, + end: { column: 45, line: 8 }, + }, + }, + ], + + range: [98, 253], + loc: { + start: { column: 13, line: 4 }, + end: { column: 6, line: 9 }, + }, + }, + + range: [87, 253], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 9 }, + }, + }, + ], + + range: [83, 255], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 255], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 256], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..970c48431717 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,368 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-private-parameter-properties AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'constructor', + + range: [87, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [98, 99], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'private', + + range: [104, 111], + loc: { + start: { column: 4, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'firstName', + + range: [112, 121], + loc: { + start: { column: 12, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [121, 122], + loc: { + start: { column: 21, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [123, 129], + loc: { + start: { column: 23, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [129, 130], + loc: { + start: { column: 29, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'private', + + range: [135, 142], + loc: { + start: { column: 4, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'readonly', + + range: [143, 151], + loc: { + start: { column: 12, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'lastName', + + range: [152, 160], + loc: { + start: { column: 21, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [160, 161], + loc: { + start: { column: 29, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [162, 168], + loc: { + start: { column: 31, line: 6 }, + end: { column: 37, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [168, 169], + loc: { + start: { column: 37, line: 6 }, + end: { column: 38, line: 6 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'private', + + range: [174, 181], + loc: { + start: { column: 4, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'age', + + range: [182, 185], + loc: { + start: { column: 12, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [185, 186], + loc: { + start: { column: 15, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [187, 193], + loc: { + start: { column: 17, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [194, 195], + loc: { + start: { column: 24, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + Numeric { + type: 'Numeric', + value: '30', + + range: [196, 198], + loc: { + start: { column: 26, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [198, 199], + loc: { + start: { column: 28, line: 7 }, + end: { column: 29, line: 7 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'private', + + range: [204, 211], + loc: { + start: { column: 4, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'readonly', + + range: [212, 220], + loc: { + start: { column: 12, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'student', + + range: [221, 228], + loc: { + start: { column: 21, line: 8 }, + end: { column: 28, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [228, 229], + loc: { + start: { column: 28, line: 8 }, + end: { column: 29, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'boolean', + + range: [230, 237], + loc: { + start: { column: 30, line: 8 }, + end: { column: 37, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [238, 239], + loc: { + start: { column: 38, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + Boolean { + type: 'Boolean', + value: 'false', + + range: [240, 245], + loc: { + start: { column: 40, line: 8 }, + end: { column: 45, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [245, 246], + loc: { + start: { column: 45, line: 8 }, + end: { column: 46, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [249, 250], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [251, 252], + loc: { + start: { column: 4, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [252, 253], + loc: { + start: { column: 5, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [254, 255], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/fixture.ts new file mode 100644 index 000000000000..5235777864d7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + foo: () => boolean = (): boolean => true; + bar: string = () => test; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..d8a5df9e1066 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,215 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-property-function TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [87, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [98, 105], + loc: { + start: { column: 13, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [95, 105], + loc: { + start: { column: 10, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [92, 105], + loc: { + start: { column: 7, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [90, 105], + loc: { + start: { column: 5, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + value: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: Literal { + type: "Literal", + raw: "true", + value: true, + + range: [123, 127], + loc: { + start: { column: 38, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [112, 119], + loc: { + start: { column: 27, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [110, 119], + loc: { + start: { column: 25, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [108, 127], + loc: { + start: { column: 23, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + + range: [87, 128], + loc: { + start: { column: 2, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [131, 134], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [136, 142], + loc: { + start: { column: 7, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [134, 142], + loc: { + start: { column: 5, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + value: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: Identifier { + type: "Identifier", + name: "test", + + range: [151, 155], + loc: { + start: { column: 22, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [], + + range: [145, 155], + loc: { + start: { column: 16, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + + range: [131, 156], + loc: { + start: { column: 2, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + ], + + range: [83, 158], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 158], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 159], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..afcc681d20e2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,276 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-property-function TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [87, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [90, 91], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [92, 93], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [93, 94], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [95, 97], + loc: { + start: { column: 10, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [98, 105], + loc: { + start: { column: 13, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [106, 107], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [108, 109], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [109, 110], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [110, 111], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [112, 119], + loc: { + start: { column: 27, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [120, 122], + loc: { + start: { column: 35, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + Boolean { + type: "Boolean", + value: "true", + + range: [123, 127], + loc: { + start: { column: 38, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [127, 128], + loc: { + start: { column: 42, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [131, 134], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [134, 135], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [136, 142], + loc: { + start: { column: 7, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [143, 144], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [145, 146], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [146, 147], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [148, 150], + loc: { + start: { column: 19, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "test", + + range: [151, 155], + loc: { + start: { column: 22, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [155, 156], + loc: { + start: { column: 26, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [157, 158], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..83dd54375210 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/3-Babel-AST.shot @@ -0,0 +1,211 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-property-function Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [87, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + parameters: Array [], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [98, 105], + loc: { + start: { column: 13, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [95, 105], + loc: { + start: { column: 10, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [92, 105], + loc: { + start: { column: 7, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [90, 105], + loc: { + start: { column: 5, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + value: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: Literal { + type: "Literal", + raw: "true", + value: true, + + range: [123, 127], + loc: { + start: { column: 38, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [112, 119], + loc: { + start: { column: 27, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [110, 119], + loc: { + start: { column: 25, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [108, 127], + loc: { + start: { column: 23, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + + range: [87, 128], + loc: { + start: { column: 2, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [131, 134], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [136, 142], + loc: { + start: { column: 7, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [134, 142], + loc: { + start: { column: 5, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + value: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: Identifier { + type: "Identifier", + name: "test", + + range: [151, 155], + loc: { + start: { column: 22, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [], + + range: [145, 155], + loc: { + start: { column: 16, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + + range: [131, 156], + loc: { + start: { column: 2, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + ], + + range: [83, 158], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 158], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 159], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..265666ad43d1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,276 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-property-function Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [87, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [90, 91], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [92, 93], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [93, 94], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [95, 97], + loc: { + start: { column: 10, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [98, 105], + loc: { + start: { column: 13, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [106, 107], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [108, 109], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [109, 110], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [110, 111], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [112, 119], + loc: { + start: { column: 27, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [120, 122], + loc: { + start: { column: 35, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + Boolean { + type: "Boolean", + value: "true", + + range: [123, 127], + loc: { + start: { column: 38, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [127, 128], + loc: { + start: { column: 42, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [131, 134], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [134, 135], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [136, 142], + loc: { + start: { column: 7, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [143, 144], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [145, 146], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [146, 147], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [148, 150], + loc: { + start: { column: 19, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "test", + + range: [151, 155], + loc: { + start: { column: 22, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [155, 156], + loc: { + start: { column: 26, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [157, 158], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..bcee1481572e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,221 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-property-function AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'foo', + + range: [87, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSFunctionType { + type: 'TSFunctionType', +- params: Array [], +- returnType: TSTypeAnnotation { ++ parameters: Array [], ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSBooleanKeyword { + type: 'TSBooleanKeyword', + + range: [98, 105], + loc: { + start: { column: 13, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [95, 105], + loc: { + start: { column: 10, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [92, 105], + loc: { + start: { column: 7, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [90, 105], + loc: { + start: { column: 5, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + value: ArrowFunctionExpression { + type: 'ArrowFunctionExpression', + async: false, + body: Literal { + type: 'Literal', + raw: 'true', + value: true, + + range: [123, 127], + loc: { + start: { column: 38, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSBooleanKeyword { + type: 'TSBooleanKeyword', + + range: [112, 119], + loc: { + start: { column: 27, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [110, 119], + loc: { + start: { column: 25, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [108, 127], + loc: { + start: { column: 23, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + + range: [87, 128], + loc: { + start: { column: 2, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'bar', + + range: [131, 134], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [136, 142], + loc: { + start: { column: 7, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [134, 142], + loc: { + start: { column: 5, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + value: ArrowFunctionExpression { + type: 'ArrowFunctionExpression', + async: false, + body: Identifier { + type: 'Identifier', + name: 'test', + + range: [151, 155], + loc: { + start: { column: 22, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [], + + range: [145, 155], + loc: { + start: { column: 16, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + + range: [131, 156], + loc: { + start: { column: 2, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + ], + + range: [83, 158], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 158], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 159], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..efa49b6d94f5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-property-function AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/fixture.ts new file mode 100644 index 000000000000..9ca53c6ca653 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/fixture.ts @@ -0,0 +1,9 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + a = 2; + b = {}; + c = []; + d = ''; + e = new Array([{}, [], 2]); +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..adc96878555d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,267 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-property-values TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "a", + + range: [87, 88], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + override: false, + static: false, + value: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [91, 92], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "b", + + range: [96, 97], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + override: false, + static: false, + value: ObjectExpression { + type: "ObjectExpression", + properties: Array [], + + range: [100, 102], + loc: { + start: { column: 6, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + + range: [96, 103], + loc: { + start: { column: 2, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "c", + + range: [106, 107], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + override: false, + static: false, + value: ArrayExpression { + type: "ArrayExpression", + elements: Array [], + + range: [110, 112], + loc: { + start: { column: 6, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + + range: [106, 113], + loc: { + start: { column: 2, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "d", + + range: [116, 117], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + override: false, + static: false, + value: Literal { + type: "Literal", + raw: "''", + value: "", + + range: [120, 122], + loc: { + start: { column: 6, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + + range: [116, 123], + loc: { + start: { column: 2, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "e", + + range: [126, 127], + loc: { + start: { column: 2, line: 8 }, + end: { column: 3, line: 8 }, + }, + }, + override: false, + static: false, + value: NewExpression { + type: "NewExpression", + arguments: Array [ + ArrayExpression { + type: "ArrayExpression", + elements: Array [ + ObjectExpression { + type: "ObjectExpression", + properties: Array [], + + range: [141, 143], + loc: { + start: { column: 17, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + ArrayExpression { + type: "ArrayExpression", + elements: Array [], + + range: [145, 147], + loc: { + start: { column: 21, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [149, 150], + loc: { + start: { column: 25, line: 8 }, + end: { column: 26, line: 8 }, + }, + }, + ], + + range: [140, 151], + loc: { + start: { column: 16, line: 8 }, + end: { column: 27, line: 8 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "Array", + + range: [134, 139], + loc: { + start: { column: 10, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + + range: [130, 152], + loc: { + start: { column: 6, line: 8 }, + end: { column: 28, line: 8 }, + }, + }, + + range: [126, 153], + loc: { + start: { column: 2, line: 8 }, + end: { column: 29, line: 8 }, + }, + }, + ], + + range: [83, 155], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 155], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + ], + sourceType: "script", + + range: [73, 156], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 10 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..de954acbb68e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,386 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-property-values TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [87, 88], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [89, 90], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [91, 92], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [92, 93], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [96, 97], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [98, 99], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [100, 101], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [101, 102], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [102, 103], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "c", + + range: [106, 107], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [108, 109], + loc: { + start: { column: 4, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [110, 111], + loc: { + start: { column: 6, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [111, 112], + loc: { + start: { column: 7, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [112, 113], + loc: { + start: { column: 8, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "d", + + range: [116, 117], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [118, 119], + loc: { + start: { column: 4, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + String { + type: "String", + value: "''", + + range: [120, 122], + loc: { + start: { column: 6, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [122, 123], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "e", + + range: [126, 127], + loc: { + start: { column: 2, line: 8 }, + end: { column: 3, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [128, 129], + loc: { + start: { column: 4, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [130, 133], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "Array", + + range: [134, 139], + loc: { + start: { column: 10, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [139, 140], + loc: { + start: { column: 15, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [140, 141], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [141, 142], + loc: { + start: { column: 17, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [142, 143], + loc: { + start: { column: 18, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [143, 144], + loc: { + start: { column: 19, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [145, 146], + loc: { + start: { column: 21, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [146, 147], + loc: { + start: { column: 22, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [147, 148], + loc: { + start: { column: 23, line: 8 }, + end: { column: 24, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [149, 150], + loc: { + start: { column: 25, line: 8 }, + end: { column: 26, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [150, 151], + loc: { + start: { column: 26, line: 8 }, + end: { column: 27, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [151, 152], + loc: { + start: { column: 27, line: 8 }, + end: { column: 28, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [152, 153], + loc: { + start: { column: 28, line: 8 }, + end: { column: 29, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [154, 155], + loc: { + start: { column: 0, line: 9 }, + end: { column: 1, line: 9 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..53f84272910a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/3-Babel-AST.shot @@ -0,0 +1,257 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-property-values Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "a", + + range: [87, 88], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + static: false, + value: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [91, 92], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "b", + + range: [96, 97], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + static: false, + value: ObjectExpression { + type: "ObjectExpression", + properties: Array [], + + range: [100, 102], + loc: { + start: { column: 6, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + + range: [96, 103], + loc: { + start: { column: 2, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "c", + + range: [106, 107], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + static: false, + value: ArrayExpression { + type: "ArrayExpression", + elements: Array [], + + range: [110, 112], + loc: { + start: { column: 6, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + + range: [106, 113], + loc: { + start: { column: 2, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "d", + + range: [116, 117], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + static: false, + value: Literal { + type: "Literal", + raw: "''", + value: "", + + range: [120, 122], + loc: { + start: { column: 6, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + + range: [116, 123], + loc: { + start: { column: 2, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "e", + + range: [126, 127], + loc: { + start: { column: 2, line: 8 }, + end: { column: 3, line: 8 }, + }, + }, + static: false, + value: NewExpression { + type: "NewExpression", + arguments: Array [ + ArrayExpression { + type: "ArrayExpression", + elements: Array [ + ObjectExpression { + type: "ObjectExpression", + properties: Array [], + + range: [141, 143], + loc: { + start: { column: 17, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + ArrayExpression { + type: "ArrayExpression", + elements: Array [], + + range: [145, 147], + loc: { + start: { column: 21, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [149, 150], + loc: { + start: { column: 25, line: 8 }, + end: { column: 26, line: 8 }, + }, + }, + ], + + range: [140, 151], + loc: { + start: { column: 16, line: 8 }, + end: { column: 27, line: 8 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "Array", + + range: [134, 139], + loc: { + start: { column: 10, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + + range: [130, 152], + loc: { + start: { column: 6, line: 8 }, + end: { column: 28, line: 8 }, + }, + }, + + range: [126, 153], + loc: { + start: { column: 2, line: 8 }, + end: { column: 29, line: 8 }, + }, + }, + ], + + range: [83, 155], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 155], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + ], + sourceType: "script", + + range: [73, 156], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 10 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..45bd699a0dbc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,386 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-property-values Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [87, 88], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [89, 90], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [91, 92], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [92, 93], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [96, 97], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [98, 99], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [100, 101], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [101, 102], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [102, 103], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "c", + + range: [106, 107], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [108, 109], + loc: { + start: { column: 4, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [110, 111], + loc: { + start: { column: 6, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [111, 112], + loc: { + start: { column: 7, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [112, 113], + loc: { + start: { column: 8, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "d", + + range: [116, 117], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [118, 119], + loc: { + start: { column: 4, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + String { + type: "String", + value: "''", + + range: [120, 122], + loc: { + start: { column: 6, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [122, 123], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "e", + + range: [126, 127], + loc: { + start: { column: 2, line: 8 }, + end: { column: 3, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [128, 129], + loc: { + start: { column: 4, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [130, 133], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "Array", + + range: [134, 139], + loc: { + start: { column: 10, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [139, 140], + loc: { + start: { column: 15, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [140, 141], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [141, 142], + loc: { + start: { column: 17, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [142, 143], + loc: { + start: { column: 18, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [143, 144], + loc: { + start: { column: 19, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [145, 146], + loc: { + start: { column: 21, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [146, 147], + loc: { + start: { column: 22, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [147, 148], + loc: { + start: { column: 23, line: 8 }, + end: { column: 24, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [149, 150], + loc: { + start: { column: 25, line: 8 }, + end: { column: 26, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [150, 151], + loc: { + start: { column: 26, line: 8 }, + end: { column: 27, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [151, 152], + loc: { + start: { column: 27, line: 8 }, + end: { column: 28, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [152, 153], + loc: { + start: { column: 28, line: 8 }, + end: { column: 29, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [154, 155], + loc: { + start: { column: 0, line: 9 }, + end: { column: 1, line: 9 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..79808b9eccfd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,271 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-property-values AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'a', + + range: [87, 88], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, +- override: false, + static: false, + value: Literal { + type: 'Literal', + raw: '2', + value: 2, + + range: [91, 92], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'b', + + range: [96, 97], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, +- override: false, + static: false, + value: ObjectExpression { + type: 'ObjectExpression', + properties: Array [], + + range: [100, 102], + loc: { + start: { column: 6, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + + range: [96, 103], + loc: { + start: { column: 2, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'c', + + range: [106, 107], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, +- override: false, + static: false, + value: ArrayExpression { + type: 'ArrayExpression', + elements: Array [], + + range: [110, 112], + loc: { + start: { column: 6, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + + range: [106, 113], + loc: { + start: { column: 2, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'd', + + range: [116, 117], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, +- override: false, + static: false, + value: Literal { + type: 'Literal', + raw: '\\\\'\\\\'', + value: '', + + range: [120, 122], + loc: { + start: { column: 6, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + + range: [116, 123], + loc: { + start: { column: 2, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'e', + + range: [126, 127], + loc: { + start: { column: 2, line: 8 }, + end: { column: 3, line: 8 }, + }, + }, +- override: false, + static: false, + value: NewExpression { + type: 'NewExpression', + arguments: Array [ + ArrayExpression { + type: 'ArrayExpression', + elements: Array [ + ObjectExpression { + type: 'ObjectExpression', + properties: Array [], + + range: [141, 143], + loc: { + start: { column: 17, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + ArrayExpression { + type: 'ArrayExpression', + elements: Array [], + + range: [145, 147], + loc: { + start: { column: 21, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + Literal { + type: 'Literal', + raw: '2', + value: 2, + + range: [149, 150], + loc: { + start: { column: 25, line: 8 }, + end: { column: 26, line: 8 }, + }, + }, + ], + + range: [140, 151], + loc: { + start: { column: 16, line: 8 }, + end: { column: 27, line: 8 }, + }, + }, + ], + callee: Identifier { + type: 'Identifier', + name: 'Array', + + range: [134, 139], + loc: { + start: { column: 10, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + + range: [130, 152], + loc: { + start: { column: 6, line: 8 }, + end: { column: 28, line: 8 }, + }, + }, + + range: [126, 153], + loc: { + start: { column: 2, line: 8 }, + end: { column: 29, line: 8 }, + }, + }, + ], + + range: [83, 155], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 155], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 156], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 10 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..7958f0bae3e1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-property-values AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/fixture.ts new file mode 100644 index 000000000000..844cb78d8275 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/fixture.ts @@ -0,0 +1,10 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + constructor( + protected firstName: string, + protected readonly lastName: string, + protected age: number = 30, + protected readonly student: boolean = false, + ) {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..39118591b249 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,289 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-protected-parameter-properties TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [87, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: "constructor", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [259, 261], + loc: { + start: { column: 4, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "protected", + parameter: Identifier { + type: "Identifier", + name: "firstName", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [125, 131], + loc: { + start: { column: 25, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + + range: [123, 131], + loc: { + start: { column: 23, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + + range: [114, 131], + loc: { + start: { column: 14, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + + range: [104, 131], + loc: { + start: { column: 4, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "protected", + parameter: Identifier { + type: "Identifier", + name: "lastName", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [166, 172], + loc: { + start: { column: 33, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + + range: [164, 172], + loc: { + start: { column: 31, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + + range: [156, 172], + loc: { + start: { column: 23, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + readonly: true, + + range: [137, 172], + loc: { + start: { column: 4, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "protected", + parameter: AssignmentPattern { + type: "AssignmentPattern", + left: Identifier { + type: "Identifier", + name: "age", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [193, 199], + loc: { + start: { column: 19, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + + range: [191, 199], + loc: { + start: { column: 17, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + + range: [188, 199], + loc: { + start: { column: 14, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + right: Literal { + type: "Literal", + raw: "30", + value: 30, + + range: [202, 204], + loc: { + start: { column: 28, line: 7 }, + end: { column: 30, line: 7 }, + }, + }, + + range: [188, 204], + loc: { + start: { column: 14, line: 7 }, + end: { column: 30, line: 7 }, + }, + }, + + range: [178, 204], + loc: { + start: { column: 4, line: 7 }, + end: { column: 30, line: 7 }, + }, + }, + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "protected", + parameter: AssignmentPattern { + type: "AssignmentPattern", + left: Identifier { + type: "Identifier", + name: "student", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [238, 245], + loc: { + start: { column: 32, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + + range: [236, 245], + loc: { + start: { column: 30, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + + range: [229, 245], + loc: { + start: { column: 23, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + right: Literal { + type: "Literal", + raw: "false", + value: false, + + range: [248, 253], + loc: { + start: { column: 42, line: 8 }, + end: { column: 47, line: 8 }, + }, + }, + + range: [229, 253], + loc: { + start: { column: 23, line: 8 }, + end: { column: 47, line: 8 }, + }, + }, + readonly: true, + + range: [210, 253], + loc: { + start: { column: 4, line: 8 }, + end: { column: 47, line: 8 }, + }, + }, + ], + + range: [98, 261], + loc: { + start: { column: 13, line: 4 }, + end: { column: 6, line: 9 }, + }, + }, + + range: [87, 261], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 9 }, + }, + }, + ], + + range: [83, 263], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 263], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 264], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..7fbb2260d8e6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,356 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-protected-parameter-properties TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [87, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [98, 99], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "protected", + + range: [104, 113], + loc: { + start: { column: 4, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "firstName", + + range: [114, 123], + loc: { + start: { column: 14, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [123, 124], + loc: { + start: { column: 23, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [125, 131], + loc: { + start: { column: 25, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [131, 132], + loc: { + start: { column: 31, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "protected", + + range: [137, 146], + loc: { + start: { column: 4, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [147, 155], + loc: { + start: { column: 14, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "lastName", + + range: [156, 164], + loc: { + start: { column: 23, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [164, 165], + loc: { + start: { column: 31, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [166, 172], + loc: { + start: { column: 33, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [172, 173], + loc: { + start: { column: 39, line: 6 }, + end: { column: 40, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "protected", + + range: [178, 187], + loc: { + start: { column: 4, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "age", + + range: [188, 191], + loc: { + start: { column: 14, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [191, 192], + loc: { + start: { column: 17, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [193, 199], + loc: { + start: { column: 19, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [200, 201], + loc: { + start: { column: 26, line: 7 }, + end: { column: 27, line: 7 }, + }, + }, + Numeric { + type: "Numeric", + value: "30", + + range: [202, 204], + loc: { + start: { column: 28, line: 7 }, + end: { column: 30, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [204, 205], + loc: { + start: { column: 30, line: 7 }, + end: { column: 31, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "protected", + + range: [210, 219], + loc: { + start: { column: 4, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [220, 228], + loc: { + start: { column: 14, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "student", + + range: [229, 236], + loc: { + start: { column: 23, line: 8 }, + end: { column: 30, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [236, 237], + loc: { + start: { column: 30, line: 8 }, + end: { column: 31, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [238, 245], + loc: { + start: { column: 32, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [246, 247], + loc: { + start: { column: 40, line: 8 }, + end: { column: 41, line: 8 }, + }, + }, + Boolean { + type: "Boolean", + value: "false", + + range: [248, 253], + loc: { + start: { column: 42, line: 8 }, + end: { column: 47, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [253, 254], + loc: { + start: { column: 47, line: 8 }, + end: { column: 48, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [257, 258], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [259, 260], + loc: { + start: { column: 4, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [260, 261], + loc: { + start: { column: 5, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [262, 263], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..67dddc7f2027 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/3-Babel-AST.shot @@ -0,0 +1,288 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-protected-parameter-properties Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [87, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: "constructor", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [259, 261], + loc: { + start: { column: 4, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "protected", + parameter: Identifier { + type: "Identifier", + name: "firstName", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [125, 131], + loc: { + start: { column: 25, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + + range: [123, 131], + loc: { + start: { column: 23, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + + range: [114, 131], + loc: { + start: { column: 14, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + + range: [104, 131], + loc: { + start: { column: 4, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "protected", + parameter: Identifier { + type: "Identifier", + name: "lastName", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [166, 172], + loc: { + start: { column: 33, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + + range: [164, 172], + loc: { + start: { column: 31, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + + range: [156, 172], + loc: { + start: { column: 23, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + readonly: true, + + range: [137, 172], + loc: { + start: { column: 4, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "protected", + parameter: AssignmentPattern { + type: "AssignmentPattern", + left: Identifier { + type: "Identifier", + name: "age", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [193, 199], + loc: { + start: { column: 19, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + + range: [191, 199], + loc: { + start: { column: 17, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + + range: [188, 199], + loc: { + start: { column: 14, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + right: Literal { + type: "Literal", + raw: "30", + value: 30, + + range: [202, 204], + loc: { + start: { column: 28, line: 7 }, + end: { column: 30, line: 7 }, + }, + }, + + range: [188, 204], + loc: { + start: { column: 14, line: 7 }, + end: { column: 30, line: 7 }, + }, + }, + + range: [178, 204], + loc: { + start: { column: 4, line: 7 }, + end: { column: 30, line: 7 }, + }, + }, + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "protected", + parameter: AssignmentPattern { + type: "AssignmentPattern", + left: Identifier { + type: "Identifier", + name: "student", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [238, 245], + loc: { + start: { column: 32, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + + range: [236, 245], + loc: { + start: { column: 30, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + + range: [229, 245], + loc: { + start: { column: 23, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + right: Literal { + type: "Literal", + raw: "false", + value: false, + + range: [248, 253], + loc: { + start: { column: 42, line: 8 }, + end: { column: 47, line: 8 }, + }, + }, + + range: [229, 253], + loc: { + start: { column: 23, line: 8 }, + end: { column: 47, line: 8 }, + }, + }, + readonly: true, + + range: [210, 253], + loc: { + start: { column: 4, line: 8 }, + end: { column: 47, line: 8 }, + }, + }, + ], + + range: [98, 261], + loc: { + start: { column: 13, line: 4 }, + end: { column: 6, line: 9 }, + }, + }, + + range: [87, 261], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 9 }, + }, + }, + ], + + range: [83, 263], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 263], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 264], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..818ce810d061 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,356 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-protected-parameter-properties Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [87, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [98, 99], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "protected", + + range: [104, 113], + loc: { + start: { column: 4, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "firstName", + + range: [114, 123], + loc: { + start: { column: 14, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [123, 124], + loc: { + start: { column: 23, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [125, 131], + loc: { + start: { column: 25, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [131, 132], + loc: { + start: { column: 31, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "protected", + + range: [137, 146], + loc: { + start: { column: 4, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [147, 155], + loc: { + start: { column: 14, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "lastName", + + range: [156, 164], + loc: { + start: { column: 23, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [164, 165], + loc: { + start: { column: 31, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [166, 172], + loc: { + start: { column: 33, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [172, 173], + loc: { + start: { column: 39, line: 6 }, + end: { column: 40, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "protected", + + range: [178, 187], + loc: { + start: { column: 4, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "age", + + range: [188, 191], + loc: { + start: { column: 14, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [191, 192], + loc: { + start: { column: 17, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [193, 199], + loc: { + start: { column: 19, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [200, 201], + loc: { + start: { column: 26, line: 7 }, + end: { column: 27, line: 7 }, + }, + }, + Numeric { + type: "Numeric", + value: "30", + + range: [202, 204], + loc: { + start: { column: 28, line: 7 }, + end: { column: 30, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [204, 205], + loc: { + start: { column: 30, line: 7 }, + end: { column: 31, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "protected", + + range: [210, 219], + loc: { + start: { column: 4, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [220, 228], + loc: { + start: { column: 14, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "student", + + range: [229, 236], + loc: { + start: { column: 23, line: 8 }, + end: { column: 30, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [236, 237], + loc: { + start: { column: 30, line: 8 }, + end: { column: 31, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [238, 245], + loc: { + start: { column: 32, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [246, 247], + loc: { + start: { column: 40, line: 8 }, + end: { column: 41, line: 8 }, + }, + }, + Boolean { + type: "Boolean", + value: "false", + + range: [248, 253], + loc: { + start: { column: 42, line: 8 }, + end: { column: 47, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [253, 254], + loc: { + start: { column: 47, line: 8 }, + end: { column: 48, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [257, 258], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [259, 260], + loc: { + start: { column: 4, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [260, 261], + loc: { + start: { column: 5, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [262, 263], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..74a8495047cc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,293 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-protected-parameter-properties AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'constructor', + + range: [87, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: 'constructor', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [259, 261], + loc: { + start: { column: 4, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: 'TSParameterProperty', + accessibility: 'protected', + parameter: Identifier { + type: 'Identifier', + name: 'firstName', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [125, 131], + loc: { + start: { column: 25, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + + range: [123, 131], + loc: { + start: { column: 23, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + + range: [114, 131], + loc: { + start: { column: 14, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + + range: [104, 131], + loc: { + start: { column: 4, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + TSParameterProperty { + type: 'TSParameterProperty', + accessibility: 'protected', + parameter: Identifier { + type: 'Identifier', + name: 'lastName', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [166, 172], + loc: { + start: { column: 33, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + + range: [164, 172], + loc: { + start: { column: 31, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + + range: [156, 172], + loc: { + start: { column: 23, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + readonly: true, + + range: [137, 172], + loc: { + start: { column: 4, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + TSParameterProperty { + type: 'TSParameterProperty', + accessibility: 'protected', + parameter: AssignmentPattern { + type: 'AssignmentPattern', + left: Identifier { + type: 'Identifier', + name: 'age', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [193, 199], + loc: { + start: { column: 19, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + + range: [191, 199], + loc: { + start: { column: 17, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + + range: [188, 199], + loc: { + start: { column: 14, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + right: Literal { + type: 'Literal', + raw: '30', + value: 30, + + range: [202, 204], + loc: { + start: { column: 28, line: 7 }, + end: { column: 30, line: 7 }, + }, + }, + + range: [188, 204], + loc: { + start: { column: 14, line: 7 }, + end: { column: 30, line: 7 }, + }, + }, + + range: [178, 204], + loc: { + start: { column: 4, line: 7 }, + end: { column: 30, line: 7 }, + }, + }, + TSParameterProperty { + type: 'TSParameterProperty', + accessibility: 'protected', + parameter: AssignmentPattern { + type: 'AssignmentPattern', + left: Identifier { + type: 'Identifier', + name: 'student', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSBooleanKeyword { + type: 'TSBooleanKeyword', + + range: [238, 245], + loc: { + start: { column: 32, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + + range: [236, 245], + loc: { + start: { column: 30, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + + range: [229, 245], + loc: { + start: { column: 23, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + right: Literal { + type: 'Literal', + raw: 'false', + value: false, + + range: [248, 253], + loc: { + start: { column: 42, line: 8 }, + end: { column: 47, line: 8 }, + }, + }, + + range: [229, 253], + loc: { + start: { column: 23, line: 8 }, + end: { column: 47, line: 8 }, + }, + }, + readonly: true, + + range: [210, 253], + loc: { + start: { column: 4, line: 8 }, + end: { column: 47, line: 8 }, + }, + }, + ], + + range: [98, 261], + loc: { + start: { column: 13, line: 4 }, + end: { column: 6, line: 9 }, + }, + }, + + range: [87, 261], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 9 }, + }, + }, + ], + + range: [83, 263], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 263], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 264], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..13074add59aa --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,368 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-protected-parameter-properties AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'constructor', + + range: [87, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [98, 99], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'protected', + + range: [104, 113], + loc: { + start: { column: 4, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'firstName', + + range: [114, 123], + loc: { + start: { column: 14, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [123, 124], + loc: { + start: { column: 23, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [125, 131], + loc: { + start: { column: 25, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [131, 132], + loc: { + start: { column: 31, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'protected', + + range: [137, 146], + loc: { + start: { column: 4, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'readonly', + + range: [147, 155], + loc: { + start: { column: 14, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'lastName', + + range: [156, 164], + loc: { + start: { column: 23, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [164, 165], + loc: { + start: { column: 31, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [166, 172], + loc: { + start: { column: 33, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [172, 173], + loc: { + start: { column: 39, line: 6 }, + end: { column: 40, line: 6 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'protected', + + range: [178, 187], + loc: { + start: { column: 4, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'age', + + range: [188, 191], + loc: { + start: { column: 14, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [191, 192], + loc: { + start: { column: 17, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [193, 199], + loc: { + start: { column: 19, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [200, 201], + loc: { + start: { column: 26, line: 7 }, + end: { column: 27, line: 7 }, + }, + }, + Numeric { + type: 'Numeric', + value: '30', + + range: [202, 204], + loc: { + start: { column: 28, line: 7 }, + end: { column: 30, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [204, 205], + loc: { + start: { column: 30, line: 7 }, + end: { column: 31, line: 7 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'protected', + + range: [210, 219], + loc: { + start: { column: 4, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'readonly', + + range: [220, 228], + loc: { + start: { column: 14, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'student', + + range: [229, 236], + loc: { + start: { column: 23, line: 8 }, + end: { column: 30, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [236, 237], + loc: { + start: { column: 30, line: 8 }, + end: { column: 31, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'boolean', + + range: [238, 245], + loc: { + start: { column: 32, line: 8 }, + end: { column: 39, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [246, 247], + loc: { + start: { column: 40, line: 8 }, + end: { column: 41, line: 8 }, + }, + }, + Boolean { + type: 'Boolean', + value: 'false', + + range: [248, 253], + loc: { + start: { column: 42, line: 8 }, + end: { column: 47, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [253, 254], + loc: { + start: { column: 47, line: 8 }, + end: { column: 48, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [257, 258], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [259, 260], + loc: { + start: { column: 4, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [260, 261], + loc: { + start: { column: 5, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [262, 263], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/fixture.ts new file mode 100644 index 000000000000..fbda61d6b658 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/fixture.ts @@ -0,0 +1,10 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + constructor( + public firstName: string, + public readonly lastName: string, + public age: number = 30, + public readonly student: boolean = false, + ) {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..bcc00df90c95 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,289 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-public-parameter-properties TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [87, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: "constructor", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [247, 249], + loc: { + start: { column: 4, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "public", + parameter: Identifier { + type: "Identifier", + name: "firstName", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [122, 128], + loc: { + start: { column: 22, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + + range: [120, 128], + loc: { + start: { column: 20, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + + range: [111, 128], + loc: { + start: { column: 11, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + + range: [104, 128], + loc: { + start: { column: 4, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "public", + parameter: Identifier { + type: "Identifier", + name: "lastName", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [160, 166], + loc: { + start: { column: 30, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + + range: [158, 166], + loc: { + start: { column: 28, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + + range: [150, 166], + loc: { + start: { column: 20, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + readonly: true, + + range: [134, 166], + loc: { + start: { column: 4, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "public", + parameter: AssignmentPattern { + type: "AssignmentPattern", + left: Identifier { + type: "Identifier", + name: "age", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [184, 190], + loc: { + start: { column: 16, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + + range: [182, 190], + loc: { + start: { column: 14, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + + range: [179, 190], + loc: { + start: { column: 11, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + right: Literal { + type: "Literal", + raw: "30", + value: 30, + + range: [193, 195], + loc: { + start: { column: 25, line: 7 }, + end: { column: 27, line: 7 }, + }, + }, + + range: [179, 195], + loc: { + start: { column: 11, line: 7 }, + end: { column: 27, line: 7 }, + }, + }, + + range: [172, 195], + loc: { + start: { column: 4, line: 7 }, + end: { column: 27, line: 7 }, + }, + }, + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "public", + parameter: AssignmentPattern { + type: "AssignmentPattern", + left: Identifier { + type: "Identifier", + name: "student", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [226, 233], + loc: { + start: { column: 29, line: 8 }, + end: { column: 36, line: 8 }, + }, + }, + + range: [224, 233], + loc: { + start: { column: 27, line: 8 }, + end: { column: 36, line: 8 }, + }, + }, + + range: [217, 233], + loc: { + start: { column: 20, line: 8 }, + end: { column: 36, line: 8 }, + }, + }, + right: Literal { + type: "Literal", + raw: "false", + value: false, + + range: [236, 241], + loc: { + start: { column: 39, line: 8 }, + end: { column: 44, line: 8 }, + }, + }, + + range: [217, 241], + loc: { + start: { column: 20, line: 8 }, + end: { column: 44, line: 8 }, + }, + }, + readonly: true, + + range: [201, 241], + loc: { + start: { column: 4, line: 8 }, + end: { column: 44, line: 8 }, + }, + }, + ], + + range: [98, 249], + loc: { + start: { column: 13, line: 4 }, + end: { column: 6, line: 9 }, + }, + }, + + range: [87, 249], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 9 }, + }, + }, + ], + + range: [83, 251], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 251], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 252], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..814d0ebc1988 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,356 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-public-parameter-properties TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [87, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [98, 99], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [104, 110], + loc: { + start: { column: 4, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "firstName", + + range: [111, 120], + loc: { + start: { column: 11, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [120, 121], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [122, 128], + loc: { + start: { column: 22, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [128, 129], + loc: { + start: { column: 28, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [134, 140], + loc: { + start: { column: 4, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [141, 149], + loc: { + start: { column: 11, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "lastName", + + range: [150, 158], + loc: { + start: { column: 20, line: 6 }, + end: { column: 28, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [158, 159], + loc: { + start: { column: 28, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [160, 166], + loc: { + start: { column: 30, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [166, 167], + loc: { + start: { column: 36, line: 6 }, + end: { column: 37, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [172, 178], + loc: { + start: { column: 4, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "age", + + range: [179, 182], + loc: { + start: { column: 11, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [182, 183], + loc: { + start: { column: 14, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [184, 190], + loc: { + start: { column: 16, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [191, 192], + loc: { + start: { column: 23, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + Numeric { + type: "Numeric", + value: "30", + + range: [193, 195], + loc: { + start: { column: 25, line: 7 }, + end: { column: 27, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [195, 196], + loc: { + start: { column: 27, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [201, 207], + loc: { + start: { column: 4, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [208, 216], + loc: { + start: { column: 11, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "student", + + range: [217, 224], + loc: { + start: { column: 20, line: 8 }, + end: { column: 27, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [224, 225], + loc: { + start: { column: 27, line: 8 }, + end: { column: 28, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [226, 233], + loc: { + start: { column: 29, line: 8 }, + end: { column: 36, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [234, 235], + loc: { + start: { column: 37, line: 8 }, + end: { column: 38, line: 8 }, + }, + }, + Boolean { + type: "Boolean", + value: "false", + + range: [236, 241], + loc: { + start: { column: 39, line: 8 }, + end: { column: 44, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [241, 242], + loc: { + start: { column: 44, line: 8 }, + end: { column: 45, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [245, 246], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [247, 248], + loc: { + start: { column: 4, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [248, 249], + loc: { + start: { column: 5, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [250, 251], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..799c8f31d2d3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/3-Babel-AST.shot @@ -0,0 +1,288 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-public-parameter-properties Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [87, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: "constructor", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [247, 249], + loc: { + start: { column: 4, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "public", + parameter: Identifier { + type: "Identifier", + name: "firstName", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [122, 128], + loc: { + start: { column: 22, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + + range: [120, 128], + loc: { + start: { column: 20, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + + range: [111, 128], + loc: { + start: { column: 11, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + + range: [104, 128], + loc: { + start: { column: 4, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "public", + parameter: Identifier { + type: "Identifier", + name: "lastName", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [160, 166], + loc: { + start: { column: 30, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + + range: [158, 166], + loc: { + start: { column: 28, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + + range: [150, 166], + loc: { + start: { column: 20, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + readonly: true, + + range: [134, 166], + loc: { + start: { column: 4, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "public", + parameter: AssignmentPattern { + type: "AssignmentPattern", + left: Identifier { + type: "Identifier", + name: "age", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [184, 190], + loc: { + start: { column: 16, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + + range: [182, 190], + loc: { + start: { column: 14, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + + range: [179, 190], + loc: { + start: { column: 11, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + right: Literal { + type: "Literal", + raw: "30", + value: 30, + + range: [193, 195], + loc: { + start: { column: 25, line: 7 }, + end: { column: 27, line: 7 }, + }, + }, + + range: [179, 195], + loc: { + start: { column: 11, line: 7 }, + end: { column: 27, line: 7 }, + }, + }, + + range: [172, 195], + loc: { + start: { column: 4, line: 7 }, + end: { column: 27, line: 7 }, + }, + }, + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "public", + parameter: AssignmentPattern { + type: "AssignmentPattern", + left: Identifier { + type: "Identifier", + name: "student", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [226, 233], + loc: { + start: { column: 29, line: 8 }, + end: { column: 36, line: 8 }, + }, + }, + + range: [224, 233], + loc: { + start: { column: 27, line: 8 }, + end: { column: 36, line: 8 }, + }, + }, + + range: [217, 233], + loc: { + start: { column: 20, line: 8 }, + end: { column: 36, line: 8 }, + }, + }, + right: Literal { + type: "Literal", + raw: "false", + value: false, + + range: [236, 241], + loc: { + start: { column: 39, line: 8 }, + end: { column: 44, line: 8 }, + }, + }, + + range: [217, 241], + loc: { + start: { column: 20, line: 8 }, + end: { column: 44, line: 8 }, + }, + }, + readonly: true, + + range: [201, 241], + loc: { + start: { column: 4, line: 8 }, + end: { column: 44, line: 8 }, + }, + }, + ], + + range: [98, 249], + loc: { + start: { column: 13, line: 4 }, + end: { column: 6, line: 9 }, + }, + }, + + range: [87, 249], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 9 }, + }, + }, + ], + + range: [83, 251], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 251], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 252], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..2bd6a5ad2bb2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,356 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-public-parameter-properties Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [87, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [98, 99], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [104, 110], + loc: { + start: { column: 4, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "firstName", + + range: [111, 120], + loc: { + start: { column: 11, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [120, 121], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [122, 128], + loc: { + start: { column: 22, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [128, 129], + loc: { + start: { column: 28, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [134, 140], + loc: { + start: { column: 4, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [141, 149], + loc: { + start: { column: 11, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "lastName", + + range: [150, 158], + loc: { + start: { column: 20, line: 6 }, + end: { column: 28, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [158, 159], + loc: { + start: { column: 28, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [160, 166], + loc: { + start: { column: 30, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [166, 167], + loc: { + start: { column: 36, line: 6 }, + end: { column: 37, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [172, 178], + loc: { + start: { column: 4, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "age", + + range: [179, 182], + loc: { + start: { column: 11, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [182, 183], + loc: { + start: { column: 14, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [184, 190], + loc: { + start: { column: 16, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [191, 192], + loc: { + start: { column: 23, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + Numeric { + type: "Numeric", + value: "30", + + range: [193, 195], + loc: { + start: { column: 25, line: 7 }, + end: { column: 27, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [195, 196], + loc: { + start: { column: 27, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [201, 207], + loc: { + start: { column: 4, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [208, 216], + loc: { + start: { column: 11, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "student", + + range: [217, 224], + loc: { + start: { column: 20, line: 8 }, + end: { column: 27, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [224, 225], + loc: { + start: { column: 27, line: 8 }, + end: { column: 28, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [226, 233], + loc: { + start: { column: 29, line: 8 }, + end: { column: 36, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [234, 235], + loc: { + start: { column: 37, line: 8 }, + end: { column: 38, line: 8 }, + }, + }, + Boolean { + type: "Boolean", + value: "false", + + range: [236, 241], + loc: { + start: { column: 39, line: 8 }, + end: { column: 44, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [241, 242], + loc: { + start: { column: 44, line: 8 }, + end: { column: 45, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [245, 246], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [247, 248], + loc: { + start: { column: 4, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [248, 249], + loc: { + start: { column: 5, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [250, 251], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..ce5f1910bb79 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,293 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-public-parameter-properties AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'constructor', + + range: [87, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: 'constructor', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [247, 249], + loc: { + start: { column: 4, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: 'TSParameterProperty', + accessibility: 'public', + parameter: Identifier { + type: 'Identifier', + name: 'firstName', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [122, 128], + loc: { + start: { column: 22, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + + range: [120, 128], + loc: { + start: { column: 20, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + + range: [111, 128], + loc: { + start: { column: 11, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + + range: [104, 128], + loc: { + start: { column: 4, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + TSParameterProperty { + type: 'TSParameterProperty', + accessibility: 'public', + parameter: Identifier { + type: 'Identifier', + name: 'lastName', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [160, 166], + loc: { + start: { column: 30, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + + range: [158, 166], + loc: { + start: { column: 28, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + + range: [150, 166], + loc: { + start: { column: 20, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + readonly: true, + + range: [134, 166], + loc: { + start: { column: 4, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + TSParameterProperty { + type: 'TSParameterProperty', + accessibility: 'public', + parameter: AssignmentPattern { + type: 'AssignmentPattern', + left: Identifier { + type: 'Identifier', + name: 'age', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [184, 190], + loc: { + start: { column: 16, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + + range: [182, 190], + loc: { + start: { column: 14, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + + range: [179, 190], + loc: { + start: { column: 11, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + right: Literal { + type: 'Literal', + raw: '30', + value: 30, + + range: [193, 195], + loc: { + start: { column: 25, line: 7 }, + end: { column: 27, line: 7 }, + }, + }, + + range: [179, 195], + loc: { + start: { column: 11, line: 7 }, + end: { column: 27, line: 7 }, + }, + }, + + range: [172, 195], + loc: { + start: { column: 4, line: 7 }, + end: { column: 27, line: 7 }, + }, + }, + TSParameterProperty { + type: 'TSParameterProperty', + accessibility: 'public', + parameter: AssignmentPattern { + type: 'AssignmentPattern', + left: Identifier { + type: 'Identifier', + name: 'student', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSBooleanKeyword { + type: 'TSBooleanKeyword', + + range: [226, 233], + loc: { + start: { column: 29, line: 8 }, + end: { column: 36, line: 8 }, + }, + }, + + range: [224, 233], + loc: { + start: { column: 27, line: 8 }, + end: { column: 36, line: 8 }, + }, + }, + + range: [217, 233], + loc: { + start: { column: 20, line: 8 }, + end: { column: 36, line: 8 }, + }, + }, + right: Literal { + type: 'Literal', + raw: 'false', + value: false, + + range: [236, 241], + loc: { + start: { column: 39, line: 8 }, + end: { column: 44, line: 8 }, + }, + }, + + range: [217, 241], + loc: { + start: { column: 20, line: 8 }, + end: { column: 44, line: 8 }, + }, + }, + readonly: true, + + range: [201, 241], + loc: { + start: { column: 4, line: 8 }, + end: { column: 44, line: 8 }, + }, + }, + ], + + range: [98, 249], + loc: { + start: { column: 13, line: 4 }, + end: { column: 6, line: 9 }, + }, + }, + + range: [87, 249], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 9 }, + }, + }, + ], + + range: [83, 251], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 251], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 252], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..ae6f5c9e68a9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,368 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-public-parameter-properties AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'constructor', + + range: [87, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [98, 99], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [104, 110], + loc: { + start: { column: 4, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'firstName', + + range: [111, 120], + loc: { + start: { column: 11, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [120, 121], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [122, 128], + loc: { + start: { column: 22, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [128, 129], + loc: { + start: { column: 28, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [134, 140], + loc: { + start: { column: 4, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'readonly', + + range: [141, 149], + loc: { + start: { column: 11, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'lastName', + + range: [150, 158], + loc: { + start: { column: 20, line: 6 }, + end: { column: 28, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [158, 159], + loc: { + start: { column: 28, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [160, 166], + loc: { + start: { column: 30, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [166, 167], + loc: { + start: { column: 36, line: 6 }, + end: { column: 37, line: 6 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [172, 178], + loc: { + start: { column: 4, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'age', + + range: [179, 182], + loc: { + start: { column: 11, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [182, 183], + loc: { + start: { column: 14, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [184, 190], + loc: { + start: { column: 16, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [191, 192], + loc: { + start: { column: 23, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + Numeric { + type: 'Numeric', + value: '30', + + range: [193, 195], + loc: { + start: { column: 25, line: 7 }, + end: { column: 27, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [195, 196], + loc: { + start: { column: 27, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [201, 207], + loc: { + start: { column: 4, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'readonly', + + range: [208, 216], + loc: { + start: { column: 11, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'student', + + range: [217, 224], + loc: { + start: { column: 20, line: 8 }, + end: { column: 27, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [224, 225], + loc: { + start: { column: 27, line: 8 }, + end: { column: 28, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'boolean', + + range: [226, 233], + loc: { + start: { column: 29, line: 8 }, + end: { column: 36, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [234, 235], + loc: { + start: { column: 37, line: 8 }, + end: { column: 38, line: 8 }, + }, + }, + Boolean { + type: 'Boolean', + value: 'false', + + range: [236, 241], + loc: { + start: { column: 39, line: 8 }, + end: { column: 44, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [241, 242], + loc: { + start: { column: 44, line: 8 }, + end: { column: 45, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [245, 246], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [247, 248], + loc: { + start: { column: 4, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [248, 249], + loc: { + start: { column: 5, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [250, 251], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/fixture.ts new file mode 100644 index 000000000000..9e0d88592aaf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/fixture.ts @@ -0,0 +1,8 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + constructor( + readonly firstName: string, + readonly lastName: string = 'Smith', + ) {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..58a500e86b42 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,191 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-readonly-parameter-properties TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [87, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: "constructor", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [177, 179], + loc: { + start: { column: 4, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: "TSParameterProperty", + parameter: Identifier { + type: "Identifier", + name: "firstName", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [124, 130], + loc: { + start: { column: 24, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + + range: [122, 130], + loc: { + start: { column: 22, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + + range: [113, 130], + loc: { + start: { column: 13, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + readonly: true, + + range: [104, 130], + loc: { + start: { column: 4, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + TSParameterProperty { + type: "TSParameterProperty", + parameter: AssignmentPattern { + type: "AssignmentPattern", + left: Identifier { + type: "Identifier", + name: "lastName", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [155, 161], + loc: { + start: { column: 23, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + + range: [153, 161], + loc: { + start: { column: 21, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + + range: [145, 161], + loc: { + start: { column: 13, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + right: Literal { + type: "Literal", + raw: "'Smith'", + value: "Smith", + + range: [164, 171], + loc: { + start: { column: 32, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + + range: [145, 171], + loc: { + start: { column: 13, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + readonly: true, + + range: [136, 171], + loc: { + start: { column: 4, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + ], + + range: [98, 179], + loc: { + start: { column: 13, line: 4 }, + end: { column: 6, line: 7 }, + }, + }, + + range: [87, 179], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 7 }, + }, + }, + ], + + range: [83, 181], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 181], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], + sourceType: "script", + + range: [73, 182], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..ac1fdd2c06ee --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,216 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-readonly-parameter-properties TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [87, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [98, 99], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [104, 112], + loc: { + start: { column: 4, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "firstName", + + range: [113, 122], + loc: { + start: { column: 13, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [122, 123], + loc: { + start: { column: 22, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [124, 130], + loc: { + start: { column: 24, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [130, 131], + loc: { + start: { column: 30, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [136, 144], + loc: { + start: { column: 4, line: 6 }, + end: { column: 12, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "lastName", + + range: [145, 153], + loc: { + start: { column: 13, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [153, 154], + loc: { + start: { column: 21, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [155, 161], + loc: { + start: { column: 23, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [162, 163], + loc: { + start: { column: 30, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + String { + type: "String", + value: "'Smith'", + + range: [164, 171], + loc: { + start: { column: 32, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [171, 172], + loc: { + start: { column: 39, line: 6 }, + end: { column: 40, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [175, 176], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [177, 178], + loc: { + start: { column: 4, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [178, 179], + loc: { + start: { column: 5, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [180, 181], + loc: { + start: { column: 0, line: 8 }, + end: { column: 1, line: 8 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..d53b81a40d23 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/3-Babel-AST.shot @@ -0,0 +1,190 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-readonly-parameter-properties Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [87, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: "constructor", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [177, 179], + loc: { + start: { column: 4, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: "TSParameterProperty", + parameter: Identifier { + type: "Identifier", + name: "firstName", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [124, 130], + loc: { + start: { column: 24, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + + range: [122, 130], + loc: { + start: { column: 22, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + + range: [113, 130], + loc: { + start: { column: 13, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + readonly: true, + + range: [104, 130], + loc: { + start: { column: 4, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + TSParameterProperty { + type: "TSParameterProperty", + parameter: AssignmentPattern { + type: "AssignmentPattern", + left: Identifier { + type: "Identifier", + name: "lastName", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [155, 161], + loc: { + start: { column: 23, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + + range: [153, 161], + loc: { + start: { column: 21, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + + range: [145, 161], + loc: { + start: { column: 13, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + right: Literal { + type: "Literal", + raw: "'Smith'", + value: "Smith", + + range: [164, 171], + loc: { + start: { column: 32, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + + range: [145, 171], + loc: { + start: { column: 13, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + readonly: true, + + range: [136, 171], + loc: { + start: { column: 4, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + ], + + range: [98, 179], + loc: { + start: { column: 13, line: 4 }, + end: { column: 6, line: 7 }, + }, + }, + + range: [87, 179], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 7 }, + }, + }, + ], + + range: [83, 181], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 181], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], + sourceType: "script", + + range: [73, 182], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..94b3150c7fef --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,216 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-readonly-parameter-properties Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [87, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [98, 99], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [104, 112], + loc: { + start: { column: 4, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "firstName", + + range: [113, 122], + loc: { + start: { column: 13, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [122, 123], + loc: { + start: { column: 22, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [124, 130], + loc: { + start: { column: 24, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [130, 131], + loc: { + start: { column: 30, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [136, 144], + loc: { + start: { column: 4, line: 6 }, + end: { column: 12, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "lastName", + + range: [145, 153], + loc: { + start: { column: 13, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [153, 154], + loc: { + start: { column: 21, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [155, 161], + loc: { + start: { column: 23, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [162, 163], + loc: { + start: { column: 30, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + String { + type: "String", + value: "'Smith'", + + range: [164, 171], + loc: { + start: { column: 32, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [171, 172], + loc: { + start: { column: 39, line: 6 }, + end: { column: 40, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [175, 176], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [177, 178], + loc: { + start: { column: 4, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [178, 179], + loc: { + start: { column: 5, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [180, 181], + loc: { + start: { column: 0, line: 8 }, + end: { column: 1, line: 8 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..c3267c2f1f7e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,195 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-readonly-parameter-properties AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'constructor', + + range: [87, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: 'constructor', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [177, 179], + loc: { + start: { column: 4, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: 'TSParameterProperty', + parameter: Identifier { + type: 'Identifier', + name: 'firstName', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [124, 130], + loc: { + start: { column: 24, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + + range: [122, 130], + loc: { + start: { column: 22, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + + range: [113, 130], + loc: { + start: { column: 13, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + readonly: true, + + range: [104, 130], + loc: { + start: { column: 4, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + TSParameterProperty { + type: 'TSParameterProperty', + parameter: AssignmentPattern { + type: 'AssignmentPattern', + left: Identifier { + type: 'Identifier', + name: 'lastName', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [155, 161], + loc: { + start: { column: 23, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + + range: [153, 161], + loc: { + start: { column: 21, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + + range: [145, 161], + loc: { + start: { column: 13, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + right: Literal { + type: 'Literal', + raw: '\\\\'Smith\\\\'', + value: 'Smith', + + range: [164, 171], + loc: { + start: { column: 32, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + + range: [145, 171], + loc: { + start: { column: 13, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + readonly: true, + + range: [136, 171], + loc: { + start: { column: 4, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + ], + + range: [98, 179], + loc: { + start: { column: 13, line: 4 }, + end: { column: 6, line: 7 }, + }, + }, + + range: [87, 179], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 7 }, + }, + }, + ], + + range: [83, 181], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 181], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 182], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..41fed5182378 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-readonly-parameter-properties AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/fixture.ts new file mode 100644 index 000000000000..1eeebb797e81 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + public readonly foo = 'string'; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..3bdd5c14111b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,83 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-readonly-property TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + accessibility: "public", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [103, 106], + loc: { + start: { column: 18, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + override: false, + readonly: true, + static: false, + value: Literal { + type: "Literal", + raw: "'string'", + value: "string", + + range: [109, 117], + loc: { + start: { column: 24, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + + range: [87, 118], + loc: { + start: { column: 2, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + + range: [83, 120], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 120], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..92836210c15c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-readonly-property TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [94, 102], + loc: { + start: { column: 9, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [103, 106], + loc: { + start: { column: 18, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [107, 108], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + String { + type: "String", + value: "'string'", + + range: [109, 117], + loc: { + start: { column: 24, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [117, 118], + loc: { + start: { column: 32, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [119, 120], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..e4aac92f2fa3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/3-Babel-AST.shot @@ -0,0 +1,81 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-readonly-property Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + accessibility: "public", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [103, 106], + loc: { + start: { column: 18, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + readonly: true, + static: false, + value: Literal { + type: "Literal", + raw: "'string'", + value: "string", + + range: [109, 117], + loc: { + start: { column: 24, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + + range: [87, 118], + loc: { + start: { column: 2, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + + range: [83, 120], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 120], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..d0d2888d8dc8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-readonly-property Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [94, 102], + loc: { + start: { column: 9, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [103, 106], + loc: { + start: { column: 18, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [107, 108], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + String { + type: "String", + value: "'string'", + + range: [109, 117], + loc: { + start: { column: 24, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [117, 118], + loc: { + start: { column: 32, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [119, 120], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..94c72eab163a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,87 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-readonly-property AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + accessibility: 'public', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'foo', + + range: [103, 106], + loc: { + start: { column: 18, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, +- override: false, + readonly: true, + static: false, + value: Literal { + type: 'Literal', + raw: '\\\\'string\\\\'', + value: 'string', + + range: [109, 117], + loc: { + start: { column: 24, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + + range: [87, 118], + loc: { + start: { column: 2, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + + range: [83, 120], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 120], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..6eb45fe14c70 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,112 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-readonly-property AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'readonly', + + range: [94, 102], + loc: { + start: { column: 9, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'foo', + + range: [103, 106], + loc: { + start: { column: 18, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [107, 108], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + String { + type: 'String', + value: '\\\\'string\\\\'', + + range: [109, 117], + loc: { + start: { column: 24, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [117, 118], + loc: { + start: { column: 32, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [119, 120], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/fixture.ts new file mode 100644 index 000000000000..0e2442e17a9d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..7bf59de03daa --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,97 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter-default TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [92, 94], + loc: { + start: { column: 19, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + default: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Bar", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + out: false, + + range: [83, 90], + loc: { + start: { column: 10, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ], + + range: [82, 91], + loc: { + start: { column: 9, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..e6eae92d6336 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter-default TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..19139ae54935 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/3-Babel-AST.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter-default Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [92, 94], + loc: { + start: { column: 19, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + default: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Bar", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + name: "T", + + range: [83, 90], + loc: { + start: { column: 10, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ], + + range: [82, 91], + loc: { + start: { column: 9, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..057ad740b119 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter-default Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..efd120448d33 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,102 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter-default AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [92, 94], + loc: { + start: { column: 19, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + default: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'Bar', + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [83, 84], +- loc: { +- start: { column: 10, line: 3 }, +- end: { column: 11, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [83, 90], + loc: { + start: { column: 10, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ], + + range: [82, 91], + loc: { + start: { column: 9, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..29c1bb7c0acb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter-default AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/fixture.ts new file mode 100644 index 000000000000..5c8d7ab27369 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class A<__P> {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..11e13c3a1d9d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,78 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter-underscore TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [86, 88], + loc: { + start: { column: 13, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "A", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "__P", + + range: [81, 84], + loc: { + start: { column: 8, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + out: false, + + range: [81, 84], + loc: { + start: { column: 8, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + ], + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [73, 88], + loc: { + start: { column: 0, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 89], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..f8d9b4b70902 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter-underscore TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "__P", + + range: [81, 84], + loc: { + start: { column: 8, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..24e86adb6e42 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/3-Babel-AST.shot @@ -0,0 +1,67 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter-underscore Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [86, 88], + loc: { + start: { column: 13, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "A", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "__P", + + range: [81, 84], + loc: { + start: { column: 8, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + ], + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [73, 88], + loc: { + start: { column: 0, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 89], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..86d6305208a0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter-underscore Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "__P", + + range: [81, 84], + loc: { + start: { column: 8, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..da8b2d5230bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,83 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter-underscore AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [86, 88], + loc: { + start: { column: 13, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'A', + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: '__P', +- +- range: [81, 84], +- loc: { +- start: { column: 8, line: 3 }, +- end: { column: 11, line: 3 }, +- }, +- }, +- out: false, ++ name: '__P', + + range: [81, 84], + loc: { + start: { column: 8, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + ], + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [73, 88], + loc: { + start: { column: 0, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 89], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..6de078f40c4c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter-underscore AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/fixture.ts new file mode 100644 index 000000000000..54ddd48c9d89 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..f4a699b14144 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,78 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [86, 88], + loc: { + start: { column: 13, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + out: false, + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + ], + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [73, 88], + loc: { + start: { column: 0, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 89], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..e9064fb027c3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..7ebae4004153 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/3-Babel-AST.shot @@ -0,0 +1,67 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [86, 88], + loc: { + start: { column: 13, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + ], + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [73, 88], + loc: { + start: { column: 0, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 89], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..20178ad3e079 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..28d9a945fca1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,83 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [86, 88], + loc: { + start: { column: 13, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [83, 84], +- loc: { +- start: { column: 10, line: 3 }, +- end: { column: 11, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + ], + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [73, 88], + loc: { + start: { column: 0, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 89], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..1a4e061b71a5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/fixture.ts new file mode 100644 index 000000000000..01b14ebfc7b2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +const enum Foo { + foo = 1, + bar, +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..c3f47c18754d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,87 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics const-enum TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSEnumDeclaration { + type: "TSEnumDeclaration", + const: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [84, 87], + loc: { + start: { column: 11, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + members: Array [ + TSEnumMember { + type: "TSEnumMember", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [92, 95], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + initializer: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [98, 99], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [92, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + TSEnumMember { + type: "TSEnumMember", + id: Identifier { + type: "Identifier", + name: "bar", + + range: [103, 106], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + + range: [103, 106], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + ], + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..416f2d1798dc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics const-enum TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "const", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "enum", + + range: [79, 83], + loc: { + start: { column: 6, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [84, 87], + loc: { + start: { column: 11, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [92, 95], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [96, 97], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [98, 99], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [99, 100], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [103, 106], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [106, 107], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [108, 109], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..ee0931e98c6f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/3-Babel-AST.shot @@ -0,0 +1,87 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics const-enum Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSEnumDeclaration { + type: "TSEnumDeclaration", + const: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [84, 87], + loc: { + start: { column: 11, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + members: Array [ + TSEnumMember { + type: "TSEnumMember", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [92, 95], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + initializer: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [98, 99], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [92, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + TSEnumMember { + type: "TSEnumMember", + id: Identifier { + type: "Identifier", + name: "bar", + + range: [103, 106], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + + range: [103, 106], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + ], + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..88bda4bf8a63 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics const-enum Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "const", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "enum", + + range: [79, 83], + loc: { + start: { column: 6, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [84, 87], + loc: { + start: { column: 11, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [92, 95], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [96, 97], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [98, 99], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [99, 100], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [103, 106], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [106, 107], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [108, 109], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..51feccb1a784 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics const-enum AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..d0a042c21279 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,122 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics const-enum AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'const', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'enum', + + range: [79, 83], + loc: { + start: { column: 6, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [84, 87], + loc: { + start: { column: 11, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'foo', + + range: [92, 95], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [96, 97], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [98, 99], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [99, 100], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar', + + range: [103, 106], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [106, 107], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [108, 109], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/fixture.ts new file mode 100644 index 000000000000..9275297a5f75 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +declare class Foo { + bar?(): any; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..9e10153775b4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,105 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics declare-class-with-optional-method TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [95, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + kind: "method", + optional: true, + override: false, + static: false, + value: TSEmptyBodyFunctionExpression { + type: "TSEmptyBodyFunctionExpression", + async: false, + body: null, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [103, 106], + loc: { + start: { column: 10, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [101, 106], + loc: { + start: { column: 8, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [99, 107], + loc: { + start: { column: 6, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + + range: [95, 107], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + ], + + range: [91, 109], + loc: { + start: { column: 18, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + declare: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + superClass: null, + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..2fc4fcc17d7b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics declare-class-with-optional-method TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [81, 86], + loc: { + start: { column: 8, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [95, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [98, 99], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [99, 100], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [100, 101], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [101, 102], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [103, 106], + loc: { + start: { column: 10, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [106, 107], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [108, 109], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..d9a6b865e20a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/3-Babel-AST.shot @@ -0,0 +1,103 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics declare-class-with-optional-method Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [95, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + kind: "method", + optional: true, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [103, 106], + loc: { + start: { column: 10, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [101, 106], + loc: { + start: { column: 8, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [99, 107], + loc: { + start: { column: 6, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + + range: [95, 107], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + ], + + range: [91, 109], + loc: { + start: { column: 18, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + declare: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + superClass: null, + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..7dca17e9213c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics declare-class-with-optional-method Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [81, 86], + loc: { + start: { column: 8, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [95, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [98, 99], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [99, 100], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [100, 101], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [101, 102], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [103, 106], + loc: { + start: { column: 10, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [106, 107], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [108, 109], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..7d0c4c30d1a3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,111 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics declare-class-with-optional-method AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'bar', + + range: [95, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + kind: 'method', + optional: true, +- override: false, + static: false, +- value: TSEmptyBodyFunctionExpression { +- type: 'TSEmptyBodyFunctionExpression', ++ value: FunctionExpression { ++ type: 'FunctionExpression', + async: false, +- body: null, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSAnyKeyword { + type: 'TSAnyKeyword', + + range: [103, 106], + loc: { + start: { column: 10, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [101, 106], + loc: { + start: { column: 8, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [99, 107], + loc: { + start: { column: 6, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + + range: [95, 107], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + ], + + range: [91, 109], + loc: { + start: { column: 18, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + declare: true, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + superClass: null, + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..bb5e416f29d3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics declare-class-with-optional-method AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/fixture.ts new file mode 100644 index 000000000000..6a49c00bbc61 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +declare function foo(bar: string): string; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..0c00814dcfea --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,87 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics declare-function TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSDeclareFunction { + type: "TSDeclareFunction", + async: false, + declare: true, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "bar", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [97, 105], + loc: { + start: { column: 24, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [94, 105], + loc: { + start: { column: 21, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + + range: [106, 114], + loc: { + start: { column: 33, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + + range: [73, 115], + loc: { + start: { column: 0, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 116], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..345e3996759a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics declare-function TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [81, 89], + loc: { + start: { column: 8, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..d1dad55a9a28 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/3-Babel-AST.shot @@ -0,0 +1,87 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics declare-function Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSDeclareFunction { + type: "TSDeclareFunction", + async: false, + declare: true, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "bar", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [97, 105], + loc: { + start: { column: 24, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [94, 105], + loc: { + start: { column: 21, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + + range: [106, 114], + loc: { + start: { column: 33, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + + range: [73, 115], + loc: { + start: { column: 0, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 116], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..f2f472092073 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics declare-function Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [81, 89], + loc: { + start: { column: 8, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..286d6f2f74f8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics declare-function AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..2c366b3521d5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics declare-function AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/fixture.ts new file mode 100644 index 000000000000..7e798726ab07 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +({ + foo: { bar: { baz: [a, { foo: [x] = [3] } = { foo: [2] }] = [] } = {} } = {}, +} = { foo: { bar: { baz: [2, { foo: [3] }] } } }); diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..e3d7ca759c86 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,546 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment-nested TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: ObjectPattern { + type: "ObjectPattern", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [78, 81], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: AssignmentPattern { + type: "AssignmentPattern", + left: ObjectPattern { + type: "ObjectPattern", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [85, 88], + loc: { + start: { column: 9, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: AssignmentPattern { + type: "AssignmentPattern", + left: ObjectPattern { + type: "ObjectPattern", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [92, 95], + loc: { + start: { column: 16, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: AssignmentPattern { + type: "AssignmentPattern", + left: ArrayPattern { + type: "ArrayPattern", + elements: Array [ + Identifier { + type: "Identifier", + name: "a", + + range: [98, 99], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + AssignmentPattern { + type: "AssignmentPattern", + left: ObjectPattern { + type: "ObjectPattern", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [103, 106], + loc: { + start: { column: 27, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: AssignmentPattern { + type: "AssignmentPattern", + left: ArrayPattern { + type: "ArrayPattern", + elements: Array [ + Identifier { + type: "Identifier", + name: "x", + + range: [109, 110], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + ], + + range: [108, 111], + loc: { + start: { column: 32, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + right: ArrayExpression { + type: "ArrayExpression", + elements: Array [ + Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [115, 116], + loc: { + start: { column: 39, line: 4 }, + end: { column: 40, line: 4 }, + }, + }, + ], + + range: [114, 117], + loc: { + start: { column: 38, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + + range: [108, 117], + loc: { + start: { column: 32, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + + range: [103, 117], + loc: { + start: { column: 27, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + ], + + range: [101, 119], + loc: { + start: { column: 25, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + right: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [124, 127], + loc: { + start: { column: 48, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: ArrayExpression { + type: "ArrayExpression", + elements: Array [ + Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [130, 131], + loc: { + start: { column: 54, line: 4 }, + end: { column: 55, line: 4 }, + }, + }, + ], + + range: [129, 132], + loc: { + start: { column: 53, line: 4 }, + end: { column: 56, line: 4 }, + }, + }, + + range: [124, 132], + loc: { + start: { column: 48, line: 4 }, + end: { column: 56, line: 4 }, + }, + }, + ], + + range: [122, 134], + loc: { + start: { column: 46, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + + range: [101, 134], + loc: { + start: { column: 25, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + ], + + range: [97, 135], + loc: { + start: { column: 21, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + right: ArrayExpression { + type: "ArrayExpression", + elements: Array [], + + range: [138, 140], + loc: { + start: { column: 62, line: 4 }, + end: { column: 64, line: 4 }, + }, + }, + + range: [97, 140], + loc: { + start: { column: 21, line: 4 }, + end: { column: 64, line: 4 }, + }, + }, + + range: [92, 140], + loc: { + start: { column: 16, line: 4 }, + end: { column: 64, line: 4 }, + }, + }, + ], + + range: [90, 142], + loc: { + start: { column: 14, line: 4 }, + end: { column: 66, line: 4 }, + }, + }, + right: ObjectExpression { + type: "ObjectExpression", + properties: Array [], + + range: [145, 147], + loc: { + start: { column: 69, line: 4 }, + end: { column: 71, line: 4 }, + }, + }, + + range: [90, 147], + loc: { + start: { column: 14, line: 4 }, + end: { column: 71, line: 4 }, + }, + }, + + range: [85, 147], + loc: { + start: { column: 9, line: 4 }, + end: { column: 71, line: 4 }, + }, + }, + ], + + range: [83, 149], + loc: { + start: { column: 7, line: 4 }, + end: { column: 73, line: 4 }, + }, + }, + right: ObjectExpression { + type: "ObjectExpression", + properties: Array [], + + range: [152, 154], + loc: { + start: { column: 76, line: 4 }, + end: { column: 78, line: 4 }, + }, + }, + + range: [83, 154], + loc: { + start: { column: 7, line: 4 }, + end: { column: 78, line: 4 }, + }, + }, + + range: [78, 154], + loc: { + start: { column: 2, line: 4 }, + end: { column: 78, line: 4 }, + }, + }, + ], + + range: [74, 157], + loc: { + start: { column: 1, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + operator: "=", + right: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [162, 165], + loc: { + start: { column: 6, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [169, 172], + loc: { + start: { column: 13, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [176, 179], + loc: { + start: { column: 20, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: ArrayExpression { + type: "ArrayExpression", + elements: Array [ + Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [182, 183], + loc: { + start: { column: 26, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [187, 190], + loc: { + start: { column: 31, line: 5 }, + end: { column: 34, line: 5 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: ArrayExpression { + type: "ArrayExpression", + elements: Array [ + Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [193, 194], + loc: { + start: { column: 37, line: 5 }, + end: { column: 38, line: 5 }, + }, + }, + ], + + range: [192, 195], + loc: { + start: { column: 36, line: 5 }, + end: { column: 39, line: 5 }, + }, + }, + + range: [187, 195], + loc: { + start: { column: 31, line: 5 }, + end: { column: 39, line: 5 }, + }, + }, + ], + + range: [185, 197], + loc: { + start: { column: 29, line: 5 }, + end: { column: 41, line: 5 }, + }, + }, + ], + + range: [181, 198], + loc: { + start: { column: 25, line: 5 }, + end: { column: 42, line: 5 }, + }, + }, + + range: [176, 198], + loc: { + start: { column: 20, line: 5 }, + end: { column: 42, line: 5 }, + }, + }, + ], + + range: [174, 200], + loc: { + start: { column: 18, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + + range: [169, 200], + loc: { + start: { column: 13, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + ], + + range: [167, 202], + loc: { + start: { column: 11, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + + range: [162, 202], + loc: { + start: { column: 6, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + ], + + range: [160, 204], + loc: { + start: { column: 4, line: 5 }, + end: { column: 48, line: 5 }, + }, + }, + + range: [74, 204], + loc: { + start: { column: 1, line: 3 }, + end: { column: 48, line: 5 }, + }, + }, + + range: [73, 206], + loc: { + start: { column: 0, line: 3 }, + end: { column: 50, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 207], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..a27b0be3383a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,726 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment-nested TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [78, 81], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [81, 82], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [85, 88], + loc: { + start: { column: 9, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [88, 89], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [90, 91], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [92, 95], + loc: { + start: { column: 16, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [95, 96], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [97, 98], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [98, 99], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [99, 100], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [101, 102], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [103, 106], + loc: { + start: { column: 27, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [106, 107], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [108, 109], + loc: { + start: { column: 32, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [109, 110], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [110, 111], + loc: { + start: { column: 34, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [112, 113], + loc: { + start: { column: 36, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [114, 115], + loc: { + start: { column: 38, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [115, 116], + loc: { + start: { column: 39, line: 4 }, + end: { column: 40, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [116, 117], + loc: { + start: { column: 40, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [118, 119], + loc: { + start: { column: 42, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [120, 121], + loc: { + start: { column: 44, line: 4 }, + end: { column: 45, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [122, 123], + loc: { + start: { column: 46, line: 4 }, + end: { column: 47, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [124, 127], + loc: { + start: { column: 48, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [127, 128], + loc: { + start: { column: 51, line: 4 }, + end: { column: 52, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [129, 130], + loc: { + start: { column: 53, line: 4 }, + end: { column: 54, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [130, 131], + loc: { + start: { column: 54, line: 4 }, + end: { column: 55, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [131, 132], + loc: { + start: { column: 55, line: 4 }, + end: { column: 56, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [133, 134], + loc: { + start: { column: 57, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [134, 135], + loc: { + start: { column: 58, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [136, 137], + loc: { + start: { column: 60, line: 4 }, + end: { column: 61, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [138, 139], + loc: { + start: { column: 62, line: 4 }, + end: { column: 63, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [139, 140], + loc: { + start: { column: 63, line: 4 }, + end: { column: 64, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [141, 142], + loc: { + start: { column: 65, line: 4 }, + end: { column: 66, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [143, 144], + loc: { + start: { column: 67, line: 4 }, + end: { column: 68, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [145, 146], + loc: { + start: { column: 69, line: 4 }, + end: { column: 70, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [146, 147], + loc: { + start: { column: 70, line: 4 }, + end: { column: 71, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [148, 149], + loc: { + start: { column: 72, line: 4 }, + end: { column: 73, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [150, 151], + loc: { + start: { column: 74, line: 4 }, + end: { column: 75, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [152, 153], + loc: { + start: { column: 76, line: 4 }, + end: { column: 77, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [153, 154], + loc: { + start: { column: 77, line: 4 }, + end: { column: 78, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [154, 155], + loc: { + start: { column: 78, line: 4 }, + end: { column: 79, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [156, 157], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [158, 159], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [160, 161], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [162, 165], + loc: { + start: { column: 6, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [165, 166], + loc: { + start: { column: 9, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [167, 168], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [169, 172], + loc: { + start: { column: 13, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [172, 173], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [174, 175], + loc: { + start: { column: 18, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [176, 179], + loc: { + start: { column: 20, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [179, 180], + loc: { + start: { column: 23, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [181, 182], + loc: { + start: { column: 25, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [182, 183], + loc: { + start: { column: 26, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [183, 184], + loc: { + start: { column: 27, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [185, 186], + loc: { + start: { column: 29, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [187, 190], + loc: { + start: { column: 31, line: 5 }, + end: { column: 34, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [190, 191], + loc: { + start: { column: 34, line: 5 }, + end: { column: 35, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [192, 193], + loc: { + start: { column: 36, line: 5 }, + end: { column: 37, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [193, 194], + loc: { + start: { column: 37, line: 5 }, + end: { column: 38, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [194, 195], + loc: { + start: { column: 38, line: 5 }, + end: { column: 39, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [196, 197], + loc: { + start: { column: 40, line: 5 }, + end: { column: 41, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [197, 198], + loc: { + start: { column: 41, line: 5 }, + end: { column: 42, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [199, 200], + loc: { + start: { column: 43, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [201, 202], + loc: { + start: { column: 45, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [203, 204], + loc: { + start: { column: 47, line: 5 }, + end: { column: 48, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [204, 205], + loc: { + start: { column: 48, line: 5 }, + end: { column: 49, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [205, 206], + loc: { + start: { column: 49, line: 5 }, + end: { column: 50, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..3228b768da12 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/3-Babel-AST.shot @@ -0,0 +1,546 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment-nested Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: ObjectPattern { + type: "ObjectPattern", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [78, 81], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: AssignmentPattern { + type: "AssignmentPattern", + left: ObjectPattern { + type: "ObjectPattern", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [85, 88], + loc: { + start: { column: 9, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: AssignmentPattern { + type: "AssignmentPattern", + left: ObjectPattern { + type: "ObjectPattern", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [92, 95], + loc: { + start: { column: 16, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: AssignmentPattern { + type: "AssignmentPattern", + left: ArrayPattern { + type: "ArrayPattern", + elements: Array [ + Identifier { + type: "Identifier", + name: "a", + + range: [98, 99], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + AssignmentPattern { + type: "AssignmentPattern", + left: ObjectPattern { + type: "ObjectPattern", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [103, 106], + loc: { + start: { column: 27, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: AssignmentPattern { + type: "AssignmentPattern", + left: ArrayPattern { + type: "ArrayPattern", + elements: Array [ + Identifier { + type: "Identifier", + name: "x", + + range: [109, 110], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + ], + + range: [108, 111], + loc: { + start: { column: 32, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + right: ArrayExpression { + type: "ArrayExpression", + elements: Array [ + Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [115, 116], + loc: { + start: { column: 39, line: 4 }, + end: { column: 40, line: 4 }, + }, + }, + ], + + range: [114, 117], + loc: { + start: { column: 38, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + + range: [108, 117], + loc: { + start: { column: 32, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + + range: [103, 117], + loc: { + start: { column: 27, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + ], + + range: [101, 119], + loc: { + start: { column: 25, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + right: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [124, 127], + loc: { + start: { column: 48, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: ArrayExpression { + type: "ArrayExpression", + elements: Array [ + Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [130, 131], + loc: { + start: { column: 54, line: 4 }, + end: { column: 55, line: 4 }, + }, + }, + ], + + range: [129, 132], + loc: { + start: { column: 53, line: 4 }, + end: { column: 56, line: 4 }, + }, + }, + + range: [124, 132], + loc: { + start: { column: 48, line: 4 }, + end: { column: 56, line: 4 }, + }, + }, + ], + + range: [122, 134], + loc: { + start: { column: 46, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + + range: [101, 134], + loc: { + start: { column: 25, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + ], + + range: [97, 135], + loc: { + start: { column: 21, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + right: ArrayExpression { + type: "ArrayExpression", + elements: Array [], + + range: [138, 140], + loc: { + start: { column: 62, line: 4 }, + end: { column: 64, line: 4 }, + }, + }, + + range: [97, 140], + loc: { + start: { column: 21, line: 4 }, + end: { column: 64, line: 4 }, + }, + }, + + range: [92, 140], + loc: { + start: { column: 16, line: 4 }, + end: { column: 64, line: 4 }, + }, + }, + ], + + range: [90, 142], + loc: { + start: { column: 14, line: 4 }, + end: { column: 66, line: 4 }, + }, + }, + right: ObjectExpression { + type: "ObjectExpression", + properties: Array [], + + range: [145, 147], + loc: { + start: { column: 69, line: 4 }, + end: { column: 71, line: 4 }, + }, + }, + + range: [90, 147], + loc: { + start: { column: 14, line: 4 }, + end: { column: 71, line: 4 }, + }, + }, + + range: [85, 147], + loc: { + start: { column: 9, line: 4 }, + end: { column: 71, line: 4 }, + }, + }, + ], + + range: [83, 149], + loc: { + start: { column: 7, line: 4 }, + end: { column: 73, line: 4 }, + }, + }, + right: ObjectExpression { + type: "ObjectExpression", + properties: Array [], + + range: [152, 154], + loc: { + start: { column: 76, line: 4 }, + end: { column: 78, line: 4 }, + }, + }, + + range: [83, 154], + loc: { + start: { column: 7, line: 4 }, + end: { column: 78, line: 4 }, + }, + }, + + range: [78, 154], + loc: { + start: { column: 2, line: 4 }, + end: { column: 78, line: 4 }, + }, + }, + ], + + range: [74, 157], + loc: { + start: { column: 1, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + operator: "=", + right: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [162, 165], + loc: { + start: { column: 6, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [169, 172], + loc: { + start: { column: 13, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [176, 179], + loc: { + start: { column: 20, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: ArrayExpression { + type: "ArrayExpression", + elements: Array [ + Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [182, 183], + loc: { + start: { column: 26, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [187, 190], + loc: { + start: { column: 31, line: 5 }, + end: { column: 34, line: 5 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: ArrayExpression { + type: "ArrayExpression", + elements: Array [ + Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [193, 194], + loc: { + start: { column: 37, line: 5 }, + end: { column: 38, line: 5 }, + }, + }, + ], + + range: [192, 195], + loc: { + start: { column: 36, line: 5 }, + end: { column: 39, line: 5 }, + }, + }, + + range: [187, 195], + loc: { + start: { column: 31, line: 5 }, + end: { column: 39, line: 5 }, + }, + }, + ], + + range: [185, 197], + loc: { + start: { column: 29, line: 5 }, + end: { column: 41, line: 5 }, + }, + }, + ], + + range: [181, 198], + loc: { + start: { column: 25, line: 5 }, + end: { column: 42, line: 5 }, + }, + }, + + range: [176, 198], + loc: { + start: { column: 20, line: 5 }, + end: { column: 42, line: 5 }, + }, + }, + ], + + range: [174, 200], + loc: { + start: { column: 18, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + + range: [169, 200], + loc: { + start: { column: 13, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + ], + + range: [167, 202], + loc: { + start: { column: 11, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + + range: [162, 202], + loc: { + start: { column: 6, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + ], + + range: [160, 204], + loc: { + start: { column: 4, line: 5 }, + end: { column: 48, line: 5 }, + }, + }, + + range: [74, 204], + loc: { + start: { column: 1, line: 3 }, + end: { column: 48, line: 5 }, + }, + }, + + range: [73, 206], + loc: { + start: { column: 0, line: 3 }, + end: { column: 50, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 207], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..fae6c164f813 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,726 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment-nested Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [78, 81], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [81, 82], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [85, 88], + loc: { + start: { column: 9, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [88, 89], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [90, 91], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [92, 95], + loc: { + start: { column: 16, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [95, 96], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [97, 98], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [98, 99], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [99, 100], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [101, 102], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [103, 106], + loc: { + start: { column: 27, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [106, 107], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [108, 109], + loc: { + start: { column: 32, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [109, 110], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [110, 111], + loc: { + start: { column: 34, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [112, 113], + loc: { + start: { column: 36, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [114, 115], + loc: { + start: { column: 38, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [115, 116], + loc: { + start: { column: 39, line: 4 }, + end: { column: 40, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [116, 117], + loc: { + start: { column: 40, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [118, 119], + loc: { + start: { column: 42, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [120, 121], + loc: { + start: { column: 44, line: 4 }, + end: { column: 45, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [122, 123], + loc: { + start: { column: 46, line: 4 }, + end: { column: 47, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [124, 127], + loc: { + start: { column: 48, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [127, 128], + loc: { + start: { column: 51, line: 4 }, + end: { column: 52, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [129, 130], + loc: { + start: { column: 53, line: 4 }, + end: { column: 54, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [130, 131], + loc: { + start: { column: 54, line: 4 }, + end: { column: 55, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [131, 132], + loc: { + start: { column: 55, line: 4 }, + end: { column: 56, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [133, 134], + loc: { + start: { column: 57, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [134, 135], + loc: { + start: { column: 58, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [136, 137], + loc: { + start: { column: 60, line: 4 }, + end: { column: 61, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [138, 139], + loc: { + start: { column: 62, line: 4 }, + end: { column: 63, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [139, 140], + loc: { + start: { column: 63, line: 4 }, + end: { column: 64, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [141, 142], + loc: { + start: { column: 65, line: 4 }, + end: { column: 66, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [143, 144], + loc: { + start: { column: 67, line: 4 }, + end: { column: 68, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [145, 146], + loc: { + start: { column: 69, line: 4 }, + end: { column: 70, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [146, 147], + loc: { + start: { column: 70, line: 4 }, + end: { column: 71, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [148, 149], + loc: { + start: { column: 72, line: 4 }, + end: { column: 73, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [150, 151], + loc: { + start: { column: 74, line: 4 }, + end: { column: 75, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [152, 153], + loc: { + start: { column: 76, line: 4 }, + end: { column: 77, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [153, 154], + loc: { + start: { column: 77, line: 4 }, + end: { column: 78, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [154, 155], + loc: { + start: { column: 78, line: 4 }, + end: { column: 79, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [156, 157], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [158, 159], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [160, 161], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [162, 165], + loc: { + start: { column: 6, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [165, 166], + loc: { + start: { column: 9, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [167, 168], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [169, 172], + loc: { + start: { column: 13, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [172, 173], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [174, 175], + loc: { + start: { column: 18, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [176, 179], + loc: { + start: { column: 20, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [179, 180], + loc: { + start: { column: 23, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [181, 182], + loc: { + start: { column: 25, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [182, 183], + loc: { + start: { column: 26, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [183, 184], + loc: { + start: { column: 27, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [185, 186], + loc: { + start: { column: 29, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [187, 190], + loc: { + start: { column: 31, line: 5 }, + end: { column: 34, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [190, 191], + loc: { + start: { column: 34, line: 5 }, + end: { column: 35, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [192, 193], + loc: { + start: { column: 36, line: 5 }, + end: { column: 37, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [193, 194], + loc: { + start: { column: 37, line: 5 }, + end: { column: 38, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [194, 195], + loc: { + start: { column: 38, line: 5 }, + end: { column: 39, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [196, 197], + loc: { + start: { column: 40, line: 5 }, + end: { column: 41, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [197, 198], + loc: { + start: { column: 41, line: 5 }, + end: { column: 42, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [199, 200], + loc: { + start: { column: 43, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [201, 202], + loc: { + start: { column: 45, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [203, 204], + loc: { + start: { column: 47, line: 5 }, + end: { column: 48, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [204, 205], + loc: { + start: { column: 48, line: 5 }, + end: { column: 49, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [205, 206], + loc: { + start: { column: 49, line: 5 }, + end: { column: 50, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..5dac5966e175 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment-nested AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..5e4d20207034 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment-nested AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/fixture.ts new file mode 100644 index 000000000000..d3feebb8bdf2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +({ foo = {} } = bar); diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..703efd77f943 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,108 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment-object TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: ObjectPattern { + type: "ObjectPattern", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [76, 79], + loc: { + start: { column: 3, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + kind: "init", + method: false, + shorthand: true, + value: AssignmentPattern { + type: "AssignmentPattern", + left: Identifier { + type: "Identifier", + name: "foo", + + range: [76, 79], + loc: { + start: { column: 3, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + right: ObjectExpression { + type: "ObjectExpression", + properties: Array [], + + range: [82, 84], + loc: { + start: { column: 9, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [76, 84], + loc: { + start: { column: 3, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [76, 84], + loc: { + start: { column: 3, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + ], + + range: [74, 86], + loc: { + start: { column: 1, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + operator: "=", + right: Identifier { + type: "Identifier", + name: "bar", + + range: [89, 92], + loc: { + start: { column: 16, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [74, 92], + loc: { + start: { column: 1, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..4e745aa08a19 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment-object TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [76, 79], + loc: { + start: { column: 3, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [89, 92], + loc: { + start: { column: 16, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..ea81150d36d6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/3-Babel-AST.shot @@ -0,0 +1,108 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment-object Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: ObjectPattern { + type: "ObjectPattern", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [76, 79], + loc: { + start: { column: 3, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + kind: "init", + method: false, + shorthand: true, + value: AssignmentPattern { + type: "AssignmentPattern", + left: Identifier { + type: "Identifier", + name: "foo", + + range: [76, 79], + loc: { + start: { column: 3, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + right: ObjectExpression { + type: "ObjectExpression", + properties: Array [], + + range: [82, 84], + loc: { + start: { column: 9, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [76, 84], + loc: { + start: { column: 3, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [76, 84], + loc: { + start: { column: 3, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + ], + + range: [74, 86], + loc: { + start: { column: 1, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + operator: "=", + right: Identifier { + type: "Identifier", + name: "bar", + + range: [89, 92], + loc: { + start: { column: 16, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [74, 92], + loc: { + start: { column: 1, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..e3e082df8c55 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment-object Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [76, 79], + loc: { + start: { column: 3, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [89, 92], + loc: { + start: { column: 16, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..ae08e0c3a918 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment-object AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..cdc6b9cb818f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment-object AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/fixture.ts new file mode 100644 index 000000000000..9947bb3fc949 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function Foo({ foo = [] } = bar) {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..d9ccb771cc44 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,132 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment-property TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [106, 108], + loc: { + start: { column: 33, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + params: Array [ + AssignmentPattern { + type: "AssignmentPattern", + left: ObjectPattern { + type: "ObjectPattern", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + kind: "init", + method: false, + shorthand: true, + value: AssignmentPattern { + type: "AssignmentPattern", + left: Identifier { + type: "Identifier", + name: "foo", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + right: ArrayExpression { + type: "ArrayExpression", + elements: Array [], + + range: [94, 96], + loc: { + start: { column: 21, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [88, 96], + loc: { + start: { column: 15, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [88, 96], + loc: { + start: { column: 15, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + + range: [86, 98], + loc: { + start: { column: 13, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + right: Identifier { + type: "Identifier", + name: "bar", + + range: [101, 104], + loc: { + start: { column: 28, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [86, 104], + loc: { + start: { column: 13, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..eaab980b2a5a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment-property TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [101, 104], + loc: { + start: { column: 28, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..e8864d887614 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/3-Babel-AST.shot @@ -0,0 +1,132 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment-property Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [106, 108], + loc: { + start: { column: 33, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + params: Array [ + AssignmentPattern { + type: "AssignmentPattern", + left: ObjectPattern { + type: "ObjectPattern", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + kind: "init", + method: false, + shorthand: true, + value: AssignmentPattern { + type: "AssignmentPattern", + left: Identifier { + type: "Identifier", + name: "foo", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + right: ArrayExpression { + type: "ArrayExpression", + elements: Array [], + + range: [94, 96], + loc: { + start: { column: 21, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [88, 96], + loc: { + start: { column: 15, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [88, 96], + loc: { + start: { column: 15, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + + range: [86, 98], + loc: { + start: { column: 13, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + right: Identifier { + type: "Identifier", + name: "bar", + + range: [101, 104], + loc: { + start: { column: 28, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [86, 104], + loc: { + start: { column: 13, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..94ccf0a90a74 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment-property Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [101, 104], + loc: { + start: { column: 28, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..c4b496ef8564 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment-property AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..cead1b4ea61e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment-property AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/fixture.ts new file mode 100644 index 000000000000..35403930b941 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +({ foo = [] } = bar); diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..7e21c0e04f1f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,108 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: ObjectPattern { + type: "ObjectPattern", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [76, 79], + loc: { + start: { column: 3, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + kind: "init", + method: false, + shorthand: true, + value: AssignmentPattern { + type: "AssignmentPattern", + left: Identifier { + type: "Identifier", + name: "foo", + + range: [76, 79], + loc: { + start: { column: 3, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + right: ArrayExpression { + type: "ArrayExpression", + elements: Array [], + + range: [82, 84], + loc: { + start: { column: 9, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [76, 84], + loc: { + start: { column: 3, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [76, 84], + loc: { + start: { column: 3, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + ], + + range: [74, 86], + loc: { + start: { column: 1, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + operator: "=", + right: Identifier { + type: "Identifier", + name: "bar", + + range: [89, 92], + loc: { + start: { column: 16, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [74, 92], + loc: { + start: { column: 1, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..c5f1197b65ec --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [76, 79], + loc: { + start: { column: 3, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [89, 92], + loc: { + start: { column: 16, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..d75443206541 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/3-Babel-AST.shot @@ -0,0 +1,108 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: ObjectPattern { + type: "ObjectPattern", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [76, 79], + loc: { + start: { column: 3, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + kind: "init", + method: false, + shorthand: true, + value: AssignmentPattern { + type: "AssignmentPattern", + left: Identifier { + type: "Identifier", + name: "foo", + + range: [76, 79], + loc: { + start: { column: 3, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + right: ArrayExpression { + type: "ArrayExpression", + elements: Array [], + + range: [82, 84], + loc: { + start: { column: 9, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [76, 84], + loc: { + start: { column: 3, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [76, 84], + loc: { + start: { column: 3, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + ], + + range: [74, 86], + loc: { + start: { column: 1, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + operator: "=", + right: Identifier { + type: "Identifier", + name: "bar", + + range: [89, 92], + loc: { + start: { column: 16, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [74, 92], + loc: { + start: { column: 1, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..17df5650457a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [76, 79], + loc: { + start: { column: 3, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [89, 92], + loc: { + start: { column: 16, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..004656cc596c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..0bb48bcd8ce4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics destructuring-assignment AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/fixture.ts new file mode 100644 index 000000000000..3731f057b130 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/fixture.ts @@ -0,0 +1,7 @@ +// TODO: This fixture might be too large, and if so should be split up. + +module foo { + 'use strict'; + var a = 1; + 'use strict'; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..b77fc06d204f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,129 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics directive-in-module TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + directive: "use strict", + expression: Literal { + type: "Literal", + raw: "'use strict'", + value: "use strict", + + range: [88, 100], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + + range: [88, 101], + loc: { + start: { column: 2, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "a", + + range: [108, 109], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [112, 113], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [108, 113], + loc: { + start: { column: 6, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + ], + kind: "var", + + range: [104, 114], + loc: { + start: { column: 2, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: Literal { + type: "Literal", + raw: "'use strict'", + value: "use strict", + + range: [117, 129], + loc: { + start: { column: 2, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + + range: [117, 130], + loc: { + start: { column: 2, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + ], + + range: [84, 132], + loc: { + start: { column: 11, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + + range: [73, 132], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 133], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..24b5e6e64f2a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics directive-in-module TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "module", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + String { + type: "String", + value: "'use strict'", + + range: [88, 100], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [100, 101], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "var", + + range: [104, 107], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [108, 109], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [110, 111], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [112, 113], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [113, 114], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + String { + type: "String", + value: "'use strict'", + + range: [117, 129], + loc: { + start: { column: 2, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [129, 130], + loc: { + start: { column: 14, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [131, 132], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..f82faa40a46b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/3-Babel-AST.shot @@ -0,0 +1,128 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics directive-in-module Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: Literal { + type: "Literal", + raw: "'use strict'", + value: "use strict", + + range: [88, 100], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + + range: [88, 101], + loc: { + start: { column: 2, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "a", + + range: [108, 109], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [112, 113], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [108, 113], + loc: { + start: { column: 6, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + ], + kind: "var", + + range: [104, 114], + loc: { + start: { column: 2, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: Literal { + type: "Literal", + raw: "'use strict'", + value: "use strict", + + range: [117, 129], + loc: { + start: { column: 2, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + + range: [117, 130], + loc: { + start: { column: 2, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + ], + + range: [84, 132], + loc: { + start: { column: 11, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + + range: [73, 132], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 133], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..87f723f8a28f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics directive-in-module Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "module", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + String { + type: "String", + value: "'use strict'", + + range: [88, 100], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [100, 101], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "var", + + range: [104, 107], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [108, 109], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [110, 111], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [112, 113], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [113, 114], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + String { + type: "String", + value: "'use strict'", + + range: [117, 129], + loc: { + start: { column: 2, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [129, 130], + loc: { + start: { column: 14, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [131, 132], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..c752ccbc4ea3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,133 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics directive-in-module AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleBlock { + type: 'TSModuleBlock', + body: Array [ + ExpressionStatement { + type: 'ExpressionStatement', +- directive: 'use strict', + expression: Literal { + type: 'Literal', + raw: '\\\\'use strict\\\\'', + value: 'use strict', + + range: [88, 100], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + + range: [88, 101], + loc: { + start: { column: 2, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'a', + + range: [108, 109], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [112, 113], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [108, 113], + loc: { + start: { column: 6, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + ], + kind: 'var', + + range: [104, 114], + loc: { + start: { column: 2, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + ExpressionStatement { + type: 'ExpressionStatement', + expression: Literal { + type: 'Literal', + raw: '\\\\'use strict\\\\'', + value: 'use strict', + + range: [117, 129], + loc: { + start: { column: 2, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + + range: [117, 130], + loc: { + start: { column: 2, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + ], + + range: [84, 132], + loc: { + start: { column: 11, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'foo', + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + + range: [73, 132], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 133], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..3d2476ad24a3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics directive-in-module AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/fixture.ts new file mode 100644 index 000000000000..de18a633d7eb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/fixture.ts @@ -0,0 +1,7 @@ +// TODO: This fixture might be too large, and if so should be split up. + +namespace foo { + 'use strict'; + var a = 1; + 'use strict'; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..0921c13c37c8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,129 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics directive-in-namespace TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + directive: "use strict", + expression: Literal { + type: "Literal", + raw: "'use strict'", + value: "use strict", + + range: [91, 103], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + + range: [91, 104], + loc: { + start: { column: 2, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "a", + + range: [111, 112], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [115, 116], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [111, 116], + loc: { + start: { column: 6, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + ], + kind: "var", + + range: [107, 117], + loc: { + start: { column: 2, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: Literal { + type: "Literal", + raw: "'use strict'", + value: "use strict", + + range: [120, 132], + loc: { + start: { column: 2, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + + range: [120, 133], + loc: { + start: { column: 2, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + ], + + range: [87, 135], + loc: { + start: { column: 14, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 135], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 136], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..a65a2098437c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics directive-in-namespace TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "namespace", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + String { + type: "String", + value: "'use strict'", + + range: [91, 103], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [103, 104], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "var", + + range: [107, 110], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [111, 112], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [113, 114], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [115, 116], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [116, 117], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + String { + type: "String", + value: "'use strict'", + + range: [120, 132], + loc: { + start: { column: 2, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [132, 133], + loc: { + start: { column: 14, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [134, 135], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..79bfb11b0650 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/3-Babel-AST.shot @@ -0,0 +1,128 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics directive-in-namespace Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: Literal { + type: "Literal", + raw: "'use strict'", + value: "use strict", + + range: [91, 103], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + + range: [91, 104], + loc: { + start: { column: 2, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "a", + + range: [111, 112], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [115, 116], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [111, 116], + loc: { + start: { column: 6, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + ], + kind: "var", + + range: [107, 117], + loc: { + start: { column: 2, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: Literal { + type: "Literal", + raw: "'use strict'", + value: "use strict", + + range: [120, 132], + loc: { + start: { column: 2, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + + range: [120, 133], + loc: { + start: { column: 2, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + ], + + range: [87, 135], + loc: { + start: { column: 14, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 135], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 136], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..d3ffef96096b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics directive-in-namespace Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "namespace", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + String { + type: "String", + value: "'use strict'", + + range: [91, 103], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [103, 104], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "var", + + range: [107, 110], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [111, 112], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [113, 114], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [115, 116], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [116, 117], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + String { + type: "String", + value: "'use strict'", + + range: [120, 132], + loc: { + start: { column: 2, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [132, 133], + loc: { + start: { column: 14, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [134, 135], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..d570c43e3eaf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,133 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics directive-in-namespace AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleBlock { + type: 'TSModuleBlock', + body: Array [ + ExpressionStatement { + type: 'ExpressionStatement', +- directive: 'use strict', + expression: Literal { + type: 'Literal', + raw: '\\\\'use strict\\\\'', + value: 'use strict', + + range: [91, 103], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + + range: [91, 104], + loc: { + start: { column: 2, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'a', + + range: [111, 112], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [115, 116], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [111, 116], + loc: { + start: { column: 6, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + ], + kind: 'var', + + range: [107, 117], + loc: { + start: { column: 2, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + ExpressionStatement { + type: 'ExpressionStatement', + expression: Literal { + type: 'Literal', + raw: '\\\\'use strict\\\\'', + value: 'use strict', + + range: [120, 132], + loc: { + start: { column: 2, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + + range: [120, 133], + loc: { + start: { column: 2, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + ], + + range: [87, 135], + loc: { + start: { column: 14, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'foo', + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 135], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 136], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..66a4e2578f60 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics directive-in-namespace AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/fixture.ts new file mode 100644 index 000000000000..1ff856a1b469 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +import('foo', { assert: { type: 'json' } }); diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..c00fcd9d0f45 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,124 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics dynamic-import-with-import-assertions TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ImportExpression { + type: "ImportExpression", + attributes: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "assert", + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "type", + + range: [99, 103], + loc: { + start: { column: 26, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: "'json'", + value: "json", + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [99, 111], + loc: { + start: { column: 26, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + ], + + range: [97, 113], + loc: { + start: { column: 24, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + + range: [89, 113], + loc: { + start: { column: 16, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + ], + + range: [87, 115], + loc: { + start: { column: 14, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + source: Literal { + type: "Literal", + raw: "'foo'", + value: "foo", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [73, 116], + loc: { + start: { column: 0, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + + range: [73, 117], + loc: { + start: { column: 0, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..67e2afdf9c10 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics dynamic-import-with-import-assertions TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "import", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + String { + type: "String", + value: "'foo'", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "assert", + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [99, 103], + loc: { + start: { column: 26, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + String { + type: "String", + value: "'json'", + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..a7171e48b381 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/3-Babel-AST.shot @@ -0,0 +1,124 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics dynamic-import-with-import-assertions Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ImportExpression { + type: "ImportExpression", + attributes: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "assert", + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "type", + + range: [99, 103], + loc: { + start: { column: 26, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: "'json'", + value: "json", + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [99, 111], + loc: { + start: { column: 26, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + ], + + range: [97, 113], + loc: { + start: { column: 24, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + + range: [89, 113], + loc: { + start: { column: 16, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + ], + + range: [87, 115], + loc: { + start: { column: 14, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + source: Literal { + type: "Literal", + raw: "'foo'", + value: "foo", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [73, 116], + loc: { + start: { column: 0, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + + range: [73, 117], + loc: { + start: { column: 0, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..66c8ab5e66c6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics dynamic-import-with-import-assertions Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "import", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + String { + type: "String", + value: "'foo'", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "assert", + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [99, 103], + loc: { + start: { column: 26, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + String { + type: "String", + value: "'json'", + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..30c981d13d04 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics dynamic-import-with-import-assertions AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..bd39373b6638 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics dynamic-import-with-import-assertions AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/fixture.ts new file mode 100644 index 000000000000..a76cc1143059 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export * from 'mod' assert { type: 'json' }; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..f72725a69e3c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,70 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-all-with-import-assertions TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportAllDeclaration { + type: "ExportAllDeclaration", + assertions: Array [ + ImportAttribute { + type: "ImportAttribute", + key: Identifier { + type: "Identifier", + name: "type", + + range: [102, 106], + loc: { + start: { column: 29, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + value: Literal { + type: "Literal", + raw: "'json'", + value: "json", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + + range: [102, 114], + loc: { + start: { column: 29, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + ], + exported: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [87, 92], + loc: { + start: { column: 14, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [73, 117], + loc: { + start: { column: 0, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..30298dec7c8f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-all-with-import-assertions TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "*", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [82, 86], + loc: { + start: { column: 9, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [87, 92], + loc: { + start: { column: 14, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "assert", + + range: [93, 99], + loc: { + start: { column: 20, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [102, 106], + loc: { + start: { column: 29, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + String { + type: "String", + value: "'json'", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..3a9248b8b18d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/3-Babel-AST.shot @@ -0,0 +1,70 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-all-with-import-assertions Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportAllDeclaration { + type: "ExportAllDeclaration", + assertions: Array [ + ImportAttribute { + type: "ImportAttribute", + key: Identifier { + type: "Identifier", + name: "type", + + range: [102, 106], + loc: { + start: { column: 29, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + value: Literal { + type: "Literal", + raw: "'json'", + value: "json", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + + range: [102, 114], + loc: { + start: { column: 29, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + ], + exported: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [87, 92], + loc: { + start: { column: 14, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [73, 117], + loc: { + start: { column: 0, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..51e7a9adfb32 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-all-with-import-assertions Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "*", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [82, 86], + loc: { + start: { column: 9, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [87, 92], + loc: { + start: { column: 14, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "assert", + + range: [93, 99], + loc: { + start: { column: 20, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [102, 106], + loc: { + start: { column: 29, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + String { + type: "String", + value: "'json'", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..2993c4da95d1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-all-with-import-assertions AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..254b706ab248 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-all-with-import-assertions AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/fixture.ts new file mode 100644 index 000000000000..eea99ba487f9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export as namespace a; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..50171dcd871c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,35 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-as-namespace TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSNamespaceExportDeclaration { + type: "TSNamespaceExportDeclaration", + id: Identifier { + type: "Identifier", + name: "a", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 96], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..27df99bbb748 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-as-namespace TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [80, 82], + loc: { + start: { column: 7, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "namespace", + + range: [83, 92], + loc: { + start: { column: 10, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..0f084acc686c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/3-Babel-AST.shot @@ -0,0 +1,35 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-as-namespace Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSNamespaceExportDeclaration { + type: "TSNamespaceExportDeclaration", + id: Identifier { + type: "Identifier", + name: "a", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 96], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..e2f6c5e52d51 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-as-namespace Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [80, 82], + loc: { + start: { column: 7, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "namespace", + + range: [83, 92], + loc: { + start: { column: 10, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..aa1998499a42 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-as-namespace AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..24b226e34c69 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-as-namespace AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/fixture.ts new file mode 100644 index 000000000000..bcd3b716861e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export = foo; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..dd6b69de77e4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,35 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-assignment TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSExportAssignment { + type: "TSExportAssignment", + expression: Identifier { + type: "Identifier", + name: "foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [73, 86], + loc: { + start: { column: 0, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 87], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..17aceaa21700 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-assignment TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..b81423a77ba8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/3-Babel-AST.shot @@ -0,0 +1,35 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-assignment Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSExportAssignment { + type: "TSExportAssignment", + expression: Identifier { + type: "Identifier", + name: "foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [73, 86], + loc: { + start: { column: 0, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 87], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..522c7fd7720b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-assignment Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..06a9e4da38ed --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,40 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-assignment AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSExportAssignment { + type: 'TSExportAssignment', + expression: Identifier { + type: 'Identifier', + name: 'foo', + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [73, 86], + loc: { + start: { column: 0, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [73, 87], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..ba3b0806d8d4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-assignment AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/fixture.ts new file mode 100644 index 000000000000..79677ef58bab --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export declare const enum Foo { + foo = 1, + bar, +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..028706dced8c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,101 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-declare-const-named-enum TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSEnumDeclaration { + type: "TSEnumDeclaration", + const: true, + declare: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + members: Array [ + TSEnumMember { + type: "TSEnumMember", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [107, 110], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + initializer: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [113, 114], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [107, 114], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + TSEnumMember { + type: "TSEnumMember", + id: Identifier { + type: "Identifier", + name: "bar", + + range: [118, 121], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + + range: [118, 121], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + ], + + range: [80, 124], + loc: { + start: { column: 7, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + exportKind: "type", + source: null, + specifiers: Array [], + + range: [73, 124], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "module", + + range: [73, 125], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..1bfa08b91700 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-declare-const-named-enum TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [80, 87], + loc: { + start: { column: 7, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [88, 93], + loc: { + start: { column: 15, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "enum", + + range: [94, 98], + loc: { + start: { column: 21, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [107, 110], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [111, 112], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [113, 114], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [114, 115], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [118, 121], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [121, 122], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [123, 124], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..cef70259602c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/3-Babel-AST.shot @@ -0,0 +1,101 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-declare-const-named-enum Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSEnumDeclaration { + type: "TSEnumDeclaration", + const: true, + declare: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + members: Array [ + TSEnumMember { + type: "TSEnumMember", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [107, 110], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + initializer: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [113, 114], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [107, 114], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + TSEnumMember { + type: "TSEnumMember", + id: Identifier { + type: "Identifier", + name: "bar", + + range: [118, 121], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + + range: [118, 121], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + ], + + range: [80, 124], + loc: { + start: { column: 7, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + exportKind: "type", + source: null, + specifiers: Array [], + + range: [73, 124], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 125], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..c949dd781ee7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-declare-const-named-enum Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [80, 87], + loc: { + start: { column: 7, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [88, 93], + loc: { + start: { column: 15, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "enum", + + range: [94, 98], + loc: { + start: { column: 21, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [107, 110], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [111, 112], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [113, 114], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [114, 115], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [118, 121], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [121, 122], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [123, 124], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..5dced47878b0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-declare-const-named-enum AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: TSEnumDeclaration { + type: 'TSEnumDeclaration', + const: true, + declare: true, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + members: Array [ + TSEnumMember { + type: 'TSEnumMember', + id: Identifier { + type: 'Identifier', + name: 'foo', + + range: [107, 110], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + initializer: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [113, 114], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [107, 114], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + TSEnumMember { + type: 'TSEnumMember', + id: Identifier { + type: 'Identifier', + name: 'bar', + + range: [118, 121], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + + range: [118, 121], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + ], + + range: [80, 124], + loc: { + start: { column: 7, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + exportKind: 'type', + source: null, + specifiers: Array [], + + range: [73, 124], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [73, 125], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..7dbe61863b8c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,142 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-declare-const-named-enum AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'export', + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'declare', + + range: [80, 87], + loc: { + start: { column: 7, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [88, 93], + loc: { + start: { column: 15, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'enum', + + range: [94, 98], + loc: { + start: { column: 21, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'foo', + + range: [107, 110], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [111, 112], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [113, 114], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [114, 115], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar', + + range: [118, 121], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [121, 122], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [123, 124], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/fixture.ts new file mode 100644 index 000000000000..c567e3e9fe41 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export declare enum Foo { + foo = 1, + bar, +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..7818df7d5267 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,100 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-declare-named-enum TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSEnumDeclaration { + type: "TSEnumDeclaration", + declare: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + members: Array [ + TSEnumMember { + type: "TSEnumMember", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [101, 104], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + initializer: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [107, 108], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [101, 108], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + TSEnumMember { + type: "TSEnumMember", + id: Identifier { + type: "Identifier", + name: "bar", + + range: [112, 115], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + + range: [112, 115], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + ], + + range: [80, 118], + loc: { + start: { column: 7, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + exportKind: "type", + source: null, + specifiers: Array [], + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "module", + + range: [73, 119], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..d3ed21ab1e3c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-declare-named-enum TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [80, 87], + loc: { + start: { column: 7, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "enum", + + range: [88, 92], + loc: { + start: { column: 15, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [101, 104], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [105, 106], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [107, 108], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [108, 109], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [112, 115], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [115, 116], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [117, 118], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..83d8fad96ccd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/3-Babel-AST.shot @@ -0,0 +1,100 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-declare-named-enum Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSEnumDeclaration { + type: "TSEnumDeclaration", + declare: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + members: Array [ + TSEnumMember { + type: "TSEnumMember", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [101, 104], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + initializer: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [107, 108], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [101, 108], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + TSEnumMember { + type: "TSEnumMember", + id: Identifier { + type: "Identifier", + name: "bar", + + range: [112, 115], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + + range: [112, 115], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + ], + + range: [80, 118], + loc: { + start: { column: 7, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + exportKind: "type", + source: null, + specifiers: Array [], + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 119], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..9de404e549e0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-declare-named-enum Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [80, 87], + loc: { + start: { column: 7, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "enum", + + range: [88, 92], + loc: { + start: { column: 15, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [101, 104], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [105, 106], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [107, 108], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [108, 109], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [112, 115], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [115, 116], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [117, 118], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..73d878a12ec5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,105 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-declare-named-enum AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: TSEnumDeclaration { + type: 'TSEnumDeclaration', + declare: true, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + members: Array [ + TSEnumMember { + type: 'TSEnumMember', + id: Identifier { + type: 'Identifier', + name: 'foo', + + range: [101, 104], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + initializer: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [107, 108], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [101, 108], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + TSEnumMember { + type: 'TSEnumMember', + id: Identifier { + type: 'Identifier', + name: 'bar', + + range: [112, 115], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + + range: [112, 115], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + ], + + range: [80, 118], + loc: { + start: { column: 7, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + exportKind: 'type', + source: null, + specifiers: Array [], + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [73, 119], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..00a19808b00a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,132 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-declare-named-enum AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'export', + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'declare', + + range: [80, 87], + loc: { + start: { column: 7, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'enum', + + range: [88, 92], + loc: { + start: { column: 15, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'foo', + + range: [101, 104], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [105, 106], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [107, 108], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [108, 109], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar', + + range: [112, 115], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [115, 116], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [117, 118], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/fixture.ts new file mode 100644 index 000000000000..10fa8469432c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export default class {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..26e794c23c8d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-default-class-with-generic TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [97, 99], + loc: { + start: { column: 24, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + id: null, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + out: false, + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [88, 99], + loc: { + start: { column: 15, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + exportKind: "value", + + range: [73, 99], + loc: { + start: { column: 0, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..f2757134db26 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-default-class-with-generic TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [80, 87], + loc: { + start: { column: 7, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [88, 93], + loc: { + start: { column: 15, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..fe8181bb0b6d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/3-Babel-AST.shot @@ -0,0 +1,68 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-default-class-with-generic Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [97, 99], + loc: { + start: { column: 24, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + id: null, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [88, 99], + loc: { + start: { column: 15, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + exportKind: "value", + + range: [73, 99], + loc: { + start: { column: 0, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..cc24ee4bf568 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-default-class-with-generic Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [80, 87], + loc: { + start: { column: 7, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [88, 93], + loc: { + start: { column: 15, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..48fca727adc1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,84 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-default-class-with-generic AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportDefaultDeclaration { + type: 'ExportDefaultDeclaration', + declaration: ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [97, 99], + loc: { + start: { column: 24, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + id: null, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [94, 95], +- loc: { +- start: { column: 21, line: 3 }, +- end: { column: 22, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [88, 99], + loc: { + start: { column: 15, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + exportKind: 'value', + + range: [73, 99], + loc: { + start: { column: 0, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + sourceType: 'module', + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..8d5ff09f62cd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-default-class-with-generic AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/fixture.ts new file mode 100644 index 000000000000..4cf5e8c53c34 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export default class {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..6f105eb8e620 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,100 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-default-class-with-multiple-generics TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [100, 102], + loc: { + start: { column: 27, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + id: null, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + out: false, + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "U", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + out: false, + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + ], + + range: [93, 99], + loc: { + start: { column: 20, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [88, 102], + loc: { + start: { column: 15, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + exportKind: "value", + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..654512d650e9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-default-class-with-multiple-generics TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [80, 87], + loc: { + start: { column: 7, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [88, 93], + loc: { + start: { column: 15, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..101882a55598 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/3-Babel-AST.shot @@ -0,0 +1,78 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-default-class-with-multiple-generics Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [100, 102], + loc: { + start: { column: 27, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + id: null, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + TSTypeParameter { + type: "TSTypeParameter", + name: "U", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + ], + + range: [93, 99], + loc: { + start: { column: 20, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [88, 102], + loc: { + start: { column: 15, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + exportKind: "value", + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..97637e9be818 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-default-class-with-multiple-generics Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [80, 87], + loc: { + start: { column: 7, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [88, 93], + loc: { + start: { column: 15, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..4ffda7290afb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-default-class-with-multiple-generics AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportDefaultDeclaration { + type: 'ExportDefaultDeclaration', + declaration: ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [100, 102], + loc: { + start: { column: 27, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + id: null, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [94, 95], +- loc: { +- start: { column: 21, line: 3 }, +- end: { column: 22, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'U', +- +- range: [97, 98], +- loc: { +- start: { column: 24, line: 3 }, +- end: { column: 25, line: 3 }, +- }, +- }, +- out: false, ++ name: 'U', + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + ], + + range: [93, 99], + loc: { + start: { column: 20, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [88, 102], + loc: { + start: { column: 15, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + exportKind: 'value', + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + sourceType: 'module', + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..5d40dc02e9d9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-default-class-with-multiple-generics AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/fixture.ts new file mode 100644 index 000000000000..8e1b9fb2263e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export default interface T { + method1(): void; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..00d14443f688 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-default-interface TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "method1", + + range: [104, 111], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + kind: "method", + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [115, 119], + loc: { + start: { column: 13, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + + range: [113, 119], + loc: { + start: { column: 11, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + + range: [104, 120], + loc: { + start: { column: 2, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + ], + + range: [100, 122], + loc: { + start: { column: 27, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "T", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [88, 122], + loc: { + start: { column: 15, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + exportKind: "value", + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "module", + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..b11f5b723a13 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-default-interface TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [80, 87], + loc: { + start: { column: 7, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "interface", + + range: [88, 97], + loc: { + start: { column: 15, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "method1", + + range: [104, 111], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [111, 112], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [112, 113], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [113, 114], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [115, 119], + loc: { + start: { column: 13, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [119, 120], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [121, 122], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..9aca3a9fb66a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/3-Babel-AST.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-default-interface Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "method1", + + range: [104, 111], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + kind: "method", + parameters: Array [], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [115, 119], + loc: { + start: { column: 13, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + + range: [113, 119], + loc: { + start: { column: 11, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + + range: [104, 120], + loc: { + start: { column: 2, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + ], + + range: [100, 122], + loc: { + start: { column: 27, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "T", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [88, 122], + loc: { + start: { column: 15, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + exportKind: "value", + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "module", + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..a5635f18ee2e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-default-interface Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [80, 87], + loc: { + start: { column: 7, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "interface", + + range: [88, 97], + loc: { + start: { column: 15, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "method1", + + range: [104, 111], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [111, 112], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [112, 113], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [113, 114], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [115, 119], + loc: { + start: { column: 13, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [119, 120], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [121, 122], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..201605ce2b53 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,102 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-default-interface AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportDefaultDeclaration { + type: 'ExportDefaultDeclaration', + declaration: TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [ + TSMethodSignature { + type: 'TSMethodSignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'method1', + + range: [104, 111], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + kind: 'method', +- params: Array [], +- returnType: TSTypeAnnotation { ++ parameters: Array [], ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSVoidKeyword { + type: 'TSVoidKeyword', + + range: [115, 119], + loc: { + start: { column: 13, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + + range: [113, 119], + loc: { + start: { column: 11, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + + range: [104, 120], + loc: { + start: { column: 2, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + ], + + range: [100, 122], + loc: { + start: { column: 27, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'T', + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [88, 122], + loc: { + start: { column: 15, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + exportKind: 'value', + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'module', + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..37b50b930486 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,132 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-default-interface AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'export', + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'default', + + range: [80, 87], + loc: { + start: { column: 7, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [88, 97], + loc: { + start: { column: 15, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'method1', + + range: [104, 111], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [111, 112], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [112, 113], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [113, 114], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'void', + + range: [115, 119], + loc: { + start: { column: 13, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [119, 120], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [121, 122], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/fixture.ts new file mode 100644 index 000000000000..e90622b967cf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export class Foo {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..4a03c5671eb3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,91 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-named-class-with-generic TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [93, 95], + loc: { + start: { column: 20, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + out: false, + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + + range: [89, 92], + loc: { + start: { column: 16, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [80, 95], + loc: { + start: { column: 7, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 96], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..f3b3efb4b03d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-named-class-with-generic TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..21f93f8fcb6e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/3-Babel-AST.shot @@ -0,0 +1,80 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-named-class-with-generic Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [93, 95], + loc: { + start: { column: 20, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + + range: [89, 92], + loc: { + start: { column: 16, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [80, 95], + loc: { + start: { column: 7, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 96], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..3b8445a52cda --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-named-class-with-generic Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..c1c8ef302170 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-named-class-with-generic AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [93, 95], + loc: { + start: { column: 20, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [90, 91], +- loc: { +- start: { column: 17, line: 3 }, +- end: { column: 18, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + + range: [89, 92], + loc: { + start: { column: 16, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [80, 95], + loc: { + start: { column: 7, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + exportKind: 'value', + source: null, + specifiers: Array [], + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + sourceType: 'module', + + range: [73, 96], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..d2ad784f376f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-named-class-with-generic AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/fixture.ts new file mode 100644 index 000000000000..7b4c8f4206ed --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export class Foo {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..5f1bbd5e181f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,112 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-named-class-with-multiple-generics TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [96, 98], + loc: { + start: { column: 23, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + out: false, + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "U", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + out: false, + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [80, 98], + loc: { + start: { column: 7, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 99], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..d502ae397ecb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-named-class-with-multiple-generics TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..3a873d17cd27 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/3-Babel-AST.shot @@ -0,0 +1,90 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-named-class-with-multiple-generics Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [96, 98], + loc: { + start: { column: 23, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + TSTypeParameter { + type: "TSTypeParameter", + name: "U", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [80, 98], + loc: { + start: { column: 7, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 99], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..55b62360f2db --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-named-class-with-multiple-generics Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..dd2224404838 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,118 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-named-class-with-multiple-generics AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [96, 98], + loc: { + start: { column: 23, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [90, 91], +- loc: { +- start: { column: 17, line: 3 }, +- end: { column: 18, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'U', +- +- range: [93, 94], +- loc: { +- start: { column: 20, line: 3 }, +- end: { column: 21, line: 3 }, +- }, +- }, +- out: false, ++ name: 'U', + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [80, 98], + loc: { + start: { column: 7, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + exportKind: 'value', + source: null, + specifiers: Array [], + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + ], + sourceType: 'module', + + range: [73, 99], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..019a11f660cc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-named-class-with-multiple-generics AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/fixture.ts new file mode 100644 index 000000000000..6209d91a1047 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export enum Foo { + foo = 1, + bar, +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..da531568f5d1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,99 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-named-enum TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSEnumDeclaration { + type: "TSEnumDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + members: Array [ + TSEnumMember { + type: "TSEnumMember", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [93, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + initializer: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [99, 100], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [93, 100], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + TSEnumMember { + type: "TSEnumMember", + id: Identifier { + type: "Identifier", + name: "bar", + + range: [104, 107], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + + range: [104, 107], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + ], + + range: [80, 110], + loc: { + start: { column: 7, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "module", + + range: [73, 111], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..6f1ce2642e67 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-named-enum TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "enum", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [93, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [97, 98], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [99, 100], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [100, 101], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [104, 107], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [107, 108], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [109, 110], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..0b33e2626a27 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/3-Babel-AST.shot @@ -0,0 +1,99 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-named-enum Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSEnumDeclaration { + type: "TSEnumDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + members: Array [ + TSEnumMember { + type: "TSEnumMember", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [93, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + initializer: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [99, 100], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [93, 100], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + TSEnumMember { + type: "TSEnumMember", + id: Identifier { + type: "Identifier", + name: "bar", + + range: [104, 107], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + + range: [104, 107], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + ], + + range: [80, 110], + loc: { + start: { column: 7, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "module", + + range: [73, 111], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..2ae781c656b3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-named-enum Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "enum", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [93, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [97, 98], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [99, 100], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [100, 101], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [104, 107], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [107, 108], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [109, 110], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..596d7bfe3564 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-named-enum AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..987b0accaad9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,122 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-named-enum AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'export', + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'enum', + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'foo', + + range: [93, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [97, 98], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [99, 100], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [100, 101], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar', + + range: [104, 107], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [107, 108], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [109, 110], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/fixture.ts new file mode 100644 index 000000000000..b8f7e13e2ee9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export * as foo from 'bar'; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..d143f1445f57 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,48 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-star-as-ns-from TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportAllDeclaration { + type: "ExportAllDeclaration", + assertions: Array [], + exported: Identifier { + type: "Identifier", + name: "foo", + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'bar'", + value: "bar", + + range: [94, 99], + loc: { + start: { column: 21, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..d71c203e822c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-star-as-ns-from TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "*", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [82, 84], + loc: { + start: { column: 9, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [89, 93], + loc: { + start: { column: 16, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + String { + type: "String", + value: "'bar'", + + range: [94, 99], + loc: { + start: { column: 21, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..e9ba2b67a6c3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/3-Babel-AST.shot @@ -0,0 +1,48 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-star-as-ns-from Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportAllDeclaration { + type: "ExportAllDeclaration", + assertions: Array [], + exported: Identifier { + type: "Identifier", + name: "foo", + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'bar'", + value: "bar", + + range: [94, 99], + loc: { + start: { column: 21, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..e9741e8539bf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-star-as-ns-from Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "*", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [82, 84], + loc: { + start: { column: 9, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [89, 93], + loc: { + start: { column: 16, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + String { + type: "String", + value: "'bar'", + + range: [94, 99], + loc: { + start: { column: 21, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..b102f45164be --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-star-as-ns-from AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..7adfb5a3009a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-star-as-ns-from AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/fixture.ts new file mode 100644 index 000000000000..38f0a9882506 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export type { A as B }; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..c8aa32831351 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,61 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type-as TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: null, + exportKind: "type", + source: null, + specifiers: Array [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "B", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "A", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [87, 93], + loc: { + start: { column: 14, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + + range: [73, 96], + loc: { + start: { column: 0, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 97], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..5b41731de3e6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type-as TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [89, 91], + loc: { + start: { column: 16, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..1ee330e2b237 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/3-Babel-AST.shot @@ -0,0 +1,61 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type-as Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: null, + exportKind: "type", + source: null, + specifiers: Array [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "B", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "A", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [87, 93], + loc: { + start: { column: 14, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + + range: [73, 96], + loc: { + start: { column: 0, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 97], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..c2d064c67d1f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type-as Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [89, 91], + loc: { + start: { column: 16, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..8526243ea236 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type-as AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: null, + exportKind: 'type', + source: null, + specifiers: Array [ + ExportSpecifier { + type: 'ExportSpecifier', + exported: Identifier { + type: 'Identifier', + name: 'B', + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + exportKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'A', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [87, 93], + loc: { + start: { column: 14, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + + range: [73, 96], + loc: { + start: { column: 0, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [73, 97], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..884b847648e0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type-as AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/fixture.ts new file mode 100644 index 000000000000..20f5a365f722 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export type { B as C } from './a'; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..6506bdb73947 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,71 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type-from-as TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: null, + exportKind: "type", + source: Literal { + type: "Literal", + raw: "'./a'", + value: "./a", + + range: [101, 106], + loc: { + start: { column: 28, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + specifiers: Array [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "C", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "B", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [87, 93], + loc: { + start: { column: 14, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..ef607ac99e95 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type-from-as TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [89, 91], + loc: { + start: { column: 16, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [96, 100], + loc: { + start: { column: 23, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + String { + type: "String", + value: "'./a'", + + range: [101, 106], + loc: { + start: { column: 28, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..e67887e6834a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/3-Babel-AST.shot @@ -0,0 +1,71 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type-from-as Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: null, + exportKind: "type", + source: Literal { + type: "Literal", + raw: "'./a'", + value: "./a", + + range: [101, 106], + loc: { + start: { column: 28, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + specifiers: Array [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "C", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "B", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [87, 93], + loc: { + start: { column: 14, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..3e1fbe0cf721 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type-from-as Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [89, 91], + loc: { + start: { column: 16, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [96, 100], + loc: { + start: { column: 23, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + String { + type: "String", + value: "'./a'", + + range: [101, 106], + loc: { + start: { column: 28, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..0a372b10d34e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type-from-as AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: null, + exportKind: 'type', + source: Literal { + type: 'Literal', + raw: '\\\\'./a\\\\'', + value: './a', + + range: [101, 106], + loc: { + start: { column: 28, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + specifiers: Array [ + ExportSpecifier { + type: 'ExportSpecifier', + exported: Identifier { + type: 'Identifier', + name: 'C', + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + exportKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'B', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [87, 93], + loc: { + start: { column: 14, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..308941ac6543 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type-from-as AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/fixture.ts new file mode 100644 index 000000000000..f82967c10d21 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export type { foo } from 'bar'; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..21c711a4a479 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,71 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type-from TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: null, + exportKind: "type", + source: Literal { + type: "Literal", + raw: "'bar'", + value: "bar", + + range: [98, 103], + loc: { + start: { column: 25, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + specifiers: Array [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ], + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..a194616a7058 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type-from TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [93, 97], + loc: { + start: { column: 20, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + String { + type: "String", + value: "'bar'", + + range: [98, 103], + loc: { + start: { column: 25, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..9809f387614c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/3-Babel-AST.shot @@ -0,0 +1,71 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type-from Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: null, + exportKind: "type", + source: Literal { + type: "Literal", + raw: "'bar'", + value: "bar", + + range: [98, 103], + loc: { + start: { column: 25, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + specifiers: Array [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ], + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..619ae6420f70 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type-from Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [93, 97], + loc: { + start: { column: 20, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + String { + type: "String", + value: "'bar'", + + range: [98, 103], + loc: { + start: { column: 25, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..fa87bc4af229 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type-from AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: null, + exportKind: 'type', + source: Literal { + type: 'Literal', + raw: '\\\\'bar\\\\'', + value: 'bar', + + range: [98, 103], + loc: { + start: { column: 25, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + specifiers: Array [ + ExportSpecifier { + type: 'ExportSpecifier', + exported: Identifier { + type: 'Identifier', + name: 'foo', + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + exportKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'foo', + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ], + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..f2d78673f209 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type-from AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/fixture.ts new file mode 100644 index 000000000000..bddea804754d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export type { foo }; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..328c854b9b6f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,61 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: null, + exportKind: "type", + source: null, + specifiers: Array [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ], + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..7c3416d40b9f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..035adc139169 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/3-Babel-AST.shot @@ -0,0 +1,61 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: null, + exportKind: "type", + source: null, + specifiers: Array [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ], + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..6e98241ac13d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..dca27176e25a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: null, + exportKind: 'type', + source: null, + specifiers: Array [ + ExportSpecifier { + type: 'ExportSpecifier', + exported: Identifier { + type: 'Identifier', + name: 'foo', + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + exportKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'foo', + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ], + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..bd2639482111 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics export-type AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/fixture.ts new file mode 100644 index 000000000000..784e2ad16b68 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +var obj = function (a: string) { + return a; +}; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..7b536d258a7d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,152 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-anonymus-with-type-parameters TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "obj", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + init: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: Identifier { + type: "Identifier", + name: "a", + + range: [118, 119], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [111, 120], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ], + + range: [107, 122], + loc: { + start: { column: 34, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [97, 105], + loc: { + start: { column: 24, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [96, 105], + loc: { + start: { column: 23, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + out: false, + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [83, 122], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + + range: [77, 122], + loc: { + start: { column: 4, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + kind: "var", + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 124], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..1ab8e31b0c2f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,186 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-anonymus-with-type-parameters TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "var", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "obj", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [83, 91], + loc: { + start: { column: 10, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [111, 117], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [118, 119], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [119, 120], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [121, 122], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [122, 123], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..f676132ab6c2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/3-Babel-AST.shot @@ -0,0 +1,141 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-anonymus-with-type-parameters Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "obj", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + init: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: Identifier { + type: "Identifier", + name: "a", + + range: [118, 119], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [111, 120], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ], + + range: [107, 122], + loc: { + start: { column: 34, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [97, 105], + loc: { + start: { column: 24, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [96, 105], + loc: { + start: { column: 23, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [83, 122], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + + range: [77, 122], + loc: { + start: { column: 4, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + kind: "var", + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 124], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..129889ae4104 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,186 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-anonymus-with-type-parameters Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "var", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "obj", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [83, 91], + loc: { + start: { column: 10, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [111, 117], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [118, 119], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [119, 120], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [121, 122], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [122, 123], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..a35e030838b2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,157 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-anonymus-with-type-parameters AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'obj', + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + init: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: Identifier { + type: 'Identifier', + name: 'a', + + range: [118, 119], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [111, 120], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ], + + range: [107, 122], + loc: { + start: { column: 34, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: 'Identifier', + name: 'a', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [97, 105], + loc: { + start: { column: 24, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [96, 105], + loc: { + start: { column: 23, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [93, 94], +- loc: { +- start: { column: 20, line: 3 }, +- end: { column: 21, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [83, 122], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + + range: [77, 122], + loc: { + start: { column: 4, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + kind: 'var', + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 124], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..6ef440b26593 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-anonymus-with-type-parameters AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/fixture.ts new file mode 100644 index 000000000000..50d2798e2b0d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +var obj = function (): void {}; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..353f50fad20d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,89 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-anynomus-with-return-type TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "obj", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + init: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [101, 103], + loc: { + start: { column: 28, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [96, 100], + loc: { + start: { column: 23, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [94, 100], + loc: { + start: { column: 21, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [83, 103], + loc: { + start: { column: 10, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [77, 103], + loc: { + start: { column: 4, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + kind: "var", + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..da81e7e7f8d6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-anynomus-with-return-type TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "var", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "obj", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [83, 91], + loc: { + start: { column: 10, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [96, 100], + loc: { + start: { column: 23, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..379acdb1f1e3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/3-Babel-AST.shot @@ -0,0 +1,89 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-anynomus-with-return-type Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "obj", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + init: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [101, 103], + loc: { + start: { column: 28, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [96, 100], + loc: { + start: { column: 23, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [94, 100], + loc: { + start: { column: 21, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [83, 103], + loc: { + start: { column: 10, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [77, 103], + loc: { + start: { column: 4, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + kind: "var", + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..2be5b4805579 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-anynomus-with-return-type Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "var", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "obj", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [83, 91], + loc: { + start: { column: 10, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [96, 100], + loc: { + start: { column: 23, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..9fe3b48e4567 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-anynomus-with-return-type AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..f4b6916aef96 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-anynomus-with-return-type AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/fixture.ts new file mode 100644 index 000000000000..d8f7144b2bb8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/fixture.ts @@ -0,0 +1,7 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export function f(x: number): number; +export function f(x: string): string; +export function f(x: string | number): string | number { + return x; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..49eeab154822 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,335 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-overloads TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSDeclareFunction { + type: "TSDeclareFunction", + async: false, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "f", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [94, 100], + loc: { + start: { column: 21, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [92, 100], + loc: { + start: { column: 19, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [91, 100], + loc: { + start: { column: 18, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [103, 109], + loc: { + start: { column: 30, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [101, 109], + loc: { + start: { column: 28, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [80, 110], + loc: { + start: { column: 7, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSDeclareFunction { + type: "TSDeclareFunction", + async: false, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "f", + + range: [127, 128], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [132, 138], + loc: { + start: { column: 21, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + + range: [130, 138], + loc: { + start: { column: 19, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + + range: [129, 138], + loc: { + start: { column: 18, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [141, 147], + loc: { + start: { column: 30, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + + range: [139, 147], + loc: { + start: { column: 28, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + + range: [118, 148], + loc: { + start: { column: 7, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [111, 148], + loc: { + start: { column: 0, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: Identifier { + type: "Identifier", + name: "x", + + range: [215, 216], + loc: { + start: { column: 9, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + + range: [208, 217], + loc: { + start: { column: 2, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + ], + + range: [204, 219], + loc: { + start: { column: 55, line: 5 }, + end: { column: 1, line: 7 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "f", + + range: [165, 166], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [170, 176], + loc: { + start: { column: 21, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [179, 185], + loc: { + start: { column: 30, line: 5 }, + end: { column: 36, line: 5 }, + }, + }, + ], + + range: [170, 185], + loc: { + start: { column: 21, line: 5 }, + end: { column: 36, line: 5 }, + }, + }, + + range: [168, 185], + loc: { + start: { column: 19, line: 5 }, + end: { column: 36, line: 5 }, + }, + }, + + range: [167, 185], + loc: { + start: { column: 18, line: 5 }, + end: { column: 36, line: 5 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [188, 194], + loc: { + start: { column: 39, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [197, 203], + loc: { + start: { column: 48, line: 5 }, + end: { column: 54, line: 5 }, + }, + }, + ], + + range: [188, 203], + loc: { + start: { column: 39, line: 5 }, + end: { column: 54, line: 5 }, + }, + }, + + range: [186, 203], + loc: { + start: { column: 37, line: 5 }, + end: { column: 54, line: 5 }, + }, + }, + + range: [156, 219], + loc: { + start: { column: 7, line: 5 }, + end: { column: 1, line: 7 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [149, 219], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "module", + + range: [73, 220], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..c2a8fd8b06e3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,416 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-overloads TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [80, 88], + loc: { + start: { column: 7, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [94, 100], + loc: { + start: { column: 21, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [103, 109], + loc: { + start: { column: 30, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "export", + + range: [111, 117], + loc: { + start: { column: 0, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [118, 126], + loc: { + start: { column: 7, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [127, 128], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [128, 129], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [129, 130], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [130, 131], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [132, 138], + loc: { + start: { column: 21, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [138, 139], + loc: { + start: { column: 27, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [139, 140], + loc: { + start: { column: 28, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [141, 147], + loc: { + start: { column: 30, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [147, 148], + loc: { + start: { column: 36, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "export", + + range: [149, 155], + loc: { + start: { column: 0, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [156, 164], + loc: { + start: { column: 7, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [165, 166], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [166, 167], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [167, 168], + loc: { + start: { column: 18, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [168, 169], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [170, 176], + loc: { + start: { column: 21, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [177, 178], + loc: { + start: { column: 28, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [179, 185], + loc: { + start: { column: 30, line: 5 }, + end: { column: 36, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [185, 186], + loc: { + start: { column: 36, line: 5 }, + end: { column: 37, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [186, 187], + loc: { + start: { column: 37, line: 5 }, + end: { column: 38, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [188, 194], + loc: { + start: { column: 39, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [195, 196], + loc: { + start: { column: 46, line: 5 }, + end: { column: 47, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [197, 203], + loc: { + start: { column: 48, line: 5 }, + end: { column: 54, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [204, 205], + loc: { + start: { column: 55, line: 5 }, + end: { column: 56, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [208, 214], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [215, 216], + loc: { + start: { column: 9, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [216, 217], + loc: { + start: { column: 10, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [218, 219], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..cc4de7518cd6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/3-Babel-AST.shot @@ -0,0 +1,335 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-overloads Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSDeclareFunction { + type: "TSDeclareFunction", + async: false, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "f", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [94, 100], + loc: { + start: { column: 21, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [92, 100], + loc: { + start: { column: 19, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [91, 100], + loc: { + start: { column: 18, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [103, 109], + loc: { + start: { column: 30, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [101, 109], + loc: { + start: { column: 28, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [80, 110], + loc: { + start: { column: 7, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSDeclareFunction { + type: "TSDeclareFunction", + async: false, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "f", + + range: [127, 128], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [132, 138], + loc: { + start: { column: 21, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + + range: [130, 138], + loc: { + start: { column: 19, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + + range: [129, 138], + loc: { + start: { column: 18, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [141, 147], + loc: { + start: { column: 30, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + + range: [139, 147], + loc: { + start: { column: 28, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + + range: [118, 148], + loc: { + start: { column: 7, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [111, 148], + loc: { + start: { column: 0, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: Identifier { + type: "Identifier", + name: "x", + + range: [215, 216], + loc: { + start: { column: 9, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + + range: [208, 217], + loc: { + start: { column: 2, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + ], + + range: [204, 219], + loc: { + start: { column: 55, line: 5 }, + end: { column: 1, line: 7 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "f", + + range: [165, 166], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [170, 176], + loc: { + start: { column: 21, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [179, 185], + loc: { + start: { column: 30, line: 5 }, + end: { column: 36, line: 5 }, + }, + }, + ], + + range: [170, 185], + loc: { + start: { column: 21, line: 5 }, + end: { column: 36, line: 5 }, + }, + }, + + range: [168, 185], + loc: { + start: { column: 19, line: 5 }, + end: { column: 36, line: 5 }, + }, + }, + + range: [167, 185], + loc: { + start: { column: 18, line: 5 }, + end: { column: 36, line: 5 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [188, 194], + loc: { + start: { column: 39, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [197, 203], + loc: { + start: { column: 48, line: 5 }, + end: { column: 54, line: 5 }, + }, + }, + ], + + range: [188, 203], + loc: { + start: { column: 39, line: 5 }, + end: { column: 54, line: 5 }, + }, + }, + + range: [186, 203], + loc: { + start: { column: 37, line: 5 }, + end: { column: 54, line: 5 }, + }, + }, + + range: [156, 219], + loc: { + start: { column: 7, line: 5 }, + end: { column: 1, line: 7 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [149, 219], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "module", + + range: [73, 220], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..107550371cf4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,416 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-overloads Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [80, 88], + loc: { + start: { column: 7, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [94, 100], + loc: { + start: { column: 21, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [103, 109], + loc: { + start: { column: 30, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "export", + + range: [111, 117], + loc: { + start: { column: 0, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [118, 126], + loc: { + start: { column: 7, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [127, 128], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [128, 129], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [129, 130], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [130, 131], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [132, 138], + loc: { + start: { column: 21, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [138, 139], + loc: { + start: { column: 27, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [139, 140], + loc: { + start: { column: 28, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [141, 147], + loc: { + start: { column: 30, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [147, 148], + loc: { + start: { column: 36, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "export", + + range: [149, 155], + loc: { + start: { column: 0, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [156, 164], + loc: { + start: { column: 7, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [165, 166], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [166, 167], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [167, 168], + loc: { + start: { column: 18, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [168, 169], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [170, 176], + loc: { + start: { column: 21, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [177, 178], + loc: { + start: { column: 28, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [179, 185], + loc: { + start: { column: 30, line: 5 }, + end: { column: 36, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [185, 186], + loc: { + start: { column: 36, line: 5 }, + end: { column: 37, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [186, 187], + loc: { + start: { column: 37, line: 5 }, + end: { column: 38, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [188, 194], + loc: { + start: { column: 39, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [195, 196], + loc: { + start: { column: 46, line: 5 }, + end: { column: 47, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [197, 203], + loc: { + start: { column: 48, line: 5 }, + end: { column: 54, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [204, 205], + loc: { + start: { column: 55, line: 5 }, + end: { column: 56, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [208, 214], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [215, 216], + loc: { + start: { column: 9, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [216, 217], + loc: { + start: { column: 10, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [218, 219], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..76b94490a41e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-overloads AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..b7b4fcfd1bcc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-overloads AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/fixture.ts new file mode 100644 index 000000000000..a22a95186041 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +async function hope(future) { + await future; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..124b6fd12f20 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,89 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-await TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: true, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AwaitExpression { + type: "AwaitExpression", + argument: Identifier { + type: "Identifier", + name: "future", + + range: [111, 117], + loc: { + start: { column: 8, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + + range: [105, 117], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + + range: [105, 118], + loc: { + start: { column: 2, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + ], + + range: [101, 120], + loc: { + start: { column: 28, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "hope", + + range: [88, 92], + loc: { + start: { column: 15, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "future", + + range: [93, 99], + loc: { + start: { column: 20, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + + range: [73, 120], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..659eca72ae9f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-await TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "async", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [79, 87], + loc: { + start: { column: 6, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "hope", + + range: [88, 92], + loc: { + start: { column: 15, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "future", + + range: [93, 99], + loc: { + start: { column: 20, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "await", + + range: [105, 110], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "future", + + range: [111, 117], + loc: { + start: { column: 8, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [117, 118], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [119, 120], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..9db5bb17c880 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/3-Babel-AST.shot @@ -0,0 +1,89 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-await Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: true, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AwaitExpression { + type: "AwaitExpression", + argument: Identifier { + type: "Identifier", + name: "future", + + range: [111, 117], + loc: { + start: { column: 8, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + + range: [105, 117], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + + range: [105, 118], + loc: { + start: { column: 2, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + ], + + range: [101, 120], + loc: { + start: { column: 28, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "hope", + + range: [88, 92], + loc: { + start: { column: 15, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "future", + + range: [93, 99], + loc: { + start: { column: 20, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + + range: [73, 120], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..60458b5d251b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-await Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "async", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [79, 87], + loc: { + start: { column: 6, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "hope", + + range: [88, 92], + loc: { + start: { column: 15, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "future", + + range: [93, 99], + loc: { + start: { column: 20, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "await", + + range: [105, 110], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "future", + + range: [111, 117], + loc: { + start: { column: 8, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [117, 118], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [119, 120], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..101a3738026d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-await AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..5027e91f031d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-await AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/fixture.ts new file mode 100644 index 000000000000..d65009d32d77 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function foo({ bar, baz }: { bar?: string; baz? }) {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..2cab080bac29 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,207 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-object-type-with-optional-properties TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [124, 126], + loc: { + start: { column: 51, line: 3 }, + end: { column: 53, line: 3 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + params: Array [ + ObjectPattern { + type: "ObjectPattern", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + kind: "init", + method: false, + shorthand: true, + value: Identifier { + type: "Identifier", + name: "bar", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + kind: "init", + method: false, + shorthand: true, + value: Identifier { + type: "Identifier", + name: "baz", + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [102, 105], + loc: { + start: { column: 29, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + + range: [106, 114], + loc: { + start: { column: 33, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + + range: [102, 115], + loc: { + start: { column: 29, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [116, 119], + loc: { + start: { column: 43, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + optional: true, + + range: [116, 120], + loc: { + start: { column: 43, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + ], + + range: [100, 122], + loc: { + start: { column: 27, line: 3 }, + end: { column: 49, line: 3 }, + }, + }, + + range: [98, 122], + loc: { + start: { column: 25, line: 3 }, + end: { column: 49, line: 3 }, + }, + }, + + range: [86, 122], + loc: { + start: { column: 13, line: 3 }, + end: { column: 49, line: 3 }, + }, + }, + ], + + range: [73, 126], + loc: { + start: { column: 0, line: 3 }, + end: { column: 53, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 127], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..fa1342a4dfdb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,216 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-object-type-with-optional-properties TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [102, 105], + loc: { + start: { column: 29, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [116, 119], + loc: { + start: { column: 43, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [121, 122], + loc: { + start: { column: 48, line: 3 }, + end: { column: 49, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [122, 123], + loc: { + start: { column: 49, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [124, 125], + loc: { + start: { column: 51, line: 3 }, + end: { column: 52, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [125, 126], + loc: { + start: { column: 52, line: 3 }, + end: { column: 53, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..d54ff73836bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/3-Babel-AST.shot @@ -0,0 +1,207 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-object-type-with-optional-properties Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [124, 126], + loc: { + start: { column: 51, line: 3 }, + end: { column: 53, line: 3 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + params: Array [ + ObjectPattern { + type: "ObjectPattern", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + kind: "init", + method: false, + shorthand: true, + value: Identifier { + type: "Identifier", + name: "bar", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + kind: "init", + method: false, + shorthand: true, + value: Identifier { + type: "Identifier", + name: "baz", + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [102, 105], + loc: { + start: { column: 29, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + + range: [106, 114], + loc: { + start: { column: 33, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + + range: [102, 115], + loc: { + start: { column: 29, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [116, 119], + loc: { + start: { column: 43, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + optional: true, + + range: [116, 120], + loc: { + start: { column: 43, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + ], + + range: [100, 122], + loc: { + start: { column: 27, line: 3 }, + end: { column: 49, line: 3 }, + }, + }, + + range: [98, 122], + loc: { + start: { column: 25, line: 3 }, + end: { column: 49, line: 3 }, + }, + }, + + range: [86, 122], + loc: { + start: { column: 13, line: 3 }, + end: { column: 49, line: 3 }, + }, + }, + ], + + range: [73, 126], + loc: { + start: { column: 0, line: 3 }, + end: { column: 53, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 127], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..b3cec969ce91 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,216 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-object-type-with-optional-properties Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [102, 105], + loc: { + start: { column: 29, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [116, 119], + loc: { + start: { column: 43, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [121, 122], + loc: { + start: { column: 48, line: 3 }, + end: { column: 49, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [122, 123], + loc: { + start: { column: 49, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [124, 125], + loc: { + start: { column: 51, line: 3 }, + end: { column: 52, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [125, 126], + loc: { + start: { column: 52, line: 3 }, + end: { column: 53, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..d8a406bb7e9a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-object-type-with-optional-properties AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..338730177234 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-object-type-with-optional-properties AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/fixture.ts new file mode 100644 index 000000000000..e47b7299b261 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function foo({ bar, baz }: { bar: string; baz }) {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..88185f9b8636 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,205 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-object-type-without-annotation TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [122, 124], + loc: { + start: { column: 49, line: 3 }, + end: { column: 51, line: 3 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + params: Array [ + ObjectPattern { + type: "ObjectPattern", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + kind: "init", + method: false, + shorthand: true, + value: Identifier { + type: "Identifier", + name: "bar", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + kind: "init", + method: false, + shorthand: true, + value: Identifier { + type: "Identifier", + name: "baz", + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [102, 105], + loc: { + start: { column: 29, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [107, 113], + loc: { + start: { column: 34, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + + range: [105, 113], + loc: { + start: { column: 32, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + + range: [102, 114], + loc: { + start: { column: 29, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [115, 118], + loc: { + start: { column: 42, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + + range: [115, 118], + loc: { + start: { column: 42, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + ], + + range: [100, 120], + loc: { + start: { column: 27, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + + range: [98, 120], + loc: { + start: { column: 25, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + + range: [86, 120], + loc: { + start: { column: 13, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + ], + + range: [73, 124], + loc: { + start: { column: 0, line: 3 }, + end: { column: 51, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 125], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..277f881e149b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,196 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-object-type-without-annotation TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [102, 105], + loc: { + start: { column: 29, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [107, 113], + loc: { + start: { column: 34, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [113, 114], + loc: { + start: { column: 40, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [115, 118], + loc: { + start: { column: 42, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [120, 121], + loc: { + start: { column: 47, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [122, 123], + loc: { + start: { column: 49, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [123, 124], + loc: { + start: { column: 50, line: 3 }, + end: { column: 51, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..c03d14d53ee8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/3-Babel-AST.shot @@ -0,0 +1,205 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-object-type-without-annotation Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [122, 124], + loc: { + start: { column: 49, line: 3 }, + end: { column: 51, line: 3 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + params: Array [ + ObjectPattern { + type: "ObjectPattern", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + kind: "init", + method: false, + shorthand: true, + value: Identifier { + type: "Identifier", + name: "bar", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + kind: "init", + method: false, + shorthand: true, + value: Identifier { + type: "Identifier", + name: "baz", + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [102, 105], + loc: { + start: { column: 29, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [107, 113], + loc: { + start: { column: 34, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + + range: [105, 113], + loc: { + start: { column: 32, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + + range: [102, 114], + loc: { + start: { column: 29, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [115, 118], + loc: { + start: { column: 42, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + + range: [115, 118], + loc: { + start: { column: 42, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + ], + + range: [100, 120], + loc: { + start: { column: 27, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + + range: [98, 120], + loc: { + start: { column: 25, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + + range: [86, 120], + loc: { + start: { column: 13, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + ], + + range: [73, 124], + loc: { + start: { column: 0, line: 3 }, + end: { column: 51, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 125], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..a4eeee5afbf8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,196 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-object-type-without-annotation Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [93, 96], + loc: { + start: { column: 20, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [102, 105], + loc: { + start: { column: 29, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [107, 113], + loc: { + start: { column: 34, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [113, 114], + loc: { + start: { column: 40, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [115, 118], + loc: { + start: { column: 42, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [120, 121], + loc: { + start: { column: 47, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [122, 123], + loc: { + start: { column: 49, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [123, 124], + loc: { + start: { column: 50, line: 3 }, + end: { column: 51, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..3f1b0bd4bc49 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-object-type-without-annotation AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..e50fc7e05809 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-object-type-without-annotation AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/fixture.ts new file mode 100644 index 000000000000..fbcfb934f622 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function compare() {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..6a8770bed94b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,81 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters-that-have-comments TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [107, 109], + loc: { + start: { column: 34, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "compare", + + range: [82, 89], + loc: { + start: { column: 9, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + out: false, + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + + range: [89, 104], + loc: { + start: { column: 16, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..669042b36c41 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters-that-have-comments TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "compare", + + range: [82, 89], + loc: { + start: { column: 9, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..a5e3f5e91263 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/3-Babel-AST.shot @@ -0,0 +1,70 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters-that-have-comments Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [107, 109], + loc: { + start: { column: 34, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "compare", + + range: [82, 89], + loc: { + start: { column: 9, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + + range: [89, 104], + loc: { + start: { column: 16, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..bb203e13d056 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters-that-have-comments Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "compare", + + range: [82, 89], + loc: { + start: { column: 9, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..99cb440a924b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters-that-have-comments AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + FunctionDeclaration { + type: 'FunctionDeclaration', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [107, 109], + loc: { + start: { column: 34, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: 'Identifier', + name: 'compare', + + range: [82, 89], + loc: { + start: { column: 9, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [102, 103], +- loc: { +- start: { column: 29, line: 3 }, +- end: { column: 30, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + + range: [89, 104], + loc: { + start: { column: 16, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..d5bb702e5431 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters-that-have-comments AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/fixture.ts new file mode 100644 index 000000000000..ef73f52ac7a4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function a(b: X): X { + return b; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..e2c552e2e1fa --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,178 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters-with-constraint TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: Identifier { + type: "Identifier", + name: "b", + + range: [118, 119], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [111, 120], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ], + + range: [107, 122], + loc: { + start: { column: 34, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "a", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "b", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "X", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [98, 102], + loc: { + start: { column: 25, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "X", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [103, 106], + loc: { + start: { column: 30, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + constraint: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [], + + range: [94, 96], + loc: { + start: { column: 21, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "X", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + out: false, + + range: [84, 96], + loc: { + start: { column: 11, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + + range: [83, 97], + loc: { + start: { column: 10, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..8a7c1c2547be --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,206 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters-with-constraint TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [86, 93], + loc: { + start: { column: 13, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [111, 117], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [118, 119], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [119, 120], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [121, 122], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..6a072b8ef9a7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/3-Babel-AST.shot @@ -0,0 +1,167 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters-with-constraint Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: Identifier { + type: "Identifier", + name: "b", + + range: [118, 119], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [111, 120], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ], + + range: [107, 122], + loc: { + start: { column: 34, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "a", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "b", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "X", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [98, 102], + loc: { + start: { column: 25, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "X", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [103, 106], + loc: { + start: { column: 30, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + constraint: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [], + + range: [94, 96], + loc: { + start: { column: 21, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + name: "X", + + range: [84, 96], + loc: { + start: { column: 11, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + + range: [83, 97], + loc: { + start: { column: 10, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..96f750c518ff --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,206 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters-with-constraint Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [86, 93], + loc: { + start: { column: 13, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [111, 117], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [118, 119], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [119, 120], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [121, 122], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..16c2ff77580b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,183 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters-with-constraint AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + FunctionDeclaration { + type: 'FunctionDeclaration', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: Identifier { + type: 'Identifier', + name: 'b', + + range: [118, 119], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [111, 120], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ], + + range: [107, 122], + loc: { + start: { column: 34, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: 'Identifier', + name: 'a', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: 'Identifier', + name: 'b', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'X', + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [98, 102], + loc: { + start: { column: 25, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'X', + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [103, 106], + loc: { + start: { column: 30, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSTypeLiteral { + type: 'TSTypeLiteral', + members: Array [], + + range: [94, 96], + loc: { + start: { column: 21, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'X', +- +- range: [84, 85], +- loc: { +- start: { column: 11, line: 3 }, +- end: { column: 12, line: 3 }, +- }, +- }, +- out: false, ++ name: 'X', + + range: [84, 96], + loc: { + start: { column: 11, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + + range: [83, 97], + loc: { + start: { column: 10, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..b21320f13b23 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters-with-constraint AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/fixture.ts new file mode 100644 index 000000000000..67896dbfb16c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function a(b: X): X { + return b; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..4ce1b21c01c2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,168 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: Identifier { + type: "Identifier", + name: "b", + + range: [107, 108], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [100, 109], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ], + + range: [96, 111], + loc: { + start: { column: 23, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "a", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "b", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "X", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [87, 91], + loc: { + start: { column: 14, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "X", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "X", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + out: false, + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + ], + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 111], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..4b851f9d6f12 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [100, 106], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [107, 108], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [108, 109], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [110, 111], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..5cca708a1bc4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/3-Babel-AST.shot @@ -0,0 +1,157 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: Identifier { + type: "Identifier", + name: "b", + + range: [107, 108], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [100, 109], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ], + + range: [96, 111], + loc: { + start: { column: 23, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "a", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "b", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "X", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [87, 91], + loc: { + start: { column: 14, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "X", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "X", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + ], + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 111], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..15321adbc5cf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [100, 106], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [107, 108], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [108, 109], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [110, 111], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..d191fba20dc2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,173 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + FunctionDeclaration { + type: 'FunctionDeclaration', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: Identifier { + type: 'Identifier', + name: 'b', + + range: [107, 108], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [100, 109], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ], + + range: [96, 111], + loc: { + start: { column: 23, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: 'Identifier', + name: 'a', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: 'Identifier', + name: 'b', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'X', + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [87, 91], + loc: { + start: { column: 14, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'X', + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'X', +- +- range: [84, 85], +- loc: { +- start: { column: 11, line: 3 }, +- end: { column: 12, line: 3 }, +- }, +- }, +- out: false, ++ name: 'X', + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + ], + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 111], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..a3e888697960 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/fixture.ts new file mode 100644 index 000000000000..797fbd440e8e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/fixture.ts @@ -0,0 +1,9 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function message( + name: string, + age: number = 100, + ...args: Array +): string { + return name; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..6c9ddad59400 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,231 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-types-assignation TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: Identifier { + type: "Identifier", + name: "name", + + range: [174, 178], + loc: { + start: { column: 9, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + + range: [167, 179], + loc: { + start: { column: 2, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + ], + + range: [163, 181], + loc: { + start: { column: 10, line: 7 }, + end: { column: 1, line: 9 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "message", + + range: [82, 89], + loc: { + start: { column: 9, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "name", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [99, 105], + loc: { + start: { column: 8, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + + range: [97, 105], + loc: { + start: { column: 6, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + + range: [93, 105], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + AssignmentPattern { + type: "AssignmentPattern", + left: Identifier { + type: "Identifier", + name: "age", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [114, 120], + loc: { + start: { column: 7, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [112, 120], + loc: { + start: { column: 5, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [109, 120], + loc: { + start: { column: 2, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + right: Literal { + type: "Literal", + raw: "100", + value: 100, + + range: [123, 126], + loc: { + start: { column: 16, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + + range: [109, 126], + loc: { + start: { column: 2, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + RestElement { + type: "RestElement", + argument: Identifier { + type: "Identifier", + name: "args", + + range: [133, 137], + loc: { + start: { column: 5, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Array", + + range: [139, 144], + loc: { + start: { column: 11, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [145, 151], + loc: { + start: { column: 17, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + ], + + range: [144, 152], + loc: { + start: { column: 16, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [139, 152], + loc: { + start: { column: 11, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [137, 152], + loc: { + start: { column: 9, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [130, 152], + loc: { + start: { column: 2, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [156, 162], + loc: { + start: { column: 3, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + + range: [154, 162], + loc: { + start: { column: 1, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + + range: [73, 181], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + ], + sourceType: "script", + + range: [73, 182], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 10 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..7e4afaa798b1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,286 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-types-assignation TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "message", + + range: [82, 89], + loc: { + start: { column: 9, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "name", + + range: [93, 97], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [97, 98], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [99, 105], + loc: { + start: { column: 8, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [105, 106], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "age", + + range: [109, 112], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [112, 113], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [114, 120], + loc: { + start: { column: 7, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [121, 122], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "100", + + range: [123, 126], + loc: { + start: { column: 16, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [126, 127], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "...", + + range: [130, 133], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "args", + + range: [133, 137], + loc: { + start: { column: 5, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [137, 138], + loc: { + start: { column: 9, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "Array", + + range: [139, 144], + loc: { + start: { column: 11, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [144, 145], + loc: { + start: { column: 16, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [145, 151], + loc: { + start: { column: 17, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [151, 152], + loc: { + start: { column: 23, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [153, 154], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [154, 155], + loc: { + start: { column: 1, line: 7 }, + end: { column: 2, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [156, 162], + loc: { + start: { column: 3, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [163, 164], + loc: { + start: { column: 10, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [167, 173], + loc: { + start: { column: 2, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "name", + + range: [174, 178], + loc: { + start: { column: 9, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [178, 179], + loc: { + start: { column: 13, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [180, 181], + loc: { + start: { column: 0, line: 9 }, + end: { column: 1, line: 9 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..a1b8ad63c8ee --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/3-Babel-AST.shot @@ -0,0 +1,231 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-types-assignation Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: Identifier { + type: "Identifier", + name: "name", + + range: [174, 178], + loc: { + start: { column: 9, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + + range: [167, 179], + loc: { + start: { column: 2, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + ], + + range: [163, 181], + loc: { + start: { column: 10, line: 7 }, + end: { column: 1, line: 9 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "message", + + range: [82, 89], + loc: { + start: { column: 9, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "name", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [99, 105], + loc: { + start: { column: 8, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + + range: [97, 105], + loc: { + start: { column: 6, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + + range: [93, 105], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + AssignmentPattern { + type: "AssignmentPattern", + left: Identifier { + type: "Identifier", + name: "age", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [114, 120], + loc: { + start: { column: 7, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [112, 120], + loc: { + start: { column: 5, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [109, 120], + loc: { + start: { column: 2, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + right: Literal { + type: "Literal", + raw: "100", + value: 100, + + range: [123, 126], + loc: { + start: { column: 16, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + + range: [109, 126], + loc: { + start: { column: 2, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + RestElement { + type: "RestElement", + argument: Identifier { + type: "Identifier", + name: "args", + + range: [133, 137], + loc: { + start: { column: 5, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Array", + + range: [139, 144], + loc: { + start: { column: 11, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [145, 151], + loc: { + start: { column: 17, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + ], + + range: [144, 152], + loc: { + start: { column: 16, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [139, 152], + loc: { + start: { column: 11, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [137, 152], + loc: { + start: { column: 9, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [130, 152], + loc: { + start: { column: 2, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [156, 162], + loc: { + start: { column: 3, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + + range: [154, 162], + loc: { + start: { column: 1, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + + range: [73, 181], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + ], + sourceType: "script", + + range: [73, 182], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 10 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..d32682fc4edb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,286 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-types-assignation Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "message", + + range: [82, 89], + loc: { + start: { column: 9, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "name", + + range: [93, 97], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [97, 98], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [99, 105], + loc: { + start: { column: 8, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [105, 106], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "age", + + range: [109, 112], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [112, 113], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [114, 120], + loc: { + start: { column: 7, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [121, 122], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "100", + + range: [123, 126], + loc: { + start: { column: 16, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [126, 127], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "...", + + range: [130, 133], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "args", + + range: [133, 137], + loc: { + start: { column: 5, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [137, 138], + loc: { + start: { column: 9, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "Array", + + range: [139, 144], + loc: { + start: { column: 11, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [144, 145], + loc: { + start: { column: 16, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [145, 151], + loc: { + start: { column: 17, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [151, 152], + loc: { + start: { column: 23, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [153, 154], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [154, 155], + loc: { + start: { column: 1, line: 7 }, + end: { column: 2, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [156, 162], + loc: { + start: { column: 3, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [163, 164], + loc: { + start: { column: 10, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [167, 173], + loc: { + start: { column: 2, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "name", + + range: [174, 178], + loc: { + start: { column: 9, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [178, 179], + loc: { + start: { column: 13, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [180, 181], + loc: { + start: { column: 0, line: 9 }, + end: { column: 1, line: 9 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..71bd9bfc1f11 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-types-assignation AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..02c3c79ebf7a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-types-assignation AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/fixture.ts new file mode 100644 index 000000000000..12b285b81780 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function message(name: string): string { + return name; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..b71cf6088f78 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-types TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: Identifier { + type: "Identifier", + name: "name", + + range: [123, 127], + loc: { + start: { column: 9, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [116, 128], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + ], + + range: [112, 130], + loc: { + start: { column: 39, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "message", + + range: [82, 89], + loc: { + start: { column: 9, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "name", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [94, 102], + loc: { + start: { column: 21, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [90, 102], + loc: { + start: { column: 17, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [103, 111], + loc: { + start: { column: 30, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [73, 130], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 131], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..fe8bddcef500 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-types TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "message", + + range: [82, 89], + loc: { + start: { column: 9, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "name", + + range: [90, 94], + loc: { + start: { column: 17, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [116, 122], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "name", + + range: [123, 127], + loc: { + start: { column: 9, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [127, 128], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [129, 130], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..7344f1e3b3aa --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/3-Babel-AST.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-types Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: Identifier { + type: "Identifier", + name: "name", + + range: [123, 127], + loc: { + start: { column: 9, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [116, 128], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + ], + + range: [112, 130], + loc: { + start: { column: 39, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "message", + + range: [82, 89], + loc: { + start: { column: 9, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "name", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [94, 102], + loc: { + start: { column: 21, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [90, 102], + loc: { + start: { column: 17, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [103, 111], + loc: { + start: { column: 30, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [73, 130], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 131], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..3633adf8a1cd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-types Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "message", + + range: [82, 89], + loc: { + start: { column: 9, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "name", + + range: [90, 94], + loc: { + start: { column: 17, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [116, 122], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "name", + + range: [123, 127], + loc: { + start: { column: 9, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [127, 128], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [129, 130], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..9de6b2018683 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-types AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..6aeadb6276ca --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics function-with-types AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/fixture.ts new file mode 100644 index 000000000000..406bb981aebb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/fixture.ts @@ -0,0 +1,13 @@ +// TODO: This fixture might be too large, and if so should be split up. + +// in a global file: + +var abc = 100; + +// Refers to 'abc' from above. +globalThis.abc = 200; + +let answer = 42; + +// error! Property 'answer' does not exist on 'typeof globalThis'. +globalThis.answer = 333333; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..3cc967864b2f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,222 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics global-this TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "abc", + + range: [99, 102], + loc: { + start: { column: 4, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + init: Literal { + type: "Literal", + raw: "100", + value: 100, + + range: [105, 108], + loc: { + start: { column: 10, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [99, 108], + loc: { + start: { column: 4, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + ], + kind: "var", + + range: [95, 109], + loc: { + start: { column: 0, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "globalThis", + + range: [142, 152], + loc: { + start: { column: 0, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "abc", + + range: [153, 156], + loc: { + start: { column: 11, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + + range: [142, 156], + loc: { + start: { column: 0, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + operator: "=", + right: Literal { + type: "Literal", + raw: "200", + value: 200, + + range: [159, 162], + loc: { + start: { column: 17, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + + range: [142, 162], + loc: { + start: { column: 0, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + + range: [142, 163], + loc: { + start: { column: 0, line: 8 }, + end: { column: 21, line: 8 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "answer", + + range: [169, 175], + loc: { + start: { column: 4, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + init: Literal { + type: "Literal", + raw: "42", + value: 42, + + range: [178, 180], + loc: { + start: { column: 13, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + + range: [169, 180], + loc: { + start: { column: 4, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + ], + kind: "let", + + range: [165, 181], + loc: { + start: { column: 0, line: 10 }, + end: { column: 16, line: 10 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "globalThis", + + range: [250, 260], + loc: { + start: { column: 0, line: 13 }, + end: { column: 10, line: 13 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "answer", + + range: [261, 267], + loc: { + start: { column: 11, line: 13 }, + end: { column: 17, line: 13 }, + }, + }, + + range: [250, 267], + loc: { + start: { column: 0, line: 13 }, + end: { column: 17, line: 13 }, + }, + }, + operator: "=", + right: Literal { + type: "Literal", + raw: "333333", + value: 333333, + + range: [270, 276], + loc: { + start: { column: 20, line: 13 }, + end: { column: 26, line: 13 }, + }, + }, + + range: [250, 276], + loc: { + start: { column: 0, line: 13 }, + end: { column: 26, line: 13 }, + }, + }, + + range: [250, 277], + loc: { + start: { column: 0, line: 13 }, + end: { column: 27, line: 13 }, + }, + }, + ], + sourceType: "script", + + range: [95, 278], + loc: { + start: { column: 0, line: 5 }, + end: { column: 0, line: 14 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..128656bb5f3e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,226 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics global-this TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "var", + + range: [95, 98], + loc: { + start: { column: 0, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "abc", + + range: [99, 102], + loc: { + start: { column: 4, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [103, 104], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "100", + + range: [105, 108], + loc: { + start: { column: 10, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [108, 109], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "globalThis", + + range: [142, 152], + loc: { + start: { column: 0, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [152, 153], + loc: { + start: { column: 10, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "abc", + + range: [153, 156], + loc: { + start: { column: 11, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [157, 158], + loc: { + start: { column: 15, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "200", + + range: [159, 162], + loc: { + start: { column: 17, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [162, 163], + loc: { + start: { column: 20, line: 8 }, + end: { column: 21, line: 8 }, + }, + }, + Keyword { + type: "Keyword", + value: "let", + + range: [165, 168], + loc: { + start: { column: 0, line: 10 }, + end: { column: 3, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "answer", + + range: [169, 175], + loc: { + start: { column: 4, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [176, 177], + loc: { + start: { column: 11, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + Numeric { + type: "Numeric", + value: "42", + + range: [178, 180], + loc: { + start: { column: 13, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [180, 181], + loc: { + start: { column: 15, line: 10 }, + end: { column: 16, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "globalThis", + + range: [250, 260], + loc: { + start: { column: 0, line: 13 }, + end: { column: 10, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [260, 261], + loc: { + start: { column: 10, line: 13 }, + end: { column: 11, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "answer", + + range: [261, 267], + loc: { + start: { column: 11, line: 13 }, + end: { column: 17, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [268, 269], + loc: { + start: { column: 18, line: 13 }, + end: { column: 19, line: 13 }, + }, + }, + Numeric { + type: "Numeric", + value: "333333", + + range: [270, 276], + loc: { + start: { column: 20, line: 13 }, + end: { column: 26, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [276, 277], + loc: { + start: { column: 26, line: 13 }, + end: { column: 27, line: 13 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..b2674d44d05d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/3-Babel-AST.shot @@ -0,0 +1,222 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics global-this Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "abc", + + range: [99, 102], + loc: { + start: { column: 4, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + init: Literal { + type: "Literal", + raw: "100", + value: 100, + + range: [105, 108], + loc: { + start: { column: 10, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [99, 108], + loc: { + start: { column: 4, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + ], + kind: "var", + + range: [95, 109], + loc: { + start: { column: 0, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "globalThis", + + range: [142, 152], + loc: { + start: { column: 0, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "abc", + + range: [153, 156], + loc: { + start: { column: 11, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + + range: [142, 156], + loc: { + start: { column: 0, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + operator: "=", + right: Literal { + type: "Literal", + raw: "200", + value: 200, + + range: [159, 162], + loc: { + start: { column: 17, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + + range: [142, 162], + loc: { + start: { column: 0, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + + range: [142, 163], + loc: { + start: { column: 0, line: 8 }, + end: { column: 21, line: 8 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "answer", + + range: [169, 175], + loc: { + start: { column: 4, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + init: Literal { + type: "Literal", + raw: "42", + value: 42, + + range: [178, 180], + loc: { + start: { column: 13, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + + range: [169, 180], + loc: { + start: { column: 4, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + ], + kind: "let", + + range: [165, 181], + loc: { + start: { column: 0, line: 10 }, + end: { column: 16, line: 10 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "globalThis", + + range: [250, 260], + loc: { + start: { column: 0, line: 13 }, + end: { column: 10, line: 13 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "answer", + + range: [261, 267], + loc: { + start: { column: 11, line: 13 }, + end: { column: 17, line: 13 }, + }, + }, + + range: [250, 267], + loc: { + start: { column: 0, line: 13 }, + end: { column: 17, line: 13 }, + }, + }, + operator: "=", + right: Literal { + type: "Literal", + raw: "333333", + value: 333333, + + range: [270, 276], + loc: { + start: { column: 20, line: 13 }, + end: { column: 26, line: 13 }, + }, + }, + + range: [250, 276], + loc: { + start: { column: 0, line: 13 }, + end: { column: 26, line: 13 }, + }, + }, + + range: [250, 277], + loc: { + start: { column: 0, line: 13 }, + end: { column: 27, line: 13 }, + }, + }, + ], + sourceType: "script", + + range: [95, 278], + loc: { + start: { column: 0, line: 5 }, + end: { column: 0, line: 14 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..54ea5210032d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,226 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics global-this Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "var", + + range: [95, 98], + loc: { + start: { column: 0, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "abc", + + range: [99, 102], + loc: { + start: { column: 4, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [103, 104], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "100", + + range: [105, 108], + loc: { + start: { column: 10, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [108, 109], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "globalThis", + + range: [142, 152], + loc: { + start: { column: 0, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [152, 153], + loc: { + start: { column: 10, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "abc", + + range: [153, 156], + loc: { + start: { column: 11, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [157, 158], + loc: { + start: { column: 15, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "200", + + range: [159, 162], + loc: { + start: { column: 17, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [162, 163], + loc: { + start: { column: 20, line: 8 }, + end: { column: 21, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "let", + + range: [165, 168], + loc: { + start: { column: 0, line: 10 }, + end: { column: 3, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "answer", + + range: [169, 175], + loc: { + start: { column: 4, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [176, 177], + loc: { + start: { column: 11, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + Numeric { + type: "Numeric", + value: "42", + + range: [178, 180], + loc: { + start: { column: 13, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [180, 181], + loc: { + start: { column: 15, line: 10 }, + end: { column: 16, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "globalThis", + + range: [250, 260], + loc: { + start: { column: 0, line: 13 }, + end: { column: 10, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [260, 261], + loc: { + start: { column: 10, line: 13 }, + end: { column: 11, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "answer", + + range: [261, 267], + loc: { + start: { column: 11, line: 13 }, + end: { column: 17, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [268, 269], + loc: { + start: { column: 18, line: 13 }, + end: { column: 19, line: 13 }, + }, + }, + Numeric { + type: "Numeric", + value: "333333", + + range: [270, 276], + loc: { + start: { column: 20, line: 13 }, + end: { column: 26, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [276, 277], + loc: { + start: { column: 26, line: 13 }, + end: { column: 27, line: 13 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..cb8e3363dc52 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics global-this AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..b9af82e6a9eb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,232 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics global-this AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'var', + + range: [95, 98], + loc: { + start: { column: 0, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'abc', + + range: [99, 102], + loc: { + start: { column: 4, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [103, 104], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Numeric { + type: 'Numeric', + value: '100', + + range: [105, 108], + loc: { + start: { column: 10, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [108, 109], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'globalThis', + + range: [142, 152], + loc: { + start: { column: 0, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '.', + + range: [152, 153], + loc: { + start: { column: 10, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'abc', + + range: [153, 156], + loc: { + start: { column: 11, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [157, 158], + loc: { + start: { column: 15, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Numeric { + type: 'Numeric', + value: '200', + + range: [159, 162], + loc: { + start: { column: 17, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [162, 163], + loc: { + start: { column: 20, line: 8 }, + end: { column: 21, line: 8 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [165, 168], + loc: { + start: { column: 0, line: 10 }, + end: { column: 3, line: 10 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'answer', + + range: [169, 175], + loc: { + start: { column: 4, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [176, 177], + loc: { + start: { column: 11, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + Numeric { + type: 'Numeric', + value: '42', + + range: [178, 180], + loc: { + start: { column: 13, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [180, 181], + loc: { + start: { column: 15, line: 10 }, + end: { column: 16, line: 10 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'globalThis', + + range: [250, 260], + loc: { + start: { column: 0, line: 13 }, + end: { column: 10, line: 13 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '.', + + range: [260, 261], + loc: { + start: { column: 10, line: 13 }, + end: { column: 11, line: 13 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'answer', + + range: [261, 267], + loc: { + start: { column: 11, line: 13 }, + end: { column: 17, line: 13 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [268, 269], + loc: { + start: { column: 18, line: 13 }, + end: { column: 19, line: 13 }, + }, + }, + Numeric { + type: 'Numeric', + value: '333333', + + range: [270, 276], + loc: { + start: { column: 20, line: 13 }, + end: { column: 26, line: 13 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [276, 277], + loc: { + start: { column: 26, line: 13 }, + end: { column: 27, line: 13 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/fixture.ts new file mode 100644 index 000000000000..31e8756cc13f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +import foo = require('bar'); diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..2e82a676619c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,57 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-equal-declaration TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSImportEqualsDeclaration { + type: "TSImportEqualsDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + importKind: "value", + isExport: false, + moduleReference: TSExternalModuleReference { + type: "TSExternalModuleReference", + expression: Literal { + type: "Literal", + raw: "'bar'", + value: "bar", + + range: [94, 99], + loc: { + start: { column: 21, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [86, 100], + loc: { + start: { column: 13, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..e26e78b6d996 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-equal-declaration TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "import", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "require", + + range: [86, 93], + loc: { + start: { column: 13, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + String { + type: "String", + value: "'bar'", + + range: [94, 99], + loc: { + start: { column: 21, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..dfde5c7d5e9a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/3-Babel-AST.shot @@ -0,0 +1,57 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-equal-declaration Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSImportEqualsDeclaration { + type: "TSImportEqualsDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + importKind: "value", + isExport: false, + moduleReference: TSExternalModuleReference { + type: "TSExternalModuleReference", + expression: Literal { + type: "Literal", + raw: "'bar'", + value: "bar", + + range: [94, 99], + loc: { + start: { column: 21, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [86, 100], + loc: { + start: { column: 13, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..957ededdd774 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-equal-declaration Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "import", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "require", + + range: [86, 93], + loc: { + start: { column: 13, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + String { + type: "String", + value: "'bar'", + + range: [94, 99], + loc: { + start: { column: 21, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..7547b58c682b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,62 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-equal-declaration AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSImportEqualsDeclaration { + type: 'TSImportEqualsDeclaration', + id: Identifier { + type: 'Identifier', + name: 'foo', + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + importKind: 'value', + isExport: false, + moduleReference: TSExternalModuleReference { + type: 'TSExternalModuleReference', + expression: Literal { + type: 'Literal', + raw: '\\\\'bar\\\\'', + value: 'bar', + + range: [94, 99], + loc: { + start: { column: 21, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [86, 100], + loc: { + start: { column: 13, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..3057b8256f86 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-equal-declaration AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/fixture.ts new file mode 100644 index 000000000000..6ec662dcddcc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +import type foo = require('bar'); diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..9f5f43a5b9f1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,57 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-equal-type-declaration TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSImportEqualsDeclaration { + type: "TSImportEqualsDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + importKind: "type", + isExport: false, + moduleReference: TSExternalModuleReference { + type: "TSExternalModuleReference", + expression: Literal { + type: "Literal", + raw: "'bar'", + value: "bar", + + range: [99, 104], + loc: { + start: { column: 26, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [91, 105], + loc: { + start: { column: 18, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..8696b31fdd1d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-equal-type-declaration TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "import", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "require", + + range: [91, 98], + loc: { + start: { column: 18, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + String { + type: "String", + value: "'bar'", + + range: [99, 104], + loc: { + start: { column: 26, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..ebaf826ae2a4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/3-Babel-AST.shot @@ -0,0 +1,57 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-equal-type-declaration Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSImportEqualsDeclaration { + type: "TSImportEqualsDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + importKind: "type", + isExport: false, + moduleReference: TSExternalModuleReference { + type: "TSExternalModuleReference", + expression: Literal { + type: "Literal", + raw: "'bar'", + value: "bar", + + range: [99, 104], + loc: { + start: { column: 26, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [91, 105], + loc: { + start: { column: 18, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..f6b3a243810a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-equal-type-declaration Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "import", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "require", + + range: [91, 98], + loc: { + start: { column: 18, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + String { + type: "String", + value: "'bar'", + + range: [99, 104], + loc: { + start: { column: 26, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..90637b78f190 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,62 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-equal-type-declaration AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSImportEqualsDeclaration { + type: 'TSImportEqualsDeclaration', + id: Identifier { + type: 'Identifier', + name: 'foo', + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + importKind: 'type', + isExport: false, + moduleReference: TSExternalModuleReference { + type: 'TSExternalModuleReference', + expression: Literal { + type: 'Literal', + raw: '\\\\'bar\\\\'', + value: 'bar', + + range: [99, 104], + loc: { + start: { column: 26, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [91, 105], + loc: { + start: { column: 18, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..59e9fdd1bb2c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-equal-type-declaration AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/fixture.ts new file mode 100644 index 000000000000..8daadbe9fc7b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export import foo = require('bar'); diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..f00d79737947 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,57 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-export-equal-declaration TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSImportEqualsDeclaration { + type: "TSImportEqualsDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + importKind: "value", + isExport: true, + moduleReference: TSExternalModuleReference { + type: "TSExternalModuleReference", + expression: Literal { + type: "Literal", + raw: "'bar'", + value: "bar", + + range: [101, 106], + loc: { + start: { column: 28, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [93, 107], + loc: { + start: { column: 20, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..c3ee37200ad7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-export-equal-declaration TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "import", + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "require", + + range: [93, 100], + loc: { + start: { column: 20, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + String { + type: "String", + value: "'bar'", + + range: [101, 106], + loc: { + start: { column: 28, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..e152a313d3e7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/3-Babel-AST.shot @@ -0,0 +1,57 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-export-equal-declaration Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSImportEqualsDeclaration { + type: "TSImportEqualsDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + importKind: "value", + isExport: true, + moduleReference: TSExternalModuleReference { + type: "TSExternalModuleReference", + expression: Literal { + type: "Literal", + raw: "'bar'", + value: "bar", + + range: [101, 106], + loc: { + start: { column: 28, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [93, 107], + loc: { + start: { column: 20, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..af8b4875ecc8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-export-equal-declaration Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "import", + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "require", + + range: [93, 100], + loc: { + start: { column: 20, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + String { + type: "String", + value: "'bar'", + + range: [101, 106], + loc: { + start: { column: 28, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..ab942c427703 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,62 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-export-equal-declaration AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSImportEqualsDeclaration { + type: 'TSImportEqualsDeclaration', + id: Identifier { + type: 'Identifier', + name: 'foo', + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + importKind: 'value', + isExport: true, + moduleReference: TSExternalModuleReference { + type: 'TSExternalModuleReference', + expression: Literal { + type: 'Literal', + raw: '\\\\'bar\\\\'', + value: 'bar', + + range: [101, 106], + loc: { + start: { column: 28, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [93, 107], + loc: { + start: { column: 20, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..9666e2e665f5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-export-equal-declaration AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/fixture.ts new file mode 100644 index 000000000000..8347accddf73 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export import type foo = require('bar'); diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..d8ab04dfdf9c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,57 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-export-equal-type-declaration TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSImportEqualsDeclaration { + type: "TSImportEqualsDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + importKind: "type", + isExport: true, + moduleReference: TSExternalModuleReference { + type: "TSExternalModuleReference", + expression: Literal { + type: "Literal", + raw: "'bar'", + value: "bar", + + range: [106, 111], + loc: { + start: { column: 33, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [98, 112], + loc: { + start: { column: 25, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 114], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..a98ed030616c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-export-equal-type-declaration TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "import", + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [87, 91], + loc: { + start: { column: 14, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "require", + + range: [98, 105], + loc: { + start: { column: 25, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + String { + type: "String", + value: "'bar'", + + range: [106, 111], + loc: { + start: { column: 33, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..03c5b8949cca --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/3-Babel-AST.shot @@ -0,0 +1,57 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-export-equal-type-declaration Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSImportEqualsDeclaration { + type: "TSImportEqualsDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + importKind: "type", + isExport: true, + moduleReference: TSExternalModuleReference { + type: "TSExternalModuleReference", + expression: Literal { + type: "Literal", + raw: "'bar'", + value: "bar", + + range: [106, 111], + loc: { + start: { column: 33, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [98, 112], + loc: { + start: { column: 25, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 114], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..b9d7ea0f4be7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-export-equal-type-declaration Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "import", + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [87, 91], + loc: { + start: { column: 14, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "require", + + range: [98, 105], + loc: { + start: { column: 25, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + String { + type: "String", + value: "'bar'", + + range: [106, 111], + loc: { + start: { column: 33, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..86ed82a0c57a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,62 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-export-equal-type-declaration AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSImportEqualsDeclaration { + type: 'TSImportEqualsDeclaration', + id: Identifier { + type: 'Identifier', + name: 'foo', + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + importKind: 'type', + isExport: true, + moduleReference: TSExternalModuleReference { + type: 'TSExternalModuleReference', + expression: Literal { + type: 'Literal', + raw: '\\\\'bar\\\\'', + value: 'bar', + + range: [106, 111], + loc: { + start: { column: 33, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [98, 112], + loc: { + start: { column: 25, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [73, 114], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..aa69f2aa8674 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-export-equal-type-declaration AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/fixture.ts new file mode 100644 index 000000000000..7e9e97f2fbae --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +import type foo from 'bar'; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..48906852772c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,59 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-default TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ImportDeclaration { + type: "ImportDeclaration", + assertions: Array [], + importKind: "type", + source: Literal { + type: "Literal", + raw: "'bar'", + value: "bar", + + range: [94, 99], + loc: { + start: { column: 21, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + specifiers: Array [ + ImportDefaultSpecifier { + type: "ImportDefaultSpecifier", + local: Identifier { + type: "Identifier", + name: "foo", + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..c4a109988a92 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-default TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "import", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [89, 93], + loc: { + start: { column: 16, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + String { + type: "String", + value: "'bar'", + + range: [94, 99], + loc: { + start: { column: 21, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..2eab475c9724 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/3-Babel-AST.shot @@ -0,0 +1,59 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-default Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ImportDeclaration { + type: "ImportDeclaration", + assertions: Array [], + importKind: "type", + source: Literal { + type: "Literal", + raw: "'bar'", + value: "bar", + + range: [94, 99], + loc: { + start: { column: 21, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + specifiers: Array [ + ImportDefaultSpecifier { + type: "ImportDefaultSpecifier", + local: Identifier { + type: "Identifier", + name: "foo", + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..0d77e45b9434 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-default Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "import", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [89, 93], + loc: { + start: { column: 16, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + String { + type: "String", + value: "'bar'", + + range: [94, 99], + loc: { + start: { column: 21, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..56b8b3e68a6f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,64 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-default AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ImportDeclaration { + type: 'ImportDeclaration', + assertions: Array [], + importKind: 'type', + source: Literal { + type: 'Literal', + raw: '\\\\'bar\\\\'', + value: 'bar', + + range: [94, 99], + loc: { + start: { column: 21, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + specifiers: Array [ + ImportDefaultSpecifier { + type: 'ImportDefaultSpecifier', + local: Identifier { + type: 'Identifier', + name: 'foo', + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..8376565f2dff --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-default AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/fixture.ts new file mode 100644 index 000000000000..1cf3f2984405 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/fixture.ts @@ -0,0 +1,4 @@ +// TODO: This fixture might be too large, and if so should be split up. + +// this should be treated as a normal import statement +import type from './foo'; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..0d60a3455a5e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,59 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-empty TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ImportDeclaration { + type: "ImportDeclaration", + assertions: Array [], + importKind: "value", + source: Literal { + type: "Literal", + raw: "'./foo'", + value: "./foo", + + range: [145, 152], + loc: { + start: { column: 17, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + specifiers: Array [ + ImportDefaultSpecifier { + type: "ImportDefaultSpecifier", + local: Identifier { + type: "Identifier", + name: "type", + + range: [135, 139], + loc: { + start: { column: 7, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + + range: [135, 139], + loc: { + start: { column: 7, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ], + + range: [128, 153], + loc: { + start: { column: 0, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + ], + sourceType: "module", + + range: [128, 154], + loc: { + start: { column: 0, line: 4 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..901cb4efb701 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-empty TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "import", + + range: [128, 134], + loc: { + start: { column: 0, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [135, 139], + loc: { + start: { column: 7, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [140, 144], + loc: { + start: { column: 12, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + String { + type: "String", + value: "'./foo'", + + range: [145, 152], + loc: { + start: { column: 17, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [152, 153], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..31331f8affe1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/3-Babel-AST.shot @@ -0,0 +1,59 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-empty Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ImportDeclaration { + type: "ImportDeclaration", + assertions: Array [], + importKind: "value", + source: Literal { + type: "Literal", + raw: "'./foo'", + value: "./foo", + + range: [145, 152], + loc: { + start: { column: 17, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + specifiers: Array [ + ImportDefaultSpecifier { + type: "ImportDefaultSpecifier", + local: Identifier { + type: "Identifier", + name: "type", + + range: [135, 139], + loc: { + start: { column: 7, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + + range: [135, 139], + loc: { + start: { column: 7, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ], + + range: [128, 153], + loc: { + start: { column: 0, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + ], + sourceType: "module", + + range: [128, 154], + loc: { + start: { column: 0, line: 4 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..eba9c6a63861 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-empty Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "import", + + range: [128, 134], + loc: { + start: { column: 0, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [135, 139], + loc: { + start: { column: 7, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [140, 144], + loc: { + start: { column: 12, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + String { + type: "String", + value: "'./foo'", + + range: [145, 152], + loc: { + start: { column: 17, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [152, 153], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..c7fc07efd943 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-empty AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..82a94222a8da --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-empty AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/fixture.ts new file mode 100644 index 000000000000..d5cde439a347 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +import type { foo as bar } from 'baz'; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..ea9e75a959d8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,70 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-named-as TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ImportDeclaration { + type: "ImportDeclaration", + assertions: Array [], + importKind: "type", + source: Literal { + type: "Literal", + raw: "'baz'", + value: "baz", + + range: [105, 110], + loc: { + start: { column: 32, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + specifiers: Array [ + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "bar", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [87, 97], + loc: { + start: { column: 14, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + + range: [73, 111], + loc: { + start: { column: 0, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..50b42d34e21c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-named-as TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "import", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [91, 93], + loc: { + start: { column: 18, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [100, 104], + loc: { + start: { column: 27, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + String { + type: "String", + value: "'baz'", + + range: [105, 110], + loc: { + start: { column: 32, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..d351b672f4a1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/3-Babel-AST.shot @@ -0,0 +1,70 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-named-as Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ImportDeclaration { + type: "ImportDeclaration", + assertions: Array [], + importKind: "type", + source: Literal { + type: "Literal", + raw: "'baz'", + value: "baz", + + range: [105, 110], + loc: { + start: { column: 32, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + specifiers: Array [ + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "bar", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [87, 97], + loc: { + start: { column: 14, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + + range: [73, 111], + loc: { + start: { column: 0, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..1ae8830db209 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-named-as Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "import", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [91, 93], + loc: { + start: { column: 18, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [100, 104], + loc: { + start: { column: 27, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + String { + type: "String", + value: "'baz'", + + range: [105, 110], + loc: { + start: { column: 32, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..3c407baaabe1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,75 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-named-as AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ImportDeclaration { + type: 'ImportDeclaration', + assertions: Array [], + importKind: 'type', + source: Literal { + type: 'Literal', + raw: '\\\\'baz\\\\'', + value: 'baz', + + range: [105, 110], + loc: { + start: { column: 32, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + specifiers: Array [ + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'foo', + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'bar', + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [87, 97], + loc: { + start: { column: 14, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + + range: [73, 111], + loc: { + start: { column: 0, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..8766010f24d4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-named-as AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/fixture.ts new file mode 100644 index 000000000000..62eb0474ecbf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +import type { foo, bar } from 'baz'; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..b7bd3d542ff5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,100 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-named TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ImportDeclaration { + type: "ImportDeclaration", + assertions: Array [], + importKind: "type", + source: Literal { + type: "Literal", + raw: "'baz'", + value: "baz", + + range: [103, 108], + loc: { + start: { column: 30, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + specifiers: Array [ + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "bar", + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "bar", + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..92f2cc3cfa6c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-named TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "import", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [98, 102], + loc: { + start: { column: 25, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + String { + type: "String", + value: "'baz'", + + range: [103, 108], + loc: { + start: { column: 30, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..609a1a67a4cf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/3-Babel-AST.shot @@ -0,0 +1,100 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-named Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ImportDeclaration { + type: "ImportDeclaration", + assertions: Array [], + importKind: "type", + source: Literal { + type: "Literal", + raw: "'baz'", + value: "baz", + + range: [103, 108], + loc: { + start: { column: 30, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + specifiers: Array [ + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "bar", + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "bar", + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..3d3ac0665bf9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-named Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "import", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [98, 102], + loc: { + start: { column: 25, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + String { + type: "String", + value: "'baz'", + + range: [103, 108], + loc: { + start: { column: 30, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..228d178064a1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,105 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-named AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ImportDeclaration { + type: 'ImportDeclaration', + assertions: Array [], + importKind: 'type', + source: Literal { + type: 'Literal', + raw: '\\\\'baz\\\\'', + value: 'baz', + + range: [103, 108], + loc: { + start: { column: 30, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + specifiers: Array [ + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'foo', + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'foo', + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'bar', + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'bar', + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..2e3709d81711 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-named AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/fixture.ts new file mode 100644 index 000000000000..695ba5410410 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +import type * as foo from './bar'; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..1124bbe8ceb1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,59 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-star-as-ns TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ImportDeclaration { + type: "ImportDeclaration", + assertions: Array [], + importKind: "type", + source: Literal { + type: "Literal", + raw: "'./bar'", + value: "./bar", + + range: [99, 106], + loc: { + start: { column: 26, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + specifiers: Array [ + ImportNamespaceSpecifier { + type: "ImportNamespaceSpecifier", + local: Identifier { + type: "Identifier", + name: "foo", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..e5650392c5ea --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-star-as-ns TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "import", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "*", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [87, 89], + loc: { + start: { column: 14, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [94, 98], + loc: { + start: { column: 21, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + String { + type: "String", + value: "'./bar'", + + range: [99, 106], + loc: { + start: { column: 26, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..786eb5d28df0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/3-Babel-AST.shot @@ -0,0 +1,59 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-star-as-ns Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ImportDeclaration { + type: "ImportDeclaration", + assertions: Array [], + importKind: "type", + source: Literal { + type: "Literal", + raw: "'./bar'", + value: "./bar", + + range: [99, 106], + loc: { + start: { column: 26, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + specifiers: Array [ + ImportNamespaceSpecifier { + type: "ImportNamespaceSpecifier", + local: Identifier { + type: "Identifier", + name: "foo", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..25eecab99edd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-star-as-ns Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "import", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "*", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [87, 89], + loc: { + start: { column: 14, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [94, 98], + loc: { + start: { column: 21, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + String { + type: "String", + value: "'./bar'", + + range: [99, 106], + loc: { + start: { column: 26, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..57f1afe7c7b6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,64 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-star-as-ns AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ImportDeclaration { + type: 'ImportDeclaration', + assertions: Array [], + importKind: 'type', + source: Literal { + type: 'Literal', + raw: '\\\\'./bar\\\\'', + value: './bar', + + range: [99, 106], + loc: { + start: { column: 26, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + specifiers: Array [ + ImportNamespaceSpecifier { + type: 'ImportNamespaceSpecifier', + local: Identifier { + type: 'Identifier', + name: 'foo', + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..21586228a576 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-type-star-as-ns AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/fixture.ts new file mode 100644 index 000000000000..02a8f19281e7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +import foo from 'mod' assert { type: 'json' }; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..0fbc4660b196 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,90 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-with-import-assertions TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ImportDeclaration { + type: "ImportDeclaration", + assertions: Array [ + ImportAttribute { + type: "ImportAttribute", + key: Identifier { + type: "Identifier", + name: "type", + + range: [104, 108], + loc: { + start: { column: 31, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + value: Literal { + type: "Literal", + raw: "'json'", + value: "json", + + range: [110, 116], + loc: { + start: { column: 37, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + + range: [104, 116], + loc: { + start: { column: 31, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + ], + importKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [89, 94], + loc: { + start: { column: 16, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + specifiers: Array [ + ImportDefaultSpecifier { + type: "ImportDefaultSpecifier", + local: Identifier { + type: "Identifier", + name: "foo", + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + ], + + range: [73, 119], + loc: { + start: { column: 0, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 120], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..a62a8abd1d50 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-with-import-assertions TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "import", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [84, 88], + loc: { + start: { column: 11, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [89, 94], + loc: { + start: { column: 16, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "assert", + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [104, 108], + loc: { + start: { column: 31, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + String { + type: "String", + value: "'json'", + + range: [110, 116], + loc: { + start: { column: 37, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [118, 119], + loc: { + start: { column: 45, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..e23aef331362 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/3-Babel-AST.shot @@ -0,0 +1,90 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-with-import-assertions Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ImportDeclaration { + type: "ImportDeclaration", + assertions: Array [ + ImportAttribute { + type: "ImportAttribute", + key: Identifier { + type: "Identifier", + name: "type", + + range: [104, 108], + loc: { + start: { column: 31, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + value: Literal { + type: "Literal", + raw: "'json'", + value: "json", + + range: [110, 116], + loc: { + start: { column: 37, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + + range: [104, 116], + loc: { + start: { column: 31, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + ], + importKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [89, 94], + loc: { + start: { column: 16, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + specifiers: Array [ + ImportDefaultSpecifier { + type: "ImportDefaultSpecifier", + local: Identifier { + type: "Identifier", + name: "foo", + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + ], + + range: [73, 119], + loc: { + start: { column: 0, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 120], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..6685f10a327b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-with-import-assertions Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "import", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [84, 88], + loc: { + start: { column: 11, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [89, 94], + loc: { + start: { column: 16, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "assert", + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [104, 108], + loc: { + start: { column: 31, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + String { + type: "String", + value: "'json'", + + range: [110, 116], + loc: { + start: { column: 37, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [118, 119], + loc: { + start: { column: 45, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..5c25cc16fb8f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-with-import-assertions AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..511c97fc96ad --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics import-with-import-assertions AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/fixture.ts new file mode 100644 index 000000000000..32b1f6aa1a3b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo extends Bar, Baz {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..c8a902ea54ab --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,85 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-extends-multiple TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [104, 106], + loc: { + start: { column: 31, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + extends: Array [ + TSInterfaceHeritage { + type: "TSInterfaceHeritage", + expression: Identifier { + type: "Identifier", + name: "Bar", + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + TSInterfaceHeritage { + type: "TSInterfaceHeritage", + expression: Identifier { + type: "Identifier", + name: "Baz", + + range: [100, 103], + loc: { + start: { column: 27, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [100, 103], + loc: { + start: { column: 27, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..dc4bc300708e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-extends-multiple TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [87, 94], + loc: { + start: { column: 14, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Baz", + + range: [100, 103], + loc: { + start: { column: 27, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..4e257b12e2ea --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/3-Babel-AST.shot @@ -0,0 +1,85 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-extends-multiple Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [104, 106], + loc: { + start: { column: 31, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + extends: Array [ + TSExpressionWithTypeArguments { + type: "TSExpressionWithTypeArguments", + expression: Identifier { + type: "Identifier", + name: "Bar", + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + TSExpressionWithTypeArguments { + type: "TSExpressionWithTypeArguments", + expression: Identifier { + type: "Identifier", + name: "Baz", + + range: [100, 103], + loc: { + start: { column: 27, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [100, 103], + loc: { + start: { column: 27, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..7388dcef1553 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-extends-multiple Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [87, 94], + loc: { + start: { column: 14, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Baz", + + range: [100, 103], + loc: { + start: { column: 27, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..6826fae73fb1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,93 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-extends-multiple AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [], + + range: [104, 106], + loc: { + start: { column: 31, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + extends: Array [ +- TSInterfaceHeritage { +- type: 'TSInterfaceHeritage', ++ TSExpressionWithTypeArguments { ++ type: 'TSExpressionWithTypeArguments', + expression: Identifier { + type: 'Identifier', + name: 'Bar', + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, +- TSInterfaceHeritage { +- type: 'TSInterfaceHeritage', ++ TSExpressionWithTypeArguments { ++ type: 'TSExpressionWithTypeArguments', + expression: Identifier { + type: 'Identifier', + name: 'Baz', + + range: [100, 103], + loc: { + start: { column: 27, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [100, 103], + loc: { + start: { column: 27, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..10113760072f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,92 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-extends-multiple AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'extends', + + range: [87, 94], + loc: { + start: { column: 14, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Bar', + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Baz', + + range: [100, 103], + loc: { + start: { column: 27, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/fixture.ts new file mode 100644 index 000000000000..8b038f3ab872 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo extends Bar {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..74441083761e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-extends TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [99, 101], + loc: { + start: { column: 26, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + extends: Array [ + TSInterfaceHeritage { + type: "TSInterfaceHeritage", + expression: Identifier { + type: "Identifier", + name: "Bar", + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..d47b56d3d7c3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-extends TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [87, 94], + loc: { + start: { column: 14, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..32a8de8d4ebd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/3-Babel-AST.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-extends Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [99, 101], + loc: { + start: { column: 26, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + extends: Array [ + TSExpressionWithTypeArguments { + type: "TSExpressionWithTypeArguments", + expression: Identifier { + type: "Identifier", + name: "Bar", + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..c1d8fd85eebe --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-extends Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [87, 94], + loc: { + start: { column: 14, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..5d2ae168cc4f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,72 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-extends AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [], + + range: [99, 101], + loc: { + start: { column: 26, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + extends: Array [ +- TSInterfaceHeritage { +- type: 'TSInterfaceHeritage', ++ TSExpressionWithTypeArguments { ++ type: 'TSExpressionWithTypeArguments', + expression: Identifier { + type: 'Identifier', + name: 'Bar', + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + ], + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..65558a1c48f8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,72 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-extends AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'extends', + + range: [87, 94], + loc: { + start: { column: 14, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Bar', + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/fixture.ts new file mode 100644 index 000000000000..39ea67683d1c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..316e2a82e7f6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,77 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-type-parameters TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [90, 92], + loc: { + start: { column: 17, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + out: false, + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..c92a869f320b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-type-parameters TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..564b16453c18 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/3-Babel-AST.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-type-parameters Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [90, 92], + loc: { + start: { column: 17, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..b59423e15940 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-type-parameters Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..ce9b773200c6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,82 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-type-parameters AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [], + + range: [90, 92], + loc: { + start: { column: 17, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [87, 88], +- loc: { +- start: { column: 14, line: 3 }, +- end: { column: 15, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..7a06f166fb49 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,82 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-type-parameters AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/fixture.ts new file mode 100644 index 000000000000..da8e1f6751b6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/fixture.ts @@ -0,0 +1,15 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo { + baa: number; + bar?: number; + [bax]: string; + [baz]?: string; + [eee: number]: string; + doo(): void; + coo?(a, b, c): void; + [loo]?(a, b, c): void; + boo(a, b, c): void; + new (a, b?): string; + new (a, b?): string; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..2b42ff502a9c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,676 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "baa", + + range: [91, 94], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [96, 102], + loc: { + start: { column: 7, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [94, 102], + loc: { + start: { column: 5, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [91, 103], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [106, 109], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [112, 118], + loc: { + start: { column: 8, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + + range: [110, 118], + loc: { + start: { column: 6, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + + range: [106, 119], + loc: { + start: { column: 2, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + TSPropertySignature { + type: "TSPropertySignature", + computed: true, + key: Identifier { + type: "Identifier", + name: "bax", + + range: [123, 126], + loc: { + start: { column: 3, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [129, 135], + loc: { + start: { column: 9, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [127, 135], + loc: { + start: { column: 7, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [122, 136], + loc: { + start: { column: 2, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + TSPropertySignature { + type: "TSPropertySignature", + computed: true, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [140, 143], + loc: { + start: { column: 3, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [147, 153], + loc: { + start: { column: 10, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + + range: [145, 153], + loc: { + start: { column: 8, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + + range: [139, 154], + loc: { + start: { column: 2, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + TSIndexSignature { + type: "TSIndexSignature", + parameters: Array [ + Identifier { + type: "Identifier", + name: "eee", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [163, 169], + loc: { + start: { column: 8, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + + range: [161, 169], + loc: { + start: { column: 6, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + + range: [158, 169], + loc: { + start: { column: 3, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [172, 178], + loc: { + start: { column: 17, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + + range: [170, 178], + loc: { + start: { column: 15, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + + range: [157, 179], + loc: { + start: { column: 2, line: 8 }, + end: { column: 24, line: 8 }, + }, + }, + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "doo", + + range: [182, 185], + loc: { + start: { column: 2, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + kind: "method", + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [189, 193], + loc: { + start: { column: 9, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + + range: [187, 193], + loc: { + start: { column: 7, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + + range: [182, 194], + loc: { + start: { column: 2, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "coo", + + range: [197, 200], + loc: { + start: { column: 2, line: 10 }, + end: { column: 5, line: 10 }, + }, + }, + kind: "method", + optional: true, + params: Array [ + Identifier { + type: "Identifier", + name: "a", + + range: [202, 203], + loc: { + start: { column: 7, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + name: "b", + + range: [205, 206], + loc: { + start: { column: 10, line: 10 }, + end: { column: 11, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + name: "c", + + range: [208, 209], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [212, 216], + loc: { + start: { column: 17, line: 10 }, + end: { column: 21, line: 10 }, + }, + }, + + range: [210, 216], + loc: { + start: { column: 15, line: 10 }, + end: { column: 21, line: 10 }, + }, + }, + + range: [197, 217], + loc: { + start: { column: 2, line: 10 }, + end: { column: 22, line: 10 }, + }, + }, + TSMethodSignature { + type: "TSMethodSignature", + computed: true, + key: Identifier { + type: "Identifier", + name: "loo", + + range: [221, 224], + loc: { + start: { column: 3, line: 11 }, + end: { column: 6, line: 11 }, + }, + }, + kind: "method", + optional: true, + params: Array [ + Identifier { + type: "Identifier", + name: "a", + + range: [227, 228], + loc: { + start: { column: 9, line: 11 }, + end: { column: 10, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + name: "b", + + range: [230, 231], + loc: { + start: { column: 12, line: 11 }, + end: { column: 13, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + name: "c", + + range: [233, 234], + loc: { + start: { column: 15, line: 11 }, + end: { column: 16, line: 11 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [237, 241], + loc: { + start: { column: 19, line: 11 }, + end: { column: 23, line: 11 }, + }, + }, + + range: [235, 241], + loc: { + start: { column: 17, line: 11 }, + end: { column: 23, line: 11 }, + }, + }, + + range: [220, 242], + loc: { + start: { column: 2, line: 11 }, + end: { column: 24, line: 11 }, + }, + }, + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "boo", + + range: [245, 248], + loc: { + start: { column: 2, line: 12 }, + end: { column: 5, line: 12 }, + }, + }, + kind: "method", + params: Array [ + Identifier { + type: "Identifier", + name: "a", + + range: [252, 253], + loc: { + start: { column: 9, line: 12 }, + end: { column: 10, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + name: "b", + + range: [255, 256], + loc: { + start: { column: 12, line: 12 }, + end: { column: 13, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + name: "c", + + range: [258, 259], + loc: { + start: { column: 15, line: 12 }, + end: { column: 16, line: 12 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [262, 266], + loc: { + start: { column: 19, line: 12 }, + end: { column: 23, line: 12 }, + }, + }, + + range: [260, 266], + loc: { + start: { column: 17, line: 12 }, + end: { column: 23, line: 12 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "J", + + range: [249, 250], + loc: { + start: { column: 6, line: 12 }, + end: { column: 7, line: 12 }, + }, + }, + out: false, + + range: [249, 250], + loc: { + start: { column: 6, line: 12 }, + end: { column: 7, line: 12 }, + }, + }, + ], + + range: [248, 251], + loc: { + start: { column: 5, line: 12 }, + end: { column: 8, line: 12 }, + }, + }, + + range: [245, 267], + loc: { + start: { column: 2, line: 12 }, + end: { column: 24, line: 12 }, + }, + }, + TSConstructSignatureDeclaration { + type: "TSConstructSignatureDeclaration", + params: Array [ + Identifier { + type: "Identifier", + name: "a", + + range: [275, 276], + loc: { + start: { column: 7, line: 13 }, + end: { column: 8, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + name: "b", + optional: true, + + range: [278, 280], + loc: { + start: { column: 10, line: 13 }, + end: { column: 12, line: 13 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [283, 289], + loc: { + start: { column: 15, line: 13 }, + end: { column: 21, line: 13 }, + }, + }, + + range: [281, 289], + loc: { + start: { column: 13, line: 13 }, + end: { column: 21, line: 13 }, + }, + }, + + range: [270, 290], + loc: { + start: { column: 2, line: 13 }, + end: { column: 22, line: 13 }, + }, + }, + TSConstructSignatureDeclaration { + type: "TSConstructSignatureDeclaration", + params: Array [ + Identifier { + type: "Identifier", + name: "a", + + range: [301, 302], + loc: { + start: { column: 10, line: 14 }, + end: { column: 11, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + name: "b", + optional: true, + + range: [304, 306], + loc: { + start: { column: 13, line: 14 }, + end: { column: 15, line: 14 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [309, 315], + loc: { + start: { column: 18, line: 14 }, + end: { column: 24, line: 14 }, + }, + }, + + range: [307, 315], + loc: { + start: { column: 16, line: 14 }, + end: { column: 24, line: 14 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "F", + + range: [298, 299], + loc: { + start: { column: 7, line: 14 }, + end: { column: 8, line: 14 }, + }, + }, + out: false, + + range: [298, 299], + loc: { + start: { column: 7, line: 14 }, + end: { column: 8, line: 14 }, + }, + }, + ], + + range: [297, 300], + loc: { + start: { column: 6, line: 14 }, + end: { column: 9, line: 14 }, + }, + }, + + range: [293, 316], + loc: { + start: { column: 2, line: 14 }, + end: { column: 25, line: 14 }, + }, + }, + ], + + range: [87, 318], + loc: { + start: { column: 14, line: 3 }, + end: { column: 1, line: 15 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 318], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 15 }, + }, + }, + ], + sourceType: "script", + + range: [73, 319], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 16 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..04ddf174503a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,1036 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "baa", + + range: [91, 94], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [94, 95], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [96, 102], + loc: { + start: { column: 7, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [102, 103], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [106, 109], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [109, 110], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [110, 111], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [112, 118], + loc: { + start: { column: 8, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [118, 119], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [122, 123], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "bax", + + range: [123, 126], + loc: { + start: { column: 3, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [126, 127], + loc: { + start: { column: 6, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [127, 128], + loc: { + start: { column: 7, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [129, 135], + loc: { + start: { column: 9, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [135, 136], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [139, 140], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [140, 143], + loc: { + start: { column: 3, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [143, 144], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [144, 145], + loc: { + start: { column: 7, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [145, 146], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [147, 153], + loc: { + start: { column: 10, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [153, 154], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [157, 158], + loc: { + start: { column: 2, line: 8 }, + end: { column: 3, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "eee", + + range: [158, 161], + loc: { + start: { column: 3, line: 8 }, + end: { column: 6, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [161, 162], + loc: { + start: { column: 6, line: 8 }, + end: { column: 7, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [163, 169], + loc: { + start: { column: 8, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [169, 170], + loc: { + start: { column: 14, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [170, 171], + loc: { + start: { column: 15, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [172, 178], + loc: { + start: { column: 17, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [178, 179], + loc: { + start: { column: 23, line: 8 }, + end: { column: 24, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "doo", + + range: [182, 185], + loc: { + start: { column: 2, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [185, 186], + loc: { + start: { column: 5, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [186, 187], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [187, 188], + loc: { + start: { column: 7, line: 9 }, + end: { column: 8, line: 9 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [189, 193], + loc: { + start: { column: 9, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [193, 194], + loc: { + start: { column: 13, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "coo", + + range: [197, 200], + loc: { + start: { column: 2, line: 10 }, + end: { column: 5, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [200, 201], + loc: { + start: { column: 5, line: 10 }, + end: { column: 6, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [201, 202], + loc: { + start: { column: 6, line: 10 }, + end: { column: 7, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [202, 203], + loc: { + start: { column: 7, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [203, 204], + loc: { + start: { column: 8, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [205, 206], + loc: { + start: { column: 10, line: 10 }, + end: { column: 11, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [206, 207], + loc: { + start: { column: 11, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "c", + + range: [208, 209], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [209, 210], + loc: { + start: { column: 14, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [210, 211], + loc: { + start: { column: 15, line: 10 }, + end: { column: 16, line: 10 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [212, 216], + loc: { + start: { column: 17, line: 10 }, + end: { column: 21, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [216, 217], + loc: { + start: { column: 21, line: 10 }, + end: { column: 22, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [220, 221], + loc: { + start: { column: 2, line: 11 }, + end: { column: 3, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "loo", + + range: [221, 224], + loc: { + start: { column: 3, line: 11 }, + end: { column: 6, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [224, 225], + loc: { + start: { column: 6, line: 11 }, + end: { column: 7, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [225, 226], + loc: { + start: { column: 7, line: 11 }, + end: { column: 8, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [226, 227], + loc: { + start: { column: 8, line: 11 }, + end: { column: 9, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [227, 228], + loc: { + start: { column: 9, line: 11 }, + end: { column: 10, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [228, 229], + loc: { + start: { column: 10, line: 11 }, + end: { column: 11, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [230, 231], + loc: { + start: { column: 12, line: 11 }, + end: { column: 13, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [231, 232], + loc: { + start: { column: 13, line: 11 }, + end: { column: 14, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "c", + + range: [233, 234], + loc: { + start: { column: 15, line: 11 }, + end: { column: 16, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [234, 235], + loc: { + start: { column: 16, line: 11 }, + end: { column: 17, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [235, 236], + loc: { + start: { column: 17, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [237, 241], + loc: { + start: { column: 19, line: 11 }, + end: { column: 23, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [241, 242], + loc: { + start: { column: 23, line: 11 }, + end: { column: 24, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "boo", + + range: [245, 248], + loc: { + start: { column: 2, line: 12 }, + end: { column: 5, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [248, 249], + loc: { + start: { column: 5, line: 12 }, + end: { column: 6, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + value: "J", + + range: [249, 250], + loc: { + start: { column: 6, line: 12 }, + end: { column: 7, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [250, 251], + loc: { + start: { column: 7, line: 12 }, + end: { column: 8, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [251, 252], + loc: { + start: { column: 8, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [252, 253], + loc: { + start: { column: 9, line: 12 }, + end: { column: 10, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [253, 254], + loc: { + start: { column: 10, line: 12 }, + end: { column: 11, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [255, 256], + loc: { + start: { column: 12, line: 12 }, + end: { column: 13, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [256, 257], + loc: { + start: { column: 13, line: 12 }, + end: { column: 14, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + value: "c", + + range: [258, 259], + loc: { + start: { column: 15, line: 12 }, + end: { column: 16, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [259, 260], + loc: { + start: { column: 16, line: 12 }, + end: { column: 17, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [260, 261], + loc: { + start: { column: 17, line: 12 }, + end: { column: 18, line: 12 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [262, 266], + loc: { + start: { column: 19, line: 12 }, + end: { column: 23, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [266, 267], + loc: { + start: { column: 23, line: 12 }, + end: { column: 24, line: 12 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [270, 273], + loc: { + start: { column: 2, line: 13 }, + end: { column: 5, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [274, 275], + loc: { + start: { column: 6, line: 13 }, + end: { column: 7, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [275, 276], + loc: { + start: { column: 7, line: 13 }, + end: { column: 8, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [276, 277], + loc: { + start: { column: 8, line: 13 }, + end: { column: 9, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [278, 279], + loc: { + start: { column: 10, line: 13 }, + end: { column: 11, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [279, 280], + loc: { + start: { column: 11, line: 13 }, + end: { column: 12, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [280, 281], + loc: { + start: { column: 12, line: 13 }, + end: { column: 13, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [281, 282], + loc: { + start: { column: 13, line: 13 }, + end: { column: 14, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [283, 289], + loc: { + start: { column: 15, line: 13 }, + end: { column: 21, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [289, 290], + loc: { + start: { column: 21, line: 13 }, + end: { column: 22, line: 13 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [293, 296], + loc: { + start: { column: 2, line: 14 }, + end: { column: 5, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [297, 298], + loc: { + start: { column: 6, line: 14 }, + end: { column: 7, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "F", + + range: [298, 299], + loc: { + start: { column: 7, line: 14 }, + end: { column: 8, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [299, 300], + loc: { + start: { column: 8, line: 14 }, + end: { column: 9, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [300, 301], + loc: { + start: { column: 9, line: 14 }, + end: { column: 10, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [301, 302], + loc: { + start: { column: 10, line: 14 }, + end: { column: 11, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [302, 303], + loc: { + start: { column: 11, line: 14 }, + end: { column: 12, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [304, 305], + loc: { + start: { column: 13, line: 14 }, + end: { column: 14, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [305, 306], + loc: { + start: { column: 14, line: 14 }, + end: { column: 15, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [306, 307], + loc: { + start: { column: 15, line: 14 }, + end: { column: 16, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [307, 308], + loc: { + start: { column: 16, line: 14 }, + end: { column: 17, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [309, 315], + loc: { + start: { column: 18, line: 14 }, + end: { column: 24, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [315, 316], + loc: { + start: { column: 24, line: 14 }, + end: { column: 25, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [317, 318], + loc: { + start: { column: 0, line: 15 }, + end: { column: 1, line: 15 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..8f12ecd79d66 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/3-Babel-AST.shot @@ -0,0 +1,654 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "baa", + + range: [91, 94], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [96, 102], + loc: { + start: { column: 7, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [94, 102], + loc: { + start: { column: 5, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [91, 103], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [106, 109], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [112, 118], + loc: { + start: { column: 8, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + + range: [110, 118], + loc: { + start: { column: 6, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + + range: [106, 119], + loc: { + start: { column: 2, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + TSPropertySignature { + type: "TSPropertySignature", + computed: true, + key: Identifier { + type: "Identifier", + name: "bax", + + range: [123, 126], + loc: { + start: { column: 3, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [129, 135], + loc: { + start: { column: 9, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [127, 135], + loc: { + start: { column: 7, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [122, 136], + loc: { + start: { column: 2, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + TSPropertySignature { + type: "TSPropertySignature", + computed: true, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [140, 143], + loc: { + start: { column: 3, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [147, 153], + loc: { + start: { column: 10, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + + range: [145, 153], + loc: { + start: { column: 8, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + + range: [139, 154], + loc: { + start: { column: 2, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + TSIndexSignature { + type: "TSIndexSignature", + parameters: Array [ + Identifier { + type: "Identifier", + name: "eee", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [163, 169], + loc: { + start: { column: 8, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + + range: [161, 169], + loc: { + start: { column: 6, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + + range: [158, 169], + loc: { + start: { column: 3, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [172, 178], + loc: { + start: { column: 17, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + + range: [170, 178], + loc: { + start: { column: 15, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + + range: [157, 179], + loc: { + start: { column: 2, line: 8 }, + end: { column: 24, line: 8 }, + }, + }, + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "doo", + + range: [182, 185], + loc: { + start: { column: 2, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + kind: "method", + parameters: Array [], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [189, 193], + loc: { + start: { column: 9, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + + range: [187, 193], + loc: { + start: { column: 7, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + + range: [182, 194], + loc: { + start: { column: 2, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "coo", + + range: [197, 200], + loc: { + start: { column: 2, line: 10 }, + end: { column: 5, line: 10 }, + }, + }, + kind: "method", + optional: true, + parameters: Array [ + Identifier { + type: "Identifier", + name: "a", + + range: [202, 203], + loc: { + start: { column: 7, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + name: "b", + + range: [205, 206], + loc: { + start: { column: 10, line: 10 }, + end: { column: 11, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + name: "c", + + range: [208, 209], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [212, 216], + loc: { + start: { column: 17, line: 10 }, + end: { column: 21, line: 10 }, + }, + }, + + range: [210, 216], + loc: { + start: { column: 15, line: 10 }, + end: { column: 21, line: 10 }, + }, + }, + + range: [197, 217], + loc: { + start: { column: 2, line: 10 }, + end: { column: 22, line: 10 }, + }, + }, + TSMethodSignature { + type: "TSMethodSignature", + computed: true, + key: Identifier { + type: "Identifier", + name: "loo", + + range: [221, 224], + loc: { + start: { column: 3, line: 11 }, + end: { column: 6, line: 11 }, + }, + }, + kind: "method", + optional: true, + parameters: Array [ + Identifier { + type: "Identifier", + name: "a", + + range: [227, 228], + loc: { + start: { column: 9, line: 11 }, + end: { column: 10, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + name: "b", + + range: [230, 231], + loc: { + start: { column: 12, line: 11 }, + end: { column: 13, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + name: "c", + + range: [233, 234], + loc: { + start: { column: 15, line: 11 }, + end: { column: 16, line: 11 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [237, 241], + loc: { + start: { column: 19, line: 11 }, + end: { column: 23, line: 11 }, + }, + }, + + range: [235, 241], + loc: { + start: { column: 17, line: 11 }, + end: { column: 23, line: 11 }, + }, + }, + + range: [220, 242], + loc: { + start: { column: 2, line: 11 }, + end: { column: 24, line: 11 }, + }, + }, + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "boo", + + range: [245, 248], + loc: { + start: { column: 2, line: 12 }, + end: { column: 5, line: 12 }, + }, + }, + kind: "method", + parameters: Array [ + Identifier { + type: "Identifier", + name: "a", + + range: [252, 253], + loc: { + start: { column: 9, line: 12 }, + end: { column: 10, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + name: "b", + + range: [255, 256], + loc: { + start: { column: 12, line: 12 }, + end: { column: 13, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + name: "c", + + range: [258, 259], + loc: { + start: { column: 15, line: 12 }, + end: { column: 16, line: 12 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [262, 266], + loc: { + start: { column: 19, line: 12 }, + end: { column: 23, line: 12 }, + }, + }, + + range: [260, 266], + loc: { + start: { column: 17, line: 12 }, + end: { column: 23, line: 12 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "J", + + range: [249, 250], + loc: { + start: { column: 6, line: 12 }, + end: { column: 7, line: 12 }, + }, + }, + ], + + range: [248, 251], + loc: { + start: { column: 5, line: 12 }, + end: { column: 8, line: 12 }, + }, + }, + + range: [245, 267], + loc: { + start: { column: 2, line: 12 }, + end: { column: 24, line: 12 }, + }, + }, + TSConstructSignatureDeclaration { + type: "TSConstructSignatureDeclaration", + parameters: Array [ + Identifier { + type: "Identifier", + name: "a", + + range: [275, 276], + loc: { + start: { column: 7, line: 13 }, + end: { column: 8, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + name: "b", + optional: true, + + range: [278, 280], + loc: { + start: { column: 10, line: 13 }, + end: { column: 12, line: 13 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [283, 289], + loc: { + start: { column: 15, line: 13 }, + end: { column: 21, line: 13 }, + }, + }, + + range: [281, 289], + loc: { + start: { column: 13, line: 13 }, + end: { column: 21, line: 13 }, + }, + }, + + range: [270, 290], + loc: { + start: { column: 2, line: 13 }, + end: { column: 22, line: 13 }, + }, + }, + TSConstructSignatureDeclaration { + type: "TSConstructSignatureDeclaration", + parameters: Array [ + Identifier { + type: "Identifier", + name: "a", + + range: [301, 302], + loc: { + start: { column: 10, line: 14 }, + end: { column: 11, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + name: "b", + optional: true, + + range: [304, 306], + loc: { + start: { column: 13, line: 14 }, + end: { column: 15, line: 14 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [309, 315], + loc: { + start: { column: 18, line: 14 }, + end: { column: 24, line: 14 }, + }, + }, + + range: [307, 315], + loc: { + start: { column: 16, line: 14 }, + end: { column: 24, line: 14 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "F", + + range: [298, 299], + loc: { + start: { column: 7, line: 14 }, + end: { column: 8, line: 14 }, + }, + }, + ], + + range: [297, 300], + loc: { + start: { column: 6, line: 14 }, + end: { column: 9, line: 14 }, + }, + }, + + range: [293, 316], + loc: { + start: { column: 2, line: 14 }, + end: { column: 25, line: 14 }, + }, + }, + ], + + range: [87, 318], + loc: { + start: { column: 14, line: 3 }, + end: { column: 1, line: 15 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 318], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 15 }, + }, + }, + ], + sourceType: "script", + + range: [73, 319], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 16 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..077d64076871 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,1036 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "baa", + + range: [91, 94], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [94, 95], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [96, 102], + loc: { + start: { column: 7, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [102, 103], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [106, 109], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [109, 110], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [110, 111], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [112, 118], + loc: { + start: { column: 8, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [118, 119], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [122, 123], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "bax", + + range: [123, 126], + loc: { + start: { column: 3, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [126, 127], + loc: { + start: { column: 6, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [127, 128], + loc: { + start: { column: 7, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [129, 135], + loc: { + start: { column: 9, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [135, 136], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [139, 140], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [140, 143], + loc: { + start: { column: 3, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [143, 144], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [144, 145], + loc: { + start: { column: 7, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [145, 146], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [147, 153], + loc: { + start: { column: 10, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [153, 154], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [157, 158], + loc: { + start: { column: 2, line: 8 }, + end: { column: 3, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "eee", + + range: [158, 161], + loc: { + start: { column: 3, line: 8 }, + end: { column: 6, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [161, 162], + loc: { + start: { column: 6, line: 8 }, + end: { column: 7, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [163, 169], + loc: { + start: { column: 8, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [169, 170], + loc: { + start: { column: 14, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [170, 171], + loc: { + start: { column: 15, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [172, 178], + loc: { + start: { column: 17, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [178, 179], + loc: { + start: { column: 23, line: 8 }, + end: { column: 24, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "doo", + + range: [182, 185], + loc: { + start: { column: 2, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [185, 186], + loc: { + start: { column: 5, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [186, 187], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [187, 188], + loc: { + start: { column: 7, line: 9 }, + end: { column: 8, line: 9 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [189, 193], + loc: { + start: { column: 9, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [193, 194], + loc: { + start: { column: 13, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "coo", + + range: [197, 200], + loc: { + start: { column: 2, line: 10 }, + end: { column: 5, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [200, 201], + loc: { + start: { column: 5, line: 10 }, + end: { column: 6, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [201, 202], + loc: { + start: { column: 6, line: 10 }, + end: { column: 7, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [202, 203], + loc: { + start: { column: 7, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [203, 204], + loc: { + start: { column: 8, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [205, 206], + loc: { + start: { column: 10, line: 10 }, + end: { column: 11, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [206, 207], + loc: { + start: { column: 11, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "c", + + range: [208, 209], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [209, 210], + loc: { + start: { column: 14, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [210, 211], + loc: { + start: { column: 15, line: 10 }, + end: { column: 16, line: 10 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [212, 216], + loc: { + start: { column: 17, line: 10 }, + end: { column: 21, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [216, 217], + loc: { + start: { column: 21, line: 10 }, + end: { column: 22, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [220, 221], + loc: { + start: { column: 2, line: 11 }, + end: { column: 3, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "loo", + + range: [221, 224], + loc: { + start: { column: 3, line: 11 }, + end: { column: 6, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [224, 225], + loc: { + start: { column: 6, line: 11 }, + end: { column: 7, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [225, 226], + loc: { + start: { column: 7, line: 11 }, + end: { column: 8, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [226, 227], + loc: { + start: { column: 8, line: 11 }, + end: { column: 9, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [227, 228], + loc: { + start: { column: 9, line: 11 }, + end: { column: 10, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [228, 229], + loc: { + start: { column: 10, line: 11 }, + end: { column: 11, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [230, 231], + loc: { + start: { column: 12, line: 11 }, + end: { column: 13, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [231, 232], + loc: { + start: { column: 13, line: 11 }, + end: { column: 14, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "c", + + range: [233, 234], + loc: { + start: { column: 15, line: 11 }, + end: { column: 16, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [234, 235], + loc: { + start: { column: 16, line: 11 }, + end: { column: 17, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [235, 236], + loc: { + start: { column: 17, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [237, 241], + loc: { + start: { column: 19, line: 11 }, + end: { column: 23, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [241, 242], + loc: { + start: { column: 23, line: 11 }, + end: { column: 24, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "boo", + + range: [245, 248], + loc: { + start: { column: 2, line: 12 }, + end: { column: 5, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [248, 249], + loc: { + start: { column: 5, line: 12 }, + end: { column: 6, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + value: "J", + + range: [249, 250], + loc: { + start: { column: 6, line: 12 }, + end: { column: 7, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [250, 251], + loc: { + start: { column: 7, line: 12 }, + end: { column: 8, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [251, 252], + loc: { + start: { column: 8, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [252, 253], + loc: { + start: { column: 9, line: 12 }, + end: { column: 10, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [253, 254], + loc: { + start: { column: 10, line: 12 }, + end: { column: 11, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [255, 256], + loc: { + start: { column: 12, line: 12 }, + end: { column: 13, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [256, 257], + loc: { + start: { column: 13, line: 12 }, + end: { column: 14, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + value: "c", + + range: [258, 259], + loc: { + start: { column: 15, line: 12 }, + end: { column: 16, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [259, 260], + loc: { + start: { column: 16, line: 12 }, + end: { column: 17, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [260, 261], + loc: { + start: { column: 17, line: 12 }, + end: { column: 18, line: 12 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [262, 266], + loc: { + start: { column: 19, line: 12 }, + end: { column: 23, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [266, 267], + loc: { + start: { column: 23, line: 12 }, + end: { column: 24, line: 12 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [270, 273], + loc: { + start: { column: 2, line: 13 }, + end: { column: 5, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [274, 275], + loc: { + start: { column: 6, line: 13 }, + end: { column: 7, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [275, 276], + loc: { + start: { column: 7, line: 13 }, + end: { column: 8, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [276, 277], + loc: { + start: { column: 8, line: 13 }, + end: { column: 9, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [278, 279], + loc: { + start: { column: 10, line: 13 }, + end: { column: 11, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [279, 280], + loc: { + start: { column: 11, line: 13 }, + end: { column: 12, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [280, 281], + loc: { + start: { column: 12, line: 13 }, + end: { column: 13, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [281, 282], + loc: { + start: { column: 13, line: 13 }, + end: { column: 14, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [283, 289], + loc: { + start: { column: 15, line: 13 }, + end: { column: 21, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [289, 290], + loc: { + start: { column: 21, line: 13 }, + end: { column: 22, line: 13 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [293, 296], + loc: { + start: { column: 2, line: 14 }, + end: { column: 5, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [297, 298], + loc: { + start: { column: 6, line: 14 }, + end: { column: 7, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "F", + + range: [298, 299], + loc: { + start: { column: 7, line: 14 }, + end: { column: 8, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [299, 300], + loc: { + start: { column: 8, line: 14 }, + end: { column: 9, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [300, 301], + loc: { + start: { column: 9, line: 14 }, + end: { column: 10, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [301, 302], + loc: { + start: { column: 10, line: 14 }, + end: { column: 11, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [302, 303], + loc: { + start: { column: 11, line: 14 }, + end: { column: 12, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [304, 305], + loc: { + start: { column: 13, line: 14 }, + end: { column: 14, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [305, 306], + loc: { + start: { column: 14, line: 14 }, + end: { column: 15, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [306, 307], + loc: { + start: { column: 15, line: 14 }, + end: { column: 16, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [307, 308], + loc: { + start: { column: 16, line: 14 }, + end: { column: 17, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [309, 315], + loc: { + start: { column: 18, line: 14 }, + end: { column: 24, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [315, 316], + loc: { + start: { column: 24, line: 14 }, + end: { column: 25, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [317, 318], + loc: { + start: { column: 0, line: 15 }, + end: { column: 1, line: 15 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..abf4bc974391 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,694 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [ + TSPropertySignature { + type: 'TSPropertySignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'baa', + + range: [91, 94], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [96, 102], + loc: { + start: { column: 7, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [94, 102], + loc: { + start: { column: 5, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [91, 103], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + TSPropertySignature { + type: 'TSPropertySignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'bar', + + range: [106, 109], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + optional: true, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [112, 118], + loc: { + start: { column: 8, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + + range: [110, 118], + loc: { + start: { column: 6, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + + range: [106, 119], + loc: { + start: { column: 2, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + TSPropertySignature { + type: 'TSPropertySignature', + computed: true, + key: Identifier { + type: 'Identifier', + name: 'bax', + + range: [123, 126], + loc: { + start: { column: 3, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [129, 135], + loc: { + start: { column: 9, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [127, 135], + loc: { + start: { column: 7, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [122, 136], + loc: { + start: { column: 2, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + TSPropertySignature { + type: 'TSPropertySignature', + computed: true, + key: Identifier { + type: 'Identifier', + name: 'baz', + + range: [140, 143], + loc: { + start: { column: 3, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + optional: true, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [147, 153], + loc: { + start: { column: 10, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + + range: [145, 153], + loc: { + start: { column: 8, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + + range: [139, 154], + loc: { + start: { column: 2, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + TSIndexSignature { + type: 'TSIndexSignature', + parameters: Array [ + Identifier { + type: 'Identifier', + name: 'eee', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [163, 169], + loc: { + start: { column: 8, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + + range: [161, 169], + loc: { + start: { column: 6, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + + range: [158, 169], + loc: { + start: { column: 3, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [172, 178], + loc: { + start: { column: 17, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + + range: [170, 178], + loc: { + start: { column: 15, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + + range: [157, 179], + loc: { + start: { column: 2, line: 8 }, + end: { column: 24, line: 8 }, + }, + }, + TSMethodSignature { + type: 'TSMethodSignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'doo', + + range: [182, 185], + loc: { + start: { column: 2, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + kind: 'method', +- params: Array [], +- returnType: TSTypeAnnotation { ++ parameters: Array [], ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSVoidKeyword { + type: 'TSVoidKeyword', + + range: [189, 193], + loc: { + start: { column: 9, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + + range: [187, 193], + loc: { + start: { column: 7, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + + range: [182, 194], + loc: { + start: { column: 2, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + TSMethodSignature { + type: 'TSMethodSignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'coo', + + range: [197, 200], + loc: { + start: { column: 2, line: 10 }, + end: { column: 5, line: 10 }, + }, + }, + kind: 'method', + optional: true, +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'a', + + range: [202, 203], + loc: { + start: { column: 7, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Identifier { + type: 'Identifier', + name: 'b', + + range: [205, 206], + loc: { + start: { column: 10, line: 10 }, + end: { column: 11, line: 10 }, + }, + }, + Identifier { + type: 'Identifier', + name: 'c', + + range: [208, 209], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSVoidKeyword { + type: 'TSVoidKeyword', + + range: [212, 216], + loc: { + start: { column: 17, line: 10 }, + end: { column: 21, line: 10 }, + }, + }, + + range: [210, 216], + loc: { + start: { column: 15, line: 10 }, + end: { column: 21, line: 10 }, + }, + }, + + range: [197, 217], + loc: { + start: { column: 2, line: 10 }, + end: { column: 22, line: 10 }, + }, + }, + TSMethodSignature { + type: 'TSMethodSignature', + computed: true, + key: Identifier { + type: 'Identifier', + name: 'loo', + + range: [221, 224], + loc: { + start: { column: 3, line: 11 }, + end: { column: 6, line: 11 }, + }, + }, + kind: 'method', + optional: true, +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'a', + + range: [227, 228], + loc: { + start: { column: 9, line: 11 }, + end: { column: 10, line: 11 }, + }, + }, + Identifier { + type: 'Identifier', + name: 'b', + + range: [230, 231], + loc: { + start: { column: 12, line: 11 }, + end: { column: 13, line: 11 }, + }, + }, + Identifier { + type: 'Identifier', + name: 'c', + + range: [233, 234], + loc: { + start: { column: 15, line: 11 }, + end: { column: 16, line: 11 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSVoidKeyword { + type: 'TSVoidKeyword', + + range: [237, 241], + loc: { + start: { column: 19, line: 11 }, + end: { column: 23, line: 11 }, + }, + }, + + range: [235, 241], + loc: { + start: { column: 17, line: 11 }, + end: { column: 23, line: 11 }, + }, + }, + + range: [220, 242], + loc: { + start: { column: 2, line: 11 }, + end: { column: 24, line: 11 }, + }, + }, + TSMethodSignature { + type: 'TSMethodSignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'boo', + + range: [245, 248], + loc: { + start: { column: 2, line: 12 }, + end: { column: 5, line: 12 }, + }, + }, + kind: 'method', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'a', + + range: [252, 253], + loc: { + start: { column: 9, line: 12 }, + end: { column: 10, line: 12 }, + }, + }, + Identifier { + type: 'Identifier', + name: 'b', + + range: [255, 256], + loc: { + start: { column: 12, line: 12 }, + end: { column: 13, line: 12 }, + }, + }, + Identifier { + type: 'Identifier', + name: 'c', + + range: [258, 259], + loc: { + start: { column: 15, line: 12 }, + end: { column: 16, line: 12 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSVoidKeyword { + type: 'TSVoidKeyword', + + range: [262, 266], + loc: { + start: { column: 19, line: 12 }, + end: { column: 23, line: 12 }, + }, + }, + + range: [260, 266], + loc: { + start: { column: 17, line: 12 }, + end: { column: 23, line: 12 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'J', +- +- range: [249, 250], +- loc: { +- start: { column: 6, line: 12 }, +- end: { column: 7, line: 12 }, +- }, +- }, +- out: false, ++ name: 'J', + + range: [249, 250], + loc: { + start: { column: 6, line: 12 }, + end: { column: 7, line: 12 }, + }, + }, + ], + + range: [248, 251], + loc: { + start: { column: 5, line: 12 }, + end: { column: 8, line: 12 }, + }, + }, + + range: [245, 267], + loc: { + start: { column: 2, line: 12 }, + end: { column: 24, line: 12 }, + }, + }, + TSConstructSignatureDeclaration { + type: 'TSConstructSignatureDeclaration', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'a', + + range: [275, 276], + loc: { + start: { column: 7, line: 13 }, + end: { column: 8, line: 13 }, + }, + }, + Identifier { + type: 'Identifier', + name: 'b', + optional: true, + + range: [278, 280], + loc: { + start: { column: 10, line: 13 }, + end: { column: 12, line: 13 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [283, 289], + loc: { + start: { column: 15, line: 13 }, + end: { column: 21, line: 13 }, + }, + }, + + range: [281, 289], + loc: { + start: { column: 13, line: 13 }, + end: { column: 21, line: 13 }, + }, + }, + + range: [270, 290], + loc: { + start: { column: 2, line: 13 }, + end: { column: 22, line: 13 }, + }, + }, + TSConstructSignatureDeclaration { + type: 'TSConstructSignatureDeclaration', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'a', + + range: [301, 302], + loc: { + start: { column: 10, line: 14 }, + end: { column: 11, line: 14 }, + }, + }, + Identifier { + type: 'Identifier', + name: 'b', + optional: true, + + range: [304, 306], + loc: { + start: { column: 13, line: 14 }, + end: { column: 15, line: 14 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [309, 315], + loc: { + start: { column: 18, line: 14 }, + end: { column: 24, line: 14 }, + }, + }, + + range: [307, 315], + loc: { + start: { column: 16, line: 14 }, + end: { column: 24, line: 14 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'F', +- +- range: [298, 299], +- loc: { +- start: { column: 7, line: 14 }, +- end: { column: 8, line: 14 }, +- }, +- }, +- out: false, ++ name: 'F', + + range: [298, 299], + loc: { + start: { column: 7, line: 14 }, + end: { column: 8, line: 14 }, + }, + }, + ], + + range: [297, 300], + loc: { + start: { column: 6, line: 14 }, + end: { column: 9, line: 14 }, + }, + }, + + range: [293, 316], + loc: { + start: { column: 2, line: 14 }, + end: { column: 25, line: 14 }, + }, + }, + ], + + range: [87, 318], + loc: { + start: { column: 14, line: 3 }, + end: { column: 1, line: 15 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 318], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 15 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 319], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 16 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..9073a133e523 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,1042 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'baa', + + range: [91, 94], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [94, 95], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [96, 102], + loc: { + start: { column: 7, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [102, 103], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar', + + range: [106, 109], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [109, 110], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [110, 111], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [112, 118], + loc: { + start: { column: 8, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [118, 119], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [122, 123], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bax', + + range: [123, 126], + loc: { + start: { column: 3, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [126, 127], + loc: { + start: { column: 6, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [127, 128], + loc: { + start: { column: 7, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [129, 135], + loc: { + start: { column: 9, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [135, 136], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [139, 140], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'baz', + + range: [140, 143], + loc: { + start: { column: 3, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [143, 144], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [144, 145], + loc: { + start: { column: 7, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [145, 146], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [147, 153], + loc: { + start: { column: 10, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [153, 154], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [157, 158], + loc: { + start: { column: 2, line: 8 }, + end: { column: 3, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'eee', + + range: [158, 161], + loc: { + start: { column: 3, line: 8 }, + end: { column: 6, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [161, 162], + loc: { + start: { column: 6, line: 8 }, + end: { column: 7, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [163, 169], + loc: { + start: { column: 8, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [169, 170], + loc: { + start: { column: 14, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [170, 171], + loc: { + start: { column: 15, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [172, 178], + loc: { + start: { column: 17, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [178, 179], + loc: { + start: { column: 23, line: 8 }, + end: { column: 24, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'doo', + + range: [182, 185], + loc: { + start: { column: 2, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [185, 186], + loc: { + start: { column: 5, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [186, 187], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [187, 188], + loc: { + start: { column: 7, line: 9 }, + end: { column: 8, line: 9 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'void', + + range: [189, 193], + loc: { + start: { column: 9, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [193, 194], + loc: { + start: { column: 13, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'coo', + + range: [197, 200], + loc: { + start: { column: 2, line: 10 }, + end: { column: 5, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [200, 201], + loc: { + start: { column: 5, line: 10 }, + end: { column: 6, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [201, 202], + loc: { + start: { column: 6, line: 10 }, + end: { column: 7, line: 10 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'a', + + range: [202, 203], + loc: { + start: { column: 7, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [203, 204], + loc: { + start: { column: 8, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'b', + + range: [205, 206], + loc: { + start: { column: 10, line: 10 }, + end: { column: 11, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [206, 207], + loc: { + start: { column: 11, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'c', + + range: [208, 209], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [209, 210], + loc: { + start: { column: 14, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [210, 211], + loc: { + start: { column: 15, line: 10 }, + end: { column: 16, line: 10 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'void', + + range: [212, 216], + loc: { + start: { column: 17, line: 10 }, + end: { column: 21, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [216, 217], + loc: { + start: { column: 21, line: 10 }, + end: { column: 22, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [220, 221], + loc: { + start: { column: 2, line: 11 }, + end: { column: 3, line: 11 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'loo', + + range: [221, 224], + loc: { + start: { column: 3, line: 11 }, + end: { column: 6, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [224, 225], + loc: { + start: { column: 6, line: 11 }, + end: { column: 7, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [225, 226], + loc: { + start: { column: 7, line: 11 }, + end: { column: 8, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [226, 227], + loc: { + start: { column: 8, line: 11 }, + end: { column: 9, line: 11 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'a', + + range: [227, 228], + loc: { + start: { column: 9, line: 11 }, + end: { column: 10, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [228, 229], + loc: { + start: { column: 10, line: 11 }, + end: { column: 11, line: 11 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'b', + + range: [230, 231], + loc: { + start: { column: 12, line: 11 }, + end: { column: 13, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [231, 232], + loc: { + start: { column: 13, line: 11 }, + end: { column: 14, line: 11 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'c', + + range: [233, 234], + loc: { + start: { column: 15, line: 11 }, + end: { column: 16, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [234, 235], + loc: { + start: { column: 16, line: 11 }, + end: { column: 17, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [235, 236], + loc: { + start: { column: 17, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'void', + + range: [237, 241], + loc: { + start: { column: 19, line: 11 }, + end: { column: 23, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [241, 242], + loc: { + start: { column: 23, line: 11 }, + end: { column: 24, line: 11 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'boo', + + range: [245, 248], + loc: { + start: { column: 2, line: 12 }, + end: { column: 5, line: 12 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [248, 249], + loc: { + start: { column: 5, line: 12 }, + end: { column: 6, line: 12 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'J', + + range: [249, 250], + loc: { + start: { column: 6, line: 12 }, + end: { column: 7, line: 12 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [250, 251], + loc: { + start: { column: 7, line: 12 }, + end: { column: 8, line: 12 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [251, 252], + loc: { + start: { column: 8, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'a', + + range: [252, 253], + loc: { + start: { column: 9, line: 12 }, + end: { column: 10, line: 12 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [253, 254], + loc: { + start: { column: 10, line: 12 }, + end: { column: 11, line: 12 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'b', + + range: [255, 256], + loc: { + start: { column: 12, line: 12 }, + end: { column: 13, line: 12 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [256, 257], + loc: { + start: { column: 13, line: 12 }, + end: { column: 14, line: 12 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'c', + + range: [258, 259], + loc: { + start: { column: 15, line: 12 }, + end: { column: 16, line: 12 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [259, 260], + loc: { + start: { column: 16, line: 12 }, + end: { column: 17, line: 12 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [260, 261], + loc: { + start: { column: 17, line: 12 }, + end: { column: 18, line: 12 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'void', + + range: [262, 266], + loc: { + start: { column: 19, line: 12 }, + end: { column: 23, line: 12 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [266, 267], + loc: { + start: { column: 23, line: 12 }, + end: { column: 24, line: 12 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'new', + + range: [270, 273], + loc: { + start: { column: 2, line: 13 }, + end: { column: 5, line: 13 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [274, 275], + loc: { + start: { column: 6, line: 13 }, + end: { column: 7, line: 13 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'a', + + range: [275, 276], + loc: { + start: { column: 7, line: 13 }, + end: { column: 8, line: 13 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [276, 277], + loc: { + start: { column: 8, line: 13 }, + end: { column: 9, line: 13 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'b', + + range: [278, 279], + loc: { + start: { column: 10, line: 13 }, + end: { column: 11, line: 13 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [279, 280], + loc: { + start: { column: 11, line: 13 }, + end: { column: 12, line: 13 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [280, 281], + loc: { + start: { column: 12, line: 13 }, + end: { column: 13, line: 13 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [281, 282], + loc: { + start: { column: 13, line: 13 }, + end: { column: 14, line: 13 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [283, 289], + loc: { + start: { column: 15, line: 13 }, + end: { column: 21, line: 13 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [289, 290], + loc: { + start: { column: 21, line: 13 }, + end: { column: 22, line: 13 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'new', + + range: [293, 296], + loc: { + start: { column: 2, line: 14 }, + end: { column: 5, line: 14 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [297, 298], + loc: { + start: { column: 6, line: 14 }, + end: { column: 7, line: 14 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'F', + + range: [298, 299], + loc: { + start: { column: 7, line: 14 }, + end: { column: 8, line: 14 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [299, 300], + loc: { + start: { column: 8, line: 14 }, + end: { column: 9, line: 14 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [300, 301], + loc: { + start: { column: 9, line: 14 }, + end: { column: 10, line: 14 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'a', + + range: [301, 302], + loc: { + start: { column: 10, line: 14 }, + end: { column: 11, line: 14 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [302, 303], + loc: { + start: { column: 11, line: 14 }, + end: { column: 12, line: 14 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'b', + + range: [304, 305], + loc: { + start: { column: 13, line: 14 }, + end: { column: 14, line: 14 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [305, 306], + loc: { + start: { column: 14, line: 14 }, + end: { column: 15, line: 14 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [306, 307], + loc: { + start: { column: 15, line: 14 }, + end: { column: 16, line: 14 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [307, 308], + loc: { + start: { column: 16, line: 14 }, + end: { column: 17, line: 14 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [309, 315], + loc: { + start: { column: 18, line: 14 }, + end: { column: 24, line: 14 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [315, 316], + loc: { + start: { column: 24, line: 14 }, + end: { column: 25, line: 14 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [317, 318], + loc: { + start: { column: 0, line: 15 }, + end: { column: 1, line: 15 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/fixture.ts new file mode 100644 index 000000000000..efd00c7728f9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface foo extends bar.baz {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..2fff8125b601 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,87 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-extends-member-expression TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [103, 105], + loc: { + start: { column: 30, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + extends: Array [ + TSInterfaceHeritage { + type: "TSInterfaceHeritage", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "bar", + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "baz", + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [95, 102], + loc: { + start: { column: 22, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [95, 102], + loc: { + start: { column: 22, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..09cff7a83bc2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-extends-member-expression TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [87, 94], + loc: { + start: { column: 14, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..49c821c473ee --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/3-Babel-AST.shot @@ -0,0 +1,85 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-extends-member-expression Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [103, 105], + loc: { + start: { column: 30, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + extends: Array [ + TSExpressionWithTypeArguments { + type: "TSExpressionWithTypeArguments", + expression: TSQualifiedName { + type: "TSQualifiedName", + left: Identifier { + type: "Identifier", + name: "bar", + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + right: Identifier { + type: "Identifier", + name: "baz", + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [95, 102], + loc: { + start: { column: 22, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [95, 102], + loc: { + start: { column: 22, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..a2f79e27570d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-extends-member-expression Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [87, 94], + loc: { + start: { column: 14, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..815cf476af77 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,97 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-extends-member-expression AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [], + + range: [103, 105], + loc: { + start: { column: 30, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + extends: Array [ +- TSInterfaceHeritage { +- type: 'TSInterfaceHeritage', +- expression: MemberExpression { +- type: 'MemberExpression', +- computed: false, +- object: Identifier { ++ TSExpressionWithTypeArguments { ++ type: 'TSExpressionWithTypeArguments', ++ expression: TSQualifiedName { ++ type: 'TSQualifiedName', ++ left: Identifier { + type: 'Identifier', + name: 'bar', + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, +- optional: false, +- property: Identifier { ++ right: Identifier { + type: 'Identifier', + name: 'baz', + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [95, 102], + loc: { + start: { column: 22, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [95, 102], + loc: { + start: { column: 22, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + id: Identifier { + type: 'Identifier', + name: 'foo', + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..142e6b062684 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,92 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-extends-member-expression AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'foo', + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'extends', + + range: [87, 94], + loc: { + start: { column: 14, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar', + + range: [95, 98], + loc: { + start: { column: 22, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '.', + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'baz', + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/fixture.ts new file mode 100644 index 000000000000..2ff96139291a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo extends Bar {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..ec9ca83ec2cc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,128 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-extends-type-parameters TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [105, 107], + loc: { + start: { column: 32, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + extends: Array [ + TSInterfaceHeritage { + type: "TSInterfaceHeritage", + expression: Identifier { + type: "Identifier", + name: "Bar", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "J", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + + range: [101, 104], + loc: { + start: { column: 28, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [98, 104], + loc: { + start: { column: 25, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + out: false, + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..b2cfb460c273 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-extends-type-parameters TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [90, 97], + loc: { + start: { column: 17, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "J", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..dc761a50b8a4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/3-Babel-AST.shot @@ -0,0 +1,117 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-extends-type-parameters Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [105, 107], + loc: { + start: { column: 32, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + extends: Array [ + TSExpressionWithTypeArguments { + type: "TSExpressionWithTypeArguments", + expression: Identifier { + type: "Identifier", + name: "Bar", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "J", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + + range: [101, 104], + loc: { + start: { column: 28, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [98, 104], + loc: { + start: { column: 25, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..c440e1851b3c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-extends-type-parameters Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [90, 97], + loc: { + start: { column: 17, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "J", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..54f1565f714d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,135 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-extends-type-parameters AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [], + + range: [105, 107], + loc: { + start: { column: 32, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + extends: Array [ +- TSInterfaceHeritage { +- type: 'TSInterfaceHeritage', ++ TSExpressionWithTypeArguments { ++ type: 'TSExpressionWithTypeArguments', + expression: Identifier { + type: 'Identifier', + name: 'Bar', + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'J', + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + + range: [101, 104], + loc: { + start: { column: 28, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [98, 104], + loc: { + start: { column: 25, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [87, 88], +- loc: { +- start: { column: 14, line: 3 }, +- end: { column: 15, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..33ff4fc2cadf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,132 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-extends-type-parameters AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'extends', + + range: [90, 97], + loc: { + start: { column: 17, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Bar', + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'J', + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/fixture.ts new file mode 100644 index 000000000000..981599deadb5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Test {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..d3e96136ef65 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,77 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-generic TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [91, 93], + loc: { + start: { column: 18, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Test", + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + out: false, + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + ], + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..8548000fdf2f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-generic TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Test", + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..6d4173f1f611 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/3-Babel-AST.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-generic Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [91, 93], + loc: { + start: { column: 18, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Test", + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + ], + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..ed11d4c5215a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-generic Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Test", + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..bcc3599d4182 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,82 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-generic AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [], + + range: [91, 93], + loc: { + start: { column: 18, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Test', + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [88, 89], +- loc: { +- start: { column: 15, line: 3 }, +- end: { column: 16, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + ], + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..e648c90f8598 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,82 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-generic AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Test', + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/fixture.ts new file mode 100644 index 000000000000..fbd0b758c8a8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/fixture.ts @@ -0,0 +1,9 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Test { + /** + * Comment Line 1 + * @baz bar + */ + foo(bar); +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..443b6bf8e9f1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-jsdoc TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [138, 141], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + kind: "method", + params: Array [ + Identifier { + type: "Identifier", + name: "bar", + + range: [142, 145], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + ], + + range: [138, 147], + loc: { + start: { column: 2, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + ], + + range: [88, 149], + loc: { + start: { column: 15, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Test", + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [73, 149], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + ], + sourceType: "script", + + range: [73, 150], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 10 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..13ec1a450a48 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-jsdoc TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Test", + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [138, 141], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [141, 142], + loc: { + start: { column: 5, line: 8 }, + end: { column: 6, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [142, 145], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [145, 146], + loc: { + start: { column: 9, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [146, 147], + loc: { + start: { column: 10, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [148, 149], + loc: { + start: { column: 0, line: 9 }, + end: { column: 1, line: 9 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..110417331b96 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/3-Babel-AST.shot @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-jsdoc Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [138, 141], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + kind: "method", + parameters: Array [ + Identifier { + type: "Identifier", + name: "bar", + + range: [142, 145], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + ], + + range: [138, 147], + loc: { + start: { column: 2, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + ], + + range: [88, 149], + loc: { + start: { column: 15, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Test", + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [73, 149], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + ], + sourceType: "script", + + range: [73, 150], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 10 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..7186ee34111a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-jsdoc Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Test", + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [138, 141], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [141, 142], + loc: { + start: { column: 5, line: 8 }, + end: { column: 6, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [142, 145], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [145, 146], + loc: { + start: { column: 9, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [146, 147], + loc: { + start: { column: 10, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [148, 149], + loc: { + start: { column: 0, line: 9 }, + end: { column: 1, line: 9 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..cbdfb2688e0c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,84 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-jsdoc AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [ + TSMethodSignature { + type: 'TSMethodSignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'foo', + + range: [138, 141], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + kind: 'method', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'bar', + + range: [142, 145], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + ], + + range: [138, 147], + loc: { + start: { column: 2, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + ], + + range: [88, 149], + loc: { + start: { column: 15, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Test', + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [73, 149], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 150], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 10 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..45f5590ecbbe --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,102 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-jsdoc AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Test', + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'foo', + + range: [138, 141], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [141, 142], + loc: { + start: { column: 5, line: 8 }, + end: { column: 6, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar', + + range: [142, 145], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [145, 146], + loc: { + start: { column: 9, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [146, 147], + loc: { + start: { column: 10, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [148, 149], + loc: { + start: { column: 0, line: 9 }, + end: { column: 1, line: 9 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/fixture.ts new file mode 100644 index 000000000000..99b953fba14d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface test { + h(bar: string): void; + g(bar: T): T; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..a85e5d164fcb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,236 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-method TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "h", + + range: [92, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + kind: "method", + params: Array [ + Identifier { + type: "Identifier", + name: "bar", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [99, 105], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [97, 105], + loc: { + start: { column: 7, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [94, 105], + loc: { + start: { column: 4, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [108, 112], + loc: { + start: { column: 18, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [106, 112], + loc: { + start: { column: 16, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [92, 113], + loc: { + start: { column: 2, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "g", + + range: [116, 117], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + kind: "method", + params: Array [ + Identifier { + type: "Identifier", + name: "bar", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [126, 127], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [126, 127], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [124, 127], + loc: { + start: { column: 10, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [121, 127], + loc: { + start: { column: 7, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [130, 131], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [130, 131], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [128, 131], + loc: { + start: { column: 14, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [118, 119], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + out: false, + + range: [118, 119], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + ], + + range: [117, 120], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + + range: [116, 132], + loc: { + start: { column: 2, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + ], + + range: [88, 134], + loc: { + start: { column: 15, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "test", + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [73, 134], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 135], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..09bb731783e0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,256 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-method TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "test", + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "h", + + range: [92, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [93, 94], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [94, 97], + loc: { + start: { column: 4, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [97, 98], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [99, 105], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [105, 106], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [106, 107], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [108, 112], + loc: { + start: { column: 18, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [112, 113], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "g", + + range: [116, 117], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [117, 118], + loc: { + start: { column: 3, line: 5 }, + end: { column: 4, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [118, 119], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [119, 120], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [120, 121], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [121, 124], + loc: { + start: { column: 7, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [124, 125], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [126, 127], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [127, 128], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [128, 129], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [130, 131], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [131, 132], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [133, 134], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..74a21a123fe4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/3-Babel-AST.shot @@ -0,0 +1,225 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-method Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "h", + + range: [92, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + kind: "method", + parameters: Array [ + Identifier { + type: "Identifier", + name: "bar", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [99, 105], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [97, 105], + loc: { + start: { column: 7, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [94, 105], + loc: { + start: { column: 4, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [108, 112], + loc: { + start: { column: 18, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [106, 112], + loc: { + start: { column: 16, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [92, 113], + loc: { + start: { column: 2, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "g", + + range: [116, 117], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + kind: "method", + parameters: Array [ + Identifier { + type: "Identifier", + name: "bar", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [126, 127], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [126, 127], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [124, 127], + loc: { + start: { column: 10, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [121, 127], + loc: { + start: { column: 7, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [130, 131], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [130, 131], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [128, 131], + loc: { + start: { column: 14, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [118, 119], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + ], + + range: [117, 120], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + + range: [116, 132], + loc: { + start: { column: 2, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + ], + + range: [88, 134], + loc: { + start: { column: 15, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "test", + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [73, 134], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 135], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..122fda7554c9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,256 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-method Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "test", + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "h", + + range: [92, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [93, 94], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [94, 97], + loc: { + start: { column: 4, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [97, 98], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [99, 105], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [105, 106], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [106, 107], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [108, 112], + loc: { + start: { column: 18, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [112, 113], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "g", + + range: [116, 117], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [117, 118], + loc: { + start: { column: 3, line: 5 }, + end: { column: 4, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [118, 119], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [119, 120], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [120, 121], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [121, 124], + loc: { + start: { column: 7, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [124, 125], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [126, 127], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [127, 128], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [128, 129], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [130, 131], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [131, 132], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [133, 134], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..f6f48a1fa512 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,245 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-method AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [ + TSMethodSignature { + type: 'TSMethodSignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'h', + + range: [92, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + kind: 'method', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'bar', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [99, 105], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [97, 105], + loc: { + start: { column: 7, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [94, 105], + loc: { + start: { column: 4, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSVoidKeyword { + type: 'TSVoidKeyword', + + range: [108, 112], + loc: { + start: { column: 18, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [106, 112], + loc: { + start: { column: 16, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [92, 113], + loc: { + start: { column: 2, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + TSMethodSignature { + type: 'TSMethodSignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'g', + + range: [116, 117], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + kind: 'method', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'bar', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [126, 127], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [126, 127], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [124, 127], + loc: { + start: { column: 10, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [121, 127], + loc: { + start: { column: 7, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [130, 131], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [130, 131], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [128, 131], + loc: { + start: { column: 14, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [118, 119], +- loc: { +- start: { column: 4, line: 5 }, +- end: { column: 5, line: 5 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [118, 119], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + ], + + range: [117, 120], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + + range: [116, 132], + loc: { + start: { column: 2, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + ], + + range: [88, 134], + loc: { + start: { column: 15, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'test', + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [73, 134], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 135], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..519934a74d0e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,262 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-method AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'test', + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'h', + + range: [92, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [93, 94], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar', + + range: [94, 97], + loc: { + start: { column: 4, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [97, 98], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [99, 105], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [105, 106], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [106, 107], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'void', + + range: [108, 112], + loc: { + start: { column: 18, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [112, 113], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'g', + + range: [116, 117], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [117, 118], + loc: { + start: { column: 3, line: 5 }, + end: { column: 4, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [118, 119], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [119, 120], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [120, 121], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar', + + range: [121, 124], + loc: { + start: { column: 7, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [124, 125], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [126, 127], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [127, 128], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [128, 129], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [130, 131], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [131, 132], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [133, 134], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/fixture.ts new file mode 100644 index 000000000000..f512b81295cd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/fixture.ts @@ -0,0 +1,7 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface test { + foo?; + bar?: string; + baz?(foo, bar?: string, baz?); +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..cde7ed06ee0c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,180 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-optional-properties TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [92, 95], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + optional: true, + + range: [92, 97], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [100, 103], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [106, 112], + loc: { + start: { column: 8, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + + range: [104, 112], + loc: { + start: { column: 6, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + + range: [100, 113], + loc: { + start: { column: 2, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [116, 119], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + kind: "method", + optional: true, + params: Array [ + Identifier { + type: "Identifier", + name: "foo", + + range: [121, 124], + loc: { + start: { column: 7, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + name: "bar", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [132, 138], + loc: { + start: { column: 18, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [130, 138], + loc: { + start: { column: 16, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [126, 138], + loc: { + start: { column: 12, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + name: "baz", + optional: true, + + range: [140, 144], + loc: { + start: { column: 26, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + ], + + range: [116, 146], + loc: { + start: { column: 2, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + ], + + range: [88, 148], + loc: { + start: { column: 15, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "test", + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [73, 148], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 149], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..0f25628c861a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,266 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-optional-properties TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "test", + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [92, 95], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [95, 96], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [96, 97], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [100, 103], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [103, 104], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [104, 105], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [106, 112], + loc: { + start: { column: 8, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [112, 113], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [116, 119], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [119, 120], + loc: { + start: { column: 5, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [120, 121], + loc: { + start: { column: 6, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [121, 124], + loc: { + start: { column: 7, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [124, 125], + loc: { + start: { column: 10, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [126, 129], + loc: { + start: { column: 12, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [129, 130], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [130, 131], + loc: { + start: { column: 16, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [132, 138], + loc: { + start: { column: 18, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [138, 139], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [140, 143], + loc: { + start: { column: 26, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [143, 144], + loc: { + start: { column: 29, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [144, 145], + loc: { + start: { column: 30, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [145, 146], + loc: { + start: { column: 31, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [147, 148], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..fc58642788ac --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/3-Babel-AST.shot @@ -0,0 +1,180 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-optional-properties Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [92, 95], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + optional: true, + + range: [92, 97], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [100, 103], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [106, 112], + loc: { + start: { column: 8, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + + range: [104, 112], + loc: { + start: { column: 6, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + + range: [100, 113], + loc: { + start: { column: 2, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [116, 119], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + kind: "method", + optional: true, + parameters: Array [ + Identifier { + type: "Identifier", + name: "foo", + + range: [121, 124], + loc: { + start: { column: 7, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + name: "bar", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [132, 138], + loc: { + start: { column: 18, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [130, 138], + loc: { + start: { column: 16, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [126, 138], + loc: { + start: { column: 12, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + name: "baz", + optional: true, + + range: [140, 144], + loc: { + start: { column: 26, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + ], + + range: [116, 146], + loc: { + start: { column: 2, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + ], + + range: [88, 148], + loc: { + start: { column: 15, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "test", + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [73, 148], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 149], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..5a6a8f84f8c6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,266 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-optional-properties Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "test", + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [92, 95], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [95, 96], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [96, 97], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [100, 103], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [103, 104], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [104, 105], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [106, 112], + loc: { + start: { column: 8, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [112, 113], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [116, 119], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [119, 120], + loc: { + start: { column: 5, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [120, 121], + loc: { + start: { column: 6, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [121, 124], + loc: { + start: { column: 7, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [124, 125], + loc: { + start: { column: 10, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [126, 129], + loc: { + start: { column: 12, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [129, 130], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [130, 131], + loc: { + start: { column: 16, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [132, 138], + loc: { + start: { column: 18, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [138, 139], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [140, 143], + loc: { + start: { column: 26, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [143, 144], + loc: { + start: { column: 29, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [144, 145], + loc: { + start: { column: 30, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [145, 146], + loc: { + start: { column: 31, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [147, 148], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..0f17f468b7bb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,185 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-optional-properties AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [ + TSPropertySignature { + type: 'TSPropertySignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'foo', + + range: [92, 95], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + optional: true, + + range: [92, 97], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + TSPropertySignature { + type: 'TSPropertySignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'bar', + + range: [100, 103], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + optional: true, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [106, 112], + loc: { + start: { column: 8, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + + range: [104, 112], + loc: { + start: { column: 6, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + + range: [100, 113], + loc: { + start: { column: 2, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + TSMethodSignature { + type: 'TSMethodSignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'baz', + + range: [116, 119], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + kind: 'method', + optional: true, +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'foo', + + range: [121, 124], + loc: { + start: { column: 7, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + name: 'bar', + optional: true, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [132, 138], + loc: { + start: { column: 18, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [130, 138], + loc: { + start: { column: 16, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [126, 138], + loc: { + start: { column: 12, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + name: 'baz', + optional: true, + + range: [140, 144], + loc: { + start: { column: 26, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + ], + + range: [116, 146], + loc: { + start: { column: 2, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + ], + + range: [88, 148], + loc: { + start: { column: 15, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'test', + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [73, 148], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 149], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..ec15dd363936 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,272 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-with-optional-properties AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'test', + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'foo', + + range: [92, 95], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [95, 96], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [96, 97], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar', + + range: [100, 103], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [103, 104], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [104, 105], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [106, 112], + loc: { + start: { column: 8, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [112, 113], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'baz', + + range: [116, 119], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [119, 120], + loc: { + start: { column: 5, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [120, 121], + loc: { + start: { column: 6, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'foo', + + range: [121, 124], + loc: { + start: { column: 7, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [124, 125], + loc: { + start: { column: 10, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar', + + range: [126, 129], + loc: { + start: { column: 12, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [129, 130], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [130, 131], + loc: { + start: { column: 16, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [132, 138], + loc: { + start: { column: 18, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [138, 139], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'baz', + + range: [140, 143], + loc: { + start: { column: 26, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [143, 144], + loc: { + start: { column: 29, line: 6 }, + end: { column: 30, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [144, 145], + loc: { + start: { column: 30, line: 6 }, + end: { column: 31, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [145, 146], + loc: { + start: { column: 31, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [147, 148], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/fixture.ts new file mode 100644 index 000000000000..8f3012c89d26 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface test { + foo; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..6f23be9edb7e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-without-type-annotation TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [92, 95], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + + range: [92, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + ], + + range: [88, 98], + loc: { + start: { column: 15, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "test", + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 99], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..d4c56d4673ab --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-without-type-annotation TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "test", + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [92, 95], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [95, 96], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [97, 98], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..79cf7458e3f0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/3-Babel-AST.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-without-type-annotation Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [92, 95], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + + range: [92, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + ], + + range: [88, 98], + loc: { + start: { column: 15, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "test", + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 99], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..3a6c55e2a2ff --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-without-type-annotation Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "test", + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [92, 95], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [95, 96], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [97, 98], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..3f71028931f7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-without-type-annotation AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..42f91059d07e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,72 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics interface-without-type-annotation AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'test', + + range: [83, 87], + loc: { + start: { column: 10, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'foo', + + range: [92, 95], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [95, 96], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [97, 98], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/fixture.ts new file mode 100644 index 000000000000..386afc5f8034 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Uppercase = intrinsic; +type Lowercase = intrinsic; +type Capitalize = intrinsic; +type Uncapitalize = intrinsic; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..709dafa02b58 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,292 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics intrinsic-keyword TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Uppercase", + + range: [78, 87], + loc: { + start: { column: 5, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + typeAnnotation: TSIntrinsicKeyword { + type: "TSIntrinsicKeyword", + + range: [108, 117], + loc: { + start: { column: 35, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + constraint: TSStringKeyword { + type: "TSStringKeyword", + + range: [98, 104], + loc: { + start: { column: 25, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "S", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + out: false, + + range: [88, 104], + loc: { + start: { column: 15, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + + range: [87, 105], + loc: { + start: { column: 14, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Lowercase", + + range: [124, 133], + loc: { + start: { column: 5, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + typeAnnotation: TSIntrinsicKeyword { + type: "TSIntrinsicKeyword", + + range: [154, 163], + loc: { + start: { column: 35, line: 4 }, + end: { column: 44, line: 4 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + constraint: TSStringKeyword { + type: "TSStringKeyword", + + range: [144, 150], + loc: { + start: { column: 25, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "S", + + range: [134, 135], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + out: false, + + range: [134, 150], + loc: { + start: { column: 15, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + ], + + range: [133, 151], + loc: { + start: { column: 14, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + + range: [119, 164], + loc: { + start: { column: 0, line: 4 }, + end: { column: 45, line: 4 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Capitalize", + + range: [170, 180], + loc: { + start: { column: 5, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + typeAnnotation: TSIntrinsicKeyword { + type: "TSIntrinsicKeyword", + + range: [201, 210], + loc: { + start: { column: 36, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + constraint: TSStringKeyword { + type: "TSStringKeyword", + + range: [191, 197], + loc: { + start: { column: 26, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "S", + + range: [181, 182], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + out: false, + + range: [181, 197], + loc: { + start: { column: 16, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + ], + + range: [180, 198], + loc: { + start: { column: 15, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + + range: [165, 211], + loc: { + start: { column: 0, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Uncapitalize", + + range: [217, 229], + loc: { + start: { column: 5, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + typeAnnotation: TSIntrinsicKeyword { + type: "TSIntrinsicKeyword", + + range: [250, 259], + loc: { + start: { column: 38, line: 6 }, + end: { column: 47, line: 6 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + constraint: TSStringKeyword { + type: "TSStringKeyword", + + range: [240, 246], + loc: { + start: { column: 28, line: 6 }, + end: { column: 34, line: 6 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "S", + + range: [230, 231], + loc: { + start: { column: 18, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + out: false, + + range: [230, 246], + loc: { + start: { column: 18, line: 6 }, + end: { column: 34, line: 6 }, + }, + }, + ], + + range: [229, 247], + loc: { + start: { column: 17, line: 6 }, + end: { column: 35, line: 6 }, + }, + }, + + range: [212, 260], + loc: { + start: { column: 0, line: 6 }, + end: { column: 48, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 261], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..2de11cd771df --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,406 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics intrinsic-keyword TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Uppercase", + + range: [78, 87], + loc: { + start: { column: 5, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "S", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [90, 97], + loc: { + start: { column: 17, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [98, 104], + loc: { + start: { column: 25, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "intrinsic", + + range: [108, 117], + loc: { + start: { column: 35, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [119, 123], + loc: { + start: { column: 0, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Lowercase", + + range: [124, 133], + loc: { + start: { column: 5, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [133, 134], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "S", + + range: [134, 135], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [136, 143], + loc: { + start: { column: 17, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [144, 150], + loc: { + start: { column: 25, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [150, 151], + loc: { + start: { column: 31, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [152, 153], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "intrinsic", + + range: [154, 163], + loc: { + start: { column: 35, line: 4 }, + end: { column: 44, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [163, 164], + loc: { + start: { column: 44, line: 4 }, + end: { column: 45, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [165, 169], + loc: { + start: { column: 0, line: 5 }, + end: { column: 4, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "Capitalize", + + range: [170, 180], + loc: { + start: { column: 5, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [180, 181], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "S", + + range: [181, 182], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [183, 190], + loc: { + start: { column: 18, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [191, 197], + loc: { + start: { column: 26, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [197, 198], + loc: { + start: { column: 32, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [199, 200], + loc: { + start: { column: 34, line: 5 }, + end: { column: 35, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "intrinsic", + + range: [201, 210], + loc: { + start: { column: 36, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [210, 211], + loc: { + start: { column: 45, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [212, 216], + loc: { + start: { column: 0, line: 6 }, + end: { column: 4, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "Uncapitalize", + + range: [217, 229], + loc: { + start: { column: 5, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [229, 230], + loc: { + start: { column: 17, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "S", + + range: [230, 231], + loc: { + start: { column: 18, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [232, 239], + loc: { + start: { column: 20, line: 6 }, + end: { column: 27, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [240, 246], + loc: { + start: { column: 28, line: 6 }, + end: { column: 34, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [246, 247], + loc: { + start: { column: 34, line: 6 }, + end: { column: 35, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [248, 249], + loc: { + start: { column: 36, line: 6 }, + end: { column: 37, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "intrinsic", + + range: [250, 259], + loc: { + start: { column: 38, line: 6 }, + end: { column: 47, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [259, 260], + loc: { + start: { column: 47, line: 6 }, + end: { column: 48, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..00e093d9f435 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/3-Babel-AST.shot @@ -0,0 +1,248 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics intrinsic-keyword Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Uppercase", + + range: [78, 87], + loc: { + start: { column: 5, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + typeAnnotation: TSIntrinsicKeyword { + type: "TSIntrinsicKeyword", + + range: [108, 117], + loc: { + start: { column: 35, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + constraint: TSStringKeyword { + type: "TSStringKeyword", + + range: [98, 104], + loc: { + start: { column: 25, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + name: "S", + + range: [88, 104], + loc: { + start: { column: 15, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + + range: [87, 105], + loc: { + start: { column: 14, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Lowercase", + + range: [124, 133], + loc: { + start: { column: 5, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + typeAnnotation: TSIntrinsicKeyword { + type: "TSIntrinsicKeyword", + + range: [154, 163], + loc: { + start: { column: 35, line: 4 }, + end: { column: 44, line: 4 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + constraint: TSStringKeyword { + type: "TSStringKeyword", + + range: [144, 150], + loc: { + start: { column: 25, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + name: "S", + + range: [134, 150], + loc: { + start: { column: 15, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + ], + + range: [133, 151], + loc: { + start: { column: 14, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + + range: [119, 164], + loc: { + start: { column: 0, line: 4 }, + end: { column: 45, line: 4 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Capitalize", + + range: [170, 180], + loc: { + start: { column: 5, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + typeAnnotation: TSIntrinsicKeyword { + type: "TSIntrinsicKeyword", + + range: [201, 210], + loc: { + start: { column: 36, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + constraint: TSStringKeyword { + type: "TSStringKeyword", + + range: [191, 197], + loc: { + start: { column: 26, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + name: "S", + + range: [181, 197], + loc: { + start: { column: 16, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + ], + + range: [180, 198], + loc: { + start: { column: 15, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + + range: [165, 211], + loc: { + start: { column: 0, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Uncapitalize", + + range: [217, 229], + loc: { + start: { column: 5, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + typeAnnotation: TSIntrinsicKeyword { + type: "TSIntrinsicKeyword", + + range: [250, 259], + loc: { + start: { column: 38, line: 6 }, + end: { column: 47, line: 6 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + constraint: TSStringKeyword { + type: "TSStringKeyword", + + range: [240, 246], + loc: { + start: { column: 28, line: 6 }, + end: { column: 34, line: 6 }, + }, + }, + name: "S", + + range: [230, 246], + loc: { + start: { column: 18, line: 6 }, + end: { column: 34, line: 6 }, + }, + }, + ], + + range: [229, 247], + loc: { + start: { column: 17, line: 6 }, + end: { column: 35, line: 6 }, + }, + }, + + range: [212, 260], + loc: { + start: { column: 0, line: 6 }, + end: { column: 48, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 261], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..4cad27453916 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,406 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics intrinsic-keyword Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Uppercase", + + range: [78, 87], + loc: { + start: { column: 5, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "S", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [90, 97], + loc: { + start: { column: 17, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [98, 104], + loc: { + start: { column: 25, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "intrinsic", + + range: [108, 117], + loc: { + start: { column: 35, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [119, 123], + loc: { + start: { column: 0, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Lowercase", + + range: [124, 133], + loc: { + start: { column: 5, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [133, 134], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "S", + + range: [134, 135], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [136, 143], + loc: { + start: { column: 17, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [144, 150], + loc: { + start: { column: 25, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [150, 151], + loc: { + start: { column: 31, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [152, 153], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "intrinsic", + + range: [154, 163], + loc: { + start: { column: 35, line: 4 }, + end: { column: 44, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [163, 164], + loc: { + start: { column: 44, line: 4 }, + end: { column: 45, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [165, 169], + loc: { + start: { column: 0, line: 5 }, + end: { column: 4, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "Capitalize", + + range: [170, 180], + loc: { + start: { column: 5, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [180, 181], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "S", + + range: [181, 182], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [183, 190], + loc: { + start: { column: 18, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [191, 197], + loc: { + start: { column: 26, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [197, 198], + loc: { + start: { column: 32, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [199, 200], + loc: { + start: { column: 34, line: 5 }, + end: { column: 35, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "intrinsic", + + range: [201, 210], + loc: { + start: { column: 36, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [210, 211], + loc: { + start: { column: 45, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [212, 216], + loc: { + start: { column: 0, line: 6 }, + end: { column: 4, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "Uncapitalize", + + range: [217, 229], + loc: { + start: { column: 5, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [229, 230], + loc: { + start: { column: 17, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "S", + + range: [230, 231], + loc: { + start: { column: 18, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [232, 239], + loc: { + start: { column: 20, line: 6 }, + end: { column: 27, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [240, 246], + loc: { + start: { column: 28, line: 6 }, + end: { column: 34, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [246, 247], + loc: { + start: { column: 34, line: 6 }, + end: { column: 35, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [248, 249], + loc: { + start: { column: 36, line: 6 }, + end: { column: 37, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "intrinsic", + + range: [250, 259], + loc: { + start: { column: 38, line: 6 }, + end: { column: 47, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [259, 260], + loc: { + start: { column: 47, line: 6 }, + end: { column: 48, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..69311fed2219 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,300 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics intrinsic-keyword AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'Uppercase', + + range: [78, 87], + loc: { + start: { column: 5, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + typeAnnotation: TSIntrinsicKeyword { + type: 'TSIntrinsicKeyword', + + range: [108, 117], + loc: { + start: { column: 35, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSStringKeyword { + type: 'TSStringKeyword', + + range: [98, 104], + loc: { + start: { column: 25, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'S', +- +- range: [88, 89], +- loc: { +- start: { column: 15, line: 3 }, +- end: { column: 16, line: 3 }, +- }, +- }, +- out: false, ++ name: 'S', + + range: [88, 104], + loc: { + start: { column: 15, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + + range: [87, 105], + loc: { + start: { column: 14, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'Lowercase', + + range: [124, 133], + loc: { + start: { column: 5, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + typeAnnotation: TSIntrinsicKeyword { + type: 'TSIntrinsicKeyword', + + range: [154, 163], + loc: { + start: { column: 35, line: 4 }, + end: { column: 44, line: 4 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSStringKeyword { + type: 'TSStringKeyword', + + range: [144, 150], + loc: { + start: { column: 25, line: 4 }, + end: { column: 31, line: 4 }, +- }, +- }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'S', +- +- range: [134, 135], +- loc: { +- start: { column: 15, line: 4 }, +- end: { column: 16, line: 4 }, + }, + }, +- out: false, ++ name: 'S', + + range: [134, 150], + loc: { + start: { column: 15, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + ], + + range: [133, 151], + loc: { + start: { column: 14, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + + range: [119, 164], + loc: { + start: { column: 0, line: 4 }, + end: { column: 45, line: 4 }, + }, + }, + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'Capitalize', + + range: [170, 180], + loc: { + start: { column: 5, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + typeAnnotation: TSIntrinsicKeyword { + type: 'TSIntrinsicKeyword', + + range: [201, 210], + loc: { + start: { column: 36, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSStringKeyword { + type: 'TSStringKeyword', + + range: [191, 197], + loc: { + start: { column: 26, line: 5 }, + end: { column: 32, line: 5 }, +- }, +- }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'S', +- +- range: [181, 182], +- loc: { +- start: { column: 16, line: 5 }, +- end: { column: 17, line: 5 }, + }, + }, +- out: false, ++ name: 'S', + + range: [181, 197], + loc: { + start: { column: 16, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + ], + + range: [180, 198], + loc: { + start: { column: 15, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + + range: [165, 211], + loc: { + start: { column: 0, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'Uncapitalize', + + range: [217, 229], + loc: { + start: { column: 5, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + typeAnnotation: TSIntrinsicKeyword { + type: 'TSIntrinsicKeyword', + + range: [250, 259], + loc: { + start: { column: 38, line: 6 }, + end: { column: 47, line: 6 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSStringKeyword { + type: 'TSStringKeyword', + + range: [240, 246], + loc: { + start: { column: 28, line: 6 }, + end: { column: 34, line: 6 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'S', +- +- range: [230, 231], +- loc: { +- start: { column: 18, line: 6 }, +- end: { column: 19, line: 6 }, +- }, +- }, +- out: false, ++ name: 'S', + + range: [230, 246], + loc: { + start: { column: 18, line: 6 }, + end: { column: 34, line: 6 }, + }, + }, + ], + + range: [229, 247], + loc: { + start: { column: 17, line: 6 }, + end: { column: 35, line: 6 }, + }, + }, + + range: [212, 260], + loc: { + start: { column: 0, line: 6 }, + end: { column: 48, line: 6 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 261], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..0ff10a84d493 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics intrinsic-keyword AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/fixture.ts new file mode 100644 index 000000000000..671b1a1af577 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type x = keyof foo; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..b5752b0534b8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,64 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics keyof-operator TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "x", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + typeAnnotation: TSTypeOperator { + type: "TSTypeOperator", + operator: "keyof", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "foo", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [82, 91], + loc: { + start: { column: 9, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..6a574fb8e5e2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics keyof-operator TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "keyof", + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..0549f5eea457 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/3-Babel-AST.shot @@ -0,0 +1,64 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics keyof-operator Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "x", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + typeAnnotation: TSTypeOperator { + type: "TSTypeOperator", + operator: "keyof", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "foo", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [82, 91], + loc: { + start: { column: 9, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..4d1d407330a3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics keyof-operator Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "keyof", + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..066f52e976fa --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics keyof-operator AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..dc8c1f1bcc26 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics keyof-operator AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/fixture.ts new file mode 100644 index 000000000000..dc3991668144 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/fixture.ts @@ -0,0 +1,79 @@ +// TODO: This fixture might be too large, and if so should be split up. + +{ + const abstract = 1; + const as = 1; + const asserts = 1; + const any = 1; + const async = 1; + const await = 1; + const boolean = 1; + const constructor = 1; + const declare = 1; + const get = 1; + const infer = 1; + const is = 1; + const keyof = 1; + const module = 1; + const namespace = 1; + const never = 1; + const readonly = 1; + const require = 1; + const number = 1; + const object = 1; + const set = 1; + const string = 1; + const symbol = 1; + const type = 1; + const undefined = 1; + const unique = 1; + const unknown = 1; + const from = 1; + const global = 1; + const bigint = 1; + const of = 1; +} + +import { + abstract, + as, + asserts, + any, + async, + await, + boolean, + constructor, + declare, + get, + infer, + is, + keyof, + module, + namespace, + never, + readonly, + require, + number, + object, + set, + string, + symbol, + type, + undefined, + unique, + unknown, + from, + global, + bigint, + of, +} from 'fake-module'; + +interface X {} +class C implements X { + static a() {} + private b() {} + public c() {} + protected *d() { + let x = yield; + } +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..962ee2d70e09 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,2598 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics keyword-variables TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + BlockStatement { + type: "BlockStatement", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "abstract", + + range: [83, 91], + loc: { + start: { column: 8, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [94, 95], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [83, 95], + loc: { + start: { column: 8, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + kind: "const", + + range: [77, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "as", + + range: [105, 107], + loc: { + start: { column: 8, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [110, 111], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + + range: [105, 111], + loc: { + start: { column: 8, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + ], + kind: "const", + + range: [99, 112], + loc: { + start: { column: 2, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "asserts", + + range: [121, 128], + loc: { + start: { column: 8, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [131, 132], + loc: { + start: { column: 18, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + + range: [121, 132], + loc: { + start: { column: 8, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + ], + kind: "const", + + range: [115, 133], + loc: { + start: { column: 2, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "any", + + range: [142, 145], + loc: { + start: { column: 8, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [148, 149], + loc: { + start: { column: 14, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + + range: [142, 149], + loc: { + start: { column: 8, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + ], + kind: "const", + + range: [136, 150], + loc: { + start: { column: 2, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "async", + + range: [159, 164], + loc: { + start: { column: 8, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [167, 168], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + + range: [159, 168], + loc: { + start: { column: 8, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + ], + kind: "const", + + range: [153, 169], + loc: { + start: { column: 2, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "await", + + range: [178, 183], + loc: { + start: { column: 8, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [186, 187], + loc: { + start: { column: 16, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + + range: [178, 187], + loc: { + start: { column: 8, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + ], + kind: "const", + + range: [172, 188], + loc: { + start: { column: 2, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "boolean", + + range: [197, 204], + loc: { + start: { column: 8, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [207, 208], + loc: { + start: { column: 18, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + + range: [197, 208], + loc: { + start: { column: 8, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + ], + kind: "const", + + range: [191, 209], + loc: { + start: { column: 2, line: 10 }, + end: { column: 20, line: 10 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "constructor", + + range: [218, 229], + loc: { + start: { column: 8, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [232, 233], + loc: { + start: { column: 22, line: 11 }, + end: { column: 23, line: 11 }, + }, + }, + + range: [218, 233], + loc: { + start: { column: 8, line: 11 }, + end: { column: 23, line: 11 }, + }, + }, + ], + kind: "const", + + range: [212, 234], + loc: { + start: { column: 2, line: 11 }, + end: { column: 24, line: 11 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "declare", + + range: [243, 250], + loc: { + start: { column: 8, line: 12 }, + end: { column: 15, line: 12 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [253, 254], + loc: { + start: { column: 18, line: 12 }, + end: { column: 19, line: 12 }, + }, + }, + + range: [243, 254], + loc: { + start: { column: 8, line: 12 }, + end: { column: 19, line: 12 }, + }, + }, + ], + kind: "const", + + range: [237, 255], + loc: { + start: { column: 2, line: 12 }, + end: { column: 20, line: 12 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "get", + + range: [264, 267], + loc: { + start: { column: 8, line: 13 }, + end: { column: 11, line: 13 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [270, 271], + loc: { + start: { column: 14, line: 13 }, + end: { column: 15, line: 13 }, + }, + }, + + range: [264, 271], + loc: { + start: { column: 8, line: 13 }, + end: { column: 15, line: 13 }, + }, + }, + ], + kind: "const", + + range: [258, 272], + loc: { + start: { column: 2, line: 13 }, + end: { column: 16, line: 13 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "infer", + + range: [281, 286], + loc: { + start: { column: 8, line: 14 }, + end: { column: 13, line: 14 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [289, 290], + loc: { + start: { column: 16, line: 14 }, + end: { column: 17, line: 14 }, + }, + }, + + range: [281, 290], + loc: { + start: { column: 8, line: 14 }, + end: { column: 17, line: 14 }, + }, + }, + ], + kind: "const", + + range: [275, 291], + loc: { + start: { column: 2, line: 14 }, + end: { column: 18, line: 14 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "is", + + range: [300, 302], + loc: { + start: { column: 8, line: 15 }, + end: { column: 10, line: 15 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [305, 306], + loc: { + start: { column: 13, line: 15 }, + end: { column: 14, line: 15 }, + }, + }, + + range: [300, 306], + loc: { + start: { column: 8, line: 15 }, + end: { column: 14, line: 15 }, + }, + }, + ], + kind: "const", + + range: [294, 307], + loc: { + start: { column: 2, line: 15 }, + end: { column: 15, line: 15 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "keyof", + + range: [316, 321], + loc: { + start: { column: 8, line: 16 }, + end: { column: 13, line: 16 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [324, 325], + loc: { + start: { column: 16, line: 16 }, + end: { column: 17, line: 16 }, + }, + }, + + range: [316, 325], + loc: { + start: { column: 8, line: 16 }, + end: { column: 17, line: 16 }, + }, + }, + ], + kind: "const", + + range: [310, 326], + loc: { + start: { column: 2, line: 16 }, + end: { column: 18, line: 16 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "module", + + range: [335, 341], + loc: { + start: { column: 8, line: 17 }, + end: { column: 14, line: 17 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [344, 345], + loc: { + start: { column: 17, line: 17 }, + end: { column: 18, line: 17 }, + }, + }, + + range: [335, 345], + loc: { + start: { column: 8, line: 17 }, + end: { column: 18, line: 17 }, + }, + }, + ], + kind: "const", + + range: [329, 346], + loc: { + start: { column: 2, line: 17 }, + end: { column: 19, line: 17 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "namespace", + + range: [355, 364], + loc: { + start: { column: 8, line: 18 }, + end: { column: 17, line: 18 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [367, 368], + loc: { + start: { column: 20, line: 18 }, + end: { column: 21, line: 18 }, + }, + }, + + range: [355, 368], + loc: { + start: { column: 8, line: 18 }, + end: { column: 21, line: 18 }, + }, + }, + ], + kind: "const", + + range: [349, 369], + loc: { + start: { column: 2, line: 18 }, + end: { column: 22, line: 18 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "never", + + range: [378, 383], + loc: { + start: { column: 8, line: 19 }, + end: { column: 13, line: 19 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [386, 387], + loc: { + start: { column: 16, line: 19 }, + end: { column: 17, line: 19 }, + }, + }, + + range: [378, 387], + loc: { + start: { column: 8, line: 19 }, + end: { column: 17, line: 19 }, + }, + }, + ], + kind: "const", + + range: [372, 388], + loc: { + start: { column: 2, line: 19 }, + end: { column: 18, line: 19 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "readonly", + + range: [397, 405], + loc: { + start: { column: 8, line: 20 }, + end: { column: 16, line: 20 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [408, 409], + loc: { + start: { column: 19, line: 20 }, + end: { column: 20, line: 20 }, + }, + }, + + range: [397, 409], + loc: { + start: { column: 8, line: 20 }, + end: { column: 20, line: 20 }, + }, + }, + ], + kind: "const", + + range: [391, 410], + loc: { + start: { column: 2, line: 20 }, + end: { column: 21, line: 20 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "require", + + range: [419, 426], + loc: { + start: { column: 8, line: 21 }, + end: { column: 15, line: 21 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [429, 430], + loc: { + start: { column: 18, line: 21 }, + end: { column: 19, line: 21 }, + }, + }, + + range: [419, 430], + loc: { + start: { column: 8, line: 21 }, + end: { column: 19, line: 21 }, + }, + }, + ], + kind: "const", + + range: [413, 431], + loc: { + start: { column: 2, line: 21 }, + end: { column: 20, line: 21 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "number", + + range: [440, 446], + loc: { + start: { column: 8, line: 22 }, + end: { column: 14, line: 22 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [449, 450], + loc: { + start: { column: 17, line: 22 }, + end: { column: 18, line: 22 }, + }, + }, + + range: [440, 450], + loc: { + start: { column: 8, line: 22 }, + end: { column: 18, line: 22 }, + }, + }, + ], + kind: "const", + + range: [434, 451], + loc: { + start: { column: 2, line: 22 }, + end: { column: 19, line: 22 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "object", + + range: [460, 466], + loc: { + start: { column: 8, line: 23 }, + end: { column: 14, line: 23 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [469, 470], + loc: { + start: { column: 17, line: 23 }, + end: { column: 18, line: 23 }, + }, + }, + + range: [460, 470], + loc: { + start: { column: 8, line: 23 }, + end: { column: 18, line: 23 }, + }, + }, + ], + kind: "const", + + range: [454, 471], + loc: { + start: { column: 2, line: 23 }, + end: { column: 19, line: 23 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "set", + + range: [480, 483], + loc: { + start: { column: 8, line: 24 }, + end: { column: 11, line: 24 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [486, 487], + loc: { + start: { column: 14, line: 24 }, + end: { column: 15, line: 24 }, + }, + }, + + range: [480, 487], + loc: { + start: { column: 8, line: 24 }, + end: { column: 15, line: 24 }, + }, + }, + ], + kind: "const", + + range: [474, 488], + loc: { + start: { column: 2, line: 24 }, + end: { column: 16, line: 24 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "string", + + range: [497, 503], + loc: { + start: { column: 8, line: 25 }, + end: { column: 14, line: 25 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [506, 507], + loc: { + start: { column: 17, line: 25 }, + end: { column: 18, line: 25 }, + }, + }, + + range: [497, 507], + loc: { + start: { column: 8, line: 25 }, + end: { column: 18, line: 25 }, + }, + }, + ], + kind: "const", + + range: [491, 508], + loc: { + start: { column: 2, line: 25 }, + end: { column: 19, line: 25 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "symbol", + + range: [517, 523], + loc: { + start: { column: 8, line: 26 }, + end: { column: 14, line: 26 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [526, 527], + loc: { + start: { column: 17, line: 26 }, + end: { column: 18, line: 26 }, + }, + }, + + range: [517, 527], + loc: { + start: { column: 8, line: 26 }, + end: { column: 18, line: 26 }, + }, + }, + ], + kind: "const", + + range: [511, 528], + loc: { + start: { column: 2, line: 26 }, + end: { column: 19, line: 26 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "type", + + range: [537, 541], + loc: { + start: { column: 8, line: 27 }, + end: { column: 12, line: 27 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [544, 545], + loc: { + start: { column: 15, line: 27 }, + end: { column: 16, line: 27 }, + }, + }, + + range: [537, 545], + loc: { + start: { column: 8, line: 27 }, + end: { column: 16, line: 27 }, + }, + }, + ], + kind: "const", + + range: [531, 546], + loc: { + start: { column: 2, line: 27 }, + end: { column: 17, line: 27 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "undefined", + + range: [555, 564], + loc: { + start: { column: 8, line: 28 }, + end: { column: 17, line: 28 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [567, 568], + loc: { + start: { column: 20, line: 28 }, + end: { column: 21, line: 28 }, + }, + }, + + range: [555, 568], + loc: { + start: { column: 8, line: 28 }, + end: { column: 21, line: 28 }, + }, + }, + ], + kind: "const", + + range: [549, 569], + loc: { + start: { column: 2, line: 28 }, + end: { column: 22, line: 28 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "unique", + + range: [578, 584], + loc: { + start: { column: 8, line: 29 }, + end: { column: 14, line: 29 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [587, 588], + loc: { + start: { column: 17, line: 29 }, + end: { column: 18, line: 29 }, + }, + }, + + range: [578, 588], + loc: { + start: { column: 8, line: 29 }, + end: { column: 18, line: 29 }, + }, + }, + ], + kind: "const", + + range: [572, 589], + loc: { + start: { column: 2, line: 29 }, + end: { column: 19, line: 29 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "unknown", + + range: [598, 605], + loc: { + start: { column: 8, line: 30 }, + end: { column: 15, line: 30 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [608, 609], + loc: { + start: { column: 18, line: 30 }, + end: { column: 19, line: 30 }, + }, + }, + + range: [598, 609], + loc: { + start: { column: 8, line: 30 }, + end: { column: 19, line: 30 }, + }, + }, + ], + kind: "const", + + range: [592, 610], + loc: { + start: { column: 2, line: 30 }, + end: { column: 20, line: 30 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "from", + + range: [619, 623], + loc: { + start: { column: 8, line: 31 }, + end: { column: 12, line: 31 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [626, 627], + loc: { + start: { column: 15, line: 31 }, + end: { column: 16, line: 31 }, + }, + }, + + range: [619, 627], + loc: { + start: { column: 8, line: 31 }, + end: { column: 16, line: 31 }, + }, + }, + ], + kind: "const", + + range: [613, 628], + loc: { + start: { column: 2, line: 31 }, + end: { column: 17, line: 31 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "global", + + range: [637, 643], + loc: { + start: { column: 8, line: 32 }, + end: { column: 14, line: 32 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [646, 647], + loc: { + start: { column: 17, line: 32 }, + end: { column: 18, line: 32 }, + }, + }, + + range: [637, 647], + loc: { + start: { column: 8, line: 32 }, + end: { column: 18, line: 32 }, + }, + }, + ], + kind: "const", + + range: [631, 648], + loc: { + start: { column: 2, line: 32 }, + end: { column: 19, line: 32 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "bigint", + + range: [657, 663], + loc: { + start: { column: 8, line: 33 }, + end: { column: 14, line: 33 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [666, 667], + loc: { + start: { column: 17, line: 33 }, + end: { column: 18, line: 33 }, + }, + }, + + range: [657, 667], + loc: { + start: { column: 8, line: 33 }, + end: { column: 18, line: 33 }, + }, + }, + ], + kind: "const", + + range: [651, 668], + loc: { + start: { column: 2, line: 33 }, + end: { column: 19, line: 33 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "of", + + range: [677, 679], + loc: { + start: { column: 8, line: 34 }, + end: { column: 10, line: 34 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [682, 683], + loc: { + start: { column: 13, line: 34 }, + end: { column: 14, line: 34 }, + }, + }, + + range: [677, 683], + loc: { + start: { column: 8, line: 34 }, + end: { column: 14, line: 34 }, + }, + }, + ], + kind: "const", + + range: [671, 684], + loc: { + start: { column: 2, line: 34 }, + end: { column: 15, line: 34 }, + }, + }, + ], + + range: [73, 686], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 35 }, + }, + }, + ImportDeclaration { + type: "ImportDeclaration", + assertions: Array [], + importKind: "value", + source: Literal { + type: "Literal", + raw: "'fake-module'", + value: "fake-module", + + range: [1004, 1017], + loc: { + start: { column: 7, line: 69 }, + end: { column: 20, line: 69 }, + }, + }, + specifiers: Array [ + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "abstract", + + range: [699, 707], + loc: { + start: { column: 2, line: 38 }, + end: { column: 10, line: 38 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "abstract", + + range: [699, 707], + loc: { + start: { column: 2, line: 38 }, + end: { column: 10, line: 38 }, + }, + }, + + range: [699, 707], + loc: { + start: { column: 2, line: 38 }, + end: { column: 10, line: 38 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "as", + + range: [711, 713], + loc: { + start: { column: 2, line: 39 }, + end: { column: 4, line: 39 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "as", + + range: [711, 713], + loc: { + start: { column: 2, line: 39 }, + end: { column: 4, line: 39 }, + }, + }, + + range: [711, 713], + loc: { + start: { column: 2, line: 39 }, + end: { column: 4, line: 39 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "asserts", + + range: [717, 724], + loc: { + start: { column: 2, line: 40 }, + end: { column: 9, line: 40 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "asserts", + + range: [717, 724], + loc: { + start: { column: 2, line: 40 }, + end: { column: 9, line: 40 }, + }, + }, + + range: [717, 724], + loc: { + start: { column: 2, line: 40 }, + end: { column: 9, line: 40 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "any", + + range: [728, 731], + loc: { + start: { column: 2, line: 41 }, + end: { column: 5, line: 41 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "any", + + range: [728, 731], + loc: { + start: { column: 2, line: 41 }, + end: { column: 5, line: 41 }, + }, + }, + + range: [728, 731], + loc: { + start: { column: 2, line: 41 }, + end: { column: 5, line: 41 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "async", + + range: [735, 740], + loc: { + start: { column: 2, line: 42 }, + end: { column: 7, line: 42 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "async", + + range: [735, 740], + loc: { + start: { column: 2, line: 42 }, + end: { column: 7, line: 42 }, + }, + }, + + range: [735, 740], + loc: { + start: { column: 2, line: 42 }, + end: { column: 7, line: 42 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "await", + + range: [744, 749], + loc: { + start: { column: 2, line: 43 }, + end: { column: 7, line: 43 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "await", + + range: [744, 749], + loc: { + start: { column: 2, line: 43 }, + end: { column: 7, line: 43 }, + }, + }, + + range: [744, 749], + loc: { + start: { column: 2, line: 43 }, + end: { column: 7, line: 43 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "boolean", + + range: [753, 760], + loc: { + start: { column: 2, line: 44 }, + end: { column: 9, line: 44 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "boolean", + + range: [753, 760], + loc: { + start: { column: 2, line: 44 }, + end: { column: 9, line: 44 }, + }, + }, + + range: [753, 760], + loc: { + start: { column: 2, line: 44 }, + end: { column: 9, line: 44 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "constructor", + + range: [764, 775], + loc: { + start: { column: 2, line: 45 }, + end: { column: 13, line: 45 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "constructor", + + range: [764, 775], + loc: { + start: { column: 2, line: 45 }, + end: { column: 13, line: 45 }, + }, + }, + + range: [764, 775], + loc: { + start: { column: 2, line: 45 }, + end: { column: 13, line: 45 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "declare", + + range: [779, 786], + loc: { + start: { column: 2, line: 46 }, + end: { column: 9, line: 46 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "declare", + + range: [779, 786], + loc: { + start: { column: 2, line: 46 }, + end: { column: 9, line: 46 }, + }, + }, + + range: [779, 786], + loc: { + start: { column: 2, line: 46 }, + end: { column: 9, line: 46 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "get", + + range: [790, 793], + loc: { + start: { column: 2, line: 47 }, + end: { column: 5, line: 47 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "get", + + range: [790, 793], + loc: { + start: { column: 2, line: 47 }, + end: { column: 5, line: 47 }, + }, + }, + + range: [790, 793], + loc: { + start: { column: 2, line: 47 }, + end: { column: 5, line: 47 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "infer", + + range: [797, 802], + loc: { + start: { column: 2, line: 48 }, + end: { column: 7, line: 48 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "infer", + + range: [797, 802], + loc: { + start: { column: 2, line: 48 }, + end: { column: 7, line: 48 }, + }, + }, + + range: [797, 802], + loc: { + start: { column: 2, line: 48 }, + end: { column: 7, line: 48 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "is", + + range: [806, 808], + loc: { + start: { column: 2, line: 49 }, + end: { column: 4, line: 49 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "is", + + range: [806, 808], + loc: { + start: { column: 2, line: 49 }, + end: { column: 4, line: 49 }, + }, + }, + + range: [806, 808], + loc: { + start: { column: 2, line: 49 }, + end: { column: 4, line: 49 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "keyof", + + range: [812, 817], + loc: { + start: { column: 2, line: 50 }, + end: { column: 7, line: 50 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "keyof", + + range: [812, 817], + loc: { + start: { column: 2, line: 50 }, + end: { column: 7, line: 50 }, + }, + }, + + range: [812, 817], + loc: { + start: { column: 2, line: 50 }, + end: { column: 7, line: 50 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "module", + + range: [821, 827], + loc: { + start: { column: 2, line: 51 }, + end: { column: 8, line: 51 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "module", + + range: [821, 827], + loc: { + start: { column: 2, line: 51 }, + end: { column: 8, line: 51 }, + }, + }, + + range: [821, 827], + loc: { + start: { column: 2, line: 51 }, + end: { column: 8, line: 51 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "namespace", + + range: [831, 840], + loc: { + start: { column: 2, line: 52 }, + end: { column: 11, line: 52 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "namespace", + + range: [831, 840], + loc: { + start: { column: 2, line: 52 }, + end: { column: 11, line: 52 }, + }, + }, + + range: [831, 840], + loc: { + start: { column: 2, line: 52 }, + end: { column: 11, line: 52 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "never", + + range: [844, 849], + loc: { + start: { column: 2, line: 53 }, + end: { column: 7, line: 53 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "never", + + range: [844, 849], + loc: { + start: { column: 2, line: 53 }, + end: { column: 7, line: 53 }, + }, + }, + + range: [844, 849], + loc: { + start: { column: 2, line: 53 }, + end: { column: 7, line: 53 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "readonly", + + range: [853, 861], + loc: { + start: { column: 2, line: 54 }, + end: { column: 10, line: 54 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "readonly", + + range: [853, 861], + loc: { + start: { column: 2, line: 54 }, + end: { column: 10, line: 54 }, + }, + }, + + range: [853, 861], + loc: { + start: { column: 2, line: 54 }, + end: { column: 10, line: 54 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "require", + + range: [865, 872], + loc: { + start: { column: 2, line: 55 }, + end: { column: 9, line: 55 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "require", + + range: [865, 872], + loc: { + start: { column: 2, line: 55 }, + end: { column: 9, line: 55 }, + }, + }, + + range: [865, 872], + loc: { + start: { column: 2, line: 55 }, + end: { column: 9, line: 55 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "number", + + range: [876, 882], + loc: { + start: { column: 2, line: 56 }, + end: { column: 8, line: 56 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "number", + + range: [876, 882], + loc: { + start: { column: 2, line: 56 }, + end: { column: 8, line: 56 }, + }, + }, + + range: [876, 882], + loc: { + start: { column: 2, line: 56 }, + end: { column: 8, line: 56 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "object", + + range: [886, 892], + loc: { + start: { column: 2, line: 57 }, + end: { column: 8, line: 57 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "object", + + range: [886, 892], + loc: { + start: { column: 2, line: 57 }, + end: { column: 8, line: 57 }, + }, + }, + + range: [886, 892], + loc: { + start: { column: 2, line: 57 }, + end: { column: 8, line: 57 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "set", + + range: [896, 899], + loc: { + start: { column: 2, line: 58 }, + end: { column: 5, line: 58 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "set", + + range: [896, 899], + loc: { + start: { column: 2, line: 58 }, + end: { column: 5, line: 58 }, + }, + }, + + range: [896, 899], + loc: { + start: { column: 2, line: 58 }, + end: { column: 5, line: 58 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "string", + + range: [903, 909], + loc: { + start: { column: 2, line: 59 }, + end: { column: 8, line: 59 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "string", + + range: [903, 909], + loc: { + start: { column: 2, line: 59 }, + end: { column: 8, line: 59 }, + }, + }, + + range: [903, 909], + loc: { + start: { column: 2, line: 59 }, + end: { column: 8, line: 59 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "symbol", + + range: [913, 919], + loc: { + start: { column: 2, line: 60 }, + end: { column: 8, line: 60 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "symbol", + + range: [913, 919], + loc: { + start: { column: 2, line: 60 }, + end: { column: 8, line: 60 }, + }, + }, + + range: [913, 919], + loc: { + start: { column: 2, line: 60 }, + end: { column: 8, line: 60 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "type", + + range: [923, 927], + loc: { + start: { column: 2, line: 61 }, + end: { column: 6, line: 61 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "type", + + range: [923, 927], + loc: { + start: { column: 2, line: 61 }, + end: { column: 6, line: 61 }, + }, + }, + + range: [923, 927], + loc: { + start: { column: 2, line: 61 }, + end: { column: 6, line: 61 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "undefined", + + range: [931, 940], + loc: { + start: { column: 2, line: 62 }, + end: { column: 11, line: 62 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "undefined", + + range: [931, 940], + loc: { + start: { column: 2, line: 62 }, + end: { column: 11, line: 62 }, + }, + }, + + range: [931, 940], + loc: { + start: { column: 2, line: 62 }, + end: { column: 11, line: 62 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "unique", + + range: [944, 950], + loc: { + start: { column: 2, line: 63 }, + end: { column: 8, line: 63 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "unique", + + range: [944, 950], + loc: { + start: { column: 2, line: 63 }, + end: { column: 8, line: 63 }, + }, + }, + + range: [944, 950], + loc: { + start: { column: 2, line: 63 }, + end: { column: 8, line: 63 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "unknown", + + range: [954, 961], + loc: { + start: { column: 2, line: 64 }, + end: { column: 9, line: 64 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "unknown", + + range: [954, 961], + loc: { + start: { column: 2, line: 64 }, + end: { column: 9, line: 64 }, + }, + }, + + range: [954, 961], + loc: { + start: { column: 2, line: 64 }, + end: { column: 9, line: 64 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "from", + + range: [965, 969], + loc: { + start: { column: 2, line: 65 }, + end: { column: 6, line: 65 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "from", + + range: [965, 969], + loc: { + start: { column: 2, line: 65 }, + end: { column: 6, line: 65 }, + }, + }, + + range: [965, 969], + loc: { + start: { column: 2, line: 65 }, + end: { column: 6, line: 65 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "global", + + range: [973, 979], + loc: { + start: { column: 2, line: 66 }, + end: { column: 8, line: 66 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "global", + + range: [973, 979], + loc: { + start: { column: 2, line: 66 }, + end: { column: 8, line: 66 }, + }, + }, + + range: [973, 979], + loc: { + start: { column: 2, line: 66 }, + end: { column: 8, line: 66 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "bigint", + + range: [983, 989], + loc: { + start: { column: 2, line: 67 }, + end: { column: 8, line: 67 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "bigint", + + range: [983, 989], + loc: { + start: { column: 2, line: 67 }, + end: { column: 8, line: 67 }, + }, + }, + + range: [983, 989], + loc: { + start: { column: 2, line: 67 }, + end: { column: 8, line: 67 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "of", + + range: [993, 995], + loc: { + start: { column: 2, line: 68 }, + end: { column: 4, line: 68 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "of", + + range: [993, 995], + loc: { + start: { column: 2, line: 68 }, + end: { column: 4, line: 68 }, + }, + }, + + range: [993, 995], + loc: { + start: { column: 2, line: 68 }, + end: { column: 4, line: 68 }, + }, + }, + ], + + range: [688, 1018], + loc: { + start: { column: 0, line: 37 }, + end: { column: 21, line: 69 }, + }, + }, + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [1032, 1034], + loc: { + start: { column: 12, line: 71 }, + end: { column: 14, line: 71 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "X", + + range: [1030, 1031], + loc: { + start: { column: 10, line: 71 }, + end: { column: 11, line: 71 }, + }, + }, + + range: [1020, 1034], + loc: { + start: { column: 0, line: 71 }, + end: { column: 14, line: 71 }, + }, + }, + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "a", + + range: [1067, 1068], + loc: { + start: { column: 9, line: 73 }, + end: { column: 10, line: 73 }, + }, + }, + kind: "method", + override: false, + static: true, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [1071, 1073], + loc: { + start: { column: 13, line: 73 }, + end: { column: 15, line: 73 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [1068, 1073], + loc: { + start: { column: 10, line: 73 }, + end: { column: 15, line: 73 }, + }, + }, + + range: [1060, 1073], + loc: { + start: { column: 2, line: 73 }, + end: { column: 15, line: 73 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + accessibility: "private", + computed: false, + key: Identifier { + type: "Identifier", + name: "b", + + range: [1084, 1085], + loc: { + start: { column: 10, line: 74 }, + end: { column: 11, line: 74 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [1088, 1090], + loc: { + start: { column: 14, line: 74 }, + end: { column: 16, line: 74 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [1085, 1090], + loc: { + start: { column: 11, line: 74 }, + end: { column: 16, line: 74 }, + }, + }, + + range: [1076, 1090], + loc: { + start: { column: 2, line: 74 }, + end: { column: 16, line: 74 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + accessibility: "public", + computed: false, + key: Identifier { + type: "Identifier", + name: "c", + + range: [1100, 1101], + loc: { + start: { column: 9, line: 75 }, + end: { column: 10, line: 75 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [1104, 1106], + loc: { + start: { column: 13, line: 75 }, + end: { column: 15, line: 75 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [1101, 1106], + loc: { + start: { column: 10, line: 75 }, + end: { column: 15, line: 75 }, + }, + }, + + range: [1093, 1106], + loc: { + start: { column: 2, line: 75 }, + end: { column: 15, line: 75 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + accessibility: "protected", + computed: false, + key: Identifier { + type: "Identifier", + name: "d", + + range: [1120, 1121], + loc: { + start: { column: 13, line: 76 }, + end: { column: 14, line: 76 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + + range: [1134, 1135], + loc: { + start: { column: 8, line: 77 }, + end: { column: 9, line: 77 }, + }, + }, + init: YieldExpression { + type: "YieldExpression", + argument: null, + delegate: false, + + range: [1138, 1143], + loc: { + start: { column: 12, line: 77 }, + end: { column: 17, line: 77 }, + }, + }, + + range: [1134, 1143], + loc: { + start: { column: 8, line: 77 }, + end: { column: 17, line: 77 }, + }, + }, + ], + kind: "let", + + range: [1130, 1144], + loc: { + start: { column: 4, line: 77 }, + end: { column: 18, line: 77 }, + }, + }, + ], + + range: [1124, 1148], + loc: { + start: { column: 17, line: 76 }, + end: { column: 3, line: 78 }, + }, + }, + expression: false, + generator: true, + id: null, + params: Array [], + + range: [1121, 1148], + loc: { + start: { column: 14, line: 76 }, + end: { column: 3, line: 78 }, + }, + }, + + range: [1109, 1148], + loc: { + start: { column: 2, line: 76 }, + end: { column: 3, line: 78 }, + }, + }, + ], + + range: [1056, 1150], + loc: { + start: { column: 21, line: 72 }, + end: { column: 1, line: 79 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "C", + + range: [1041, 1042], + loc: { + start: { column: 6, line: 72 }, + end: { column: 7, line: 72 }, + }, + }, + implements: Array [ + TSClassImplements { + type: "TSClassImplements", + expression: Identifier { + type: "Identifier", + name: "X", + + range: [1054, 1055], + loc: { + start: { column: 19, line: 72 }, + end: { column: 20, line: 72 }, + }, + }, + + range: [1054, 1055], + loc: { + start: { column: 19, line: 72 }, + end: { column: 20, line: 72 }, + }, + }, + ], + superClass: null, + + range: [1035, 1150], + loc: { + start: { column: 0, line: 72 }, + end: { column: 1, line: 79 }, + }, + }, + ], + sourceType: "module", + + range: [73, 1151], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 80 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..2b4189a009c7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,2656 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics keyword-variables TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "{", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [77, 82], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [83, 91], + loc: { + start: { column: 8, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [92, 93], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [94, 95], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [95, 96], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [99, 104], + loc: { + start: { column: 2, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [105, 107], + loc: { + start: { column: 8, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [108, 109], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [110, 111], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [111, 112], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [115, 120], + loc: { + start: { column: 2, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [121, 128], + loc: { + start: { column: 8, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [129, 130], + loc: { + start: { column: 16, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [131, 132], + loc: { + start: { column: 18, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [132, 133], + loc: { + start: { column: 19, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [136, 141], + loc: { + start: { column: 2, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [142, 145], + loc: { + start: { column: 8, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [146, 147], + loc: { + start: { column: 12, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [148, 149], + loc: { + start: { column: 14, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [149, 150], + loc: { + start: { column: 15, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [153, 158], + loc: { + start: { column: 2, line: 8 }, + end: { column: 7, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "async", + + range: [159, 164], + loc: { + start: { column: 8, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [165, 166], + loc: { + start: { column: 14, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [167, 168], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [168, 169], + loc: { + start: { column: 17, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [172, 177], + loc: { + start: { column: 2, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "await", + + range: [178, 183], + loc: { + start: { column: 8, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [184, 185], + loc: { + start: { column: 14, line: 9 }, + end: { column: 15, line: 9 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [186, 187], + loc: { + start: { column: 16, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [187, 188], + loc: { + start: { column: 17, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [191, 196], + loc: { + start: { column: 2, line: 10 }, + end: { column: 7, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [197, 204], + loc: { + start: { column: 8, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [205, 206], + loc: { + start: { column: 16, line: 10 }, + end: { column: 17, line: 10 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [207, 208], + loc: { + start: { column: 18, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [208, 209], + loc: { + start: { column: 19, line: 10 }, + end: { column: 20, line: 10 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [212, 217], + loc: { + start: { column: 2, line: 11 }, + end: { column: 7, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [218, 229], + loc: { + start: { column: 8, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [230, 231], + loc: { + start: { column: 20, line: 11 }, + end: { column: 21, line: 11 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [232, 233], + loc: { + start: { column: 22, line: 11 }, + end: { column: 23, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [233, 234], + loc: { + start: { column: 23, line: 11 }, + end: { column: 24, line: 11 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [237, 242], + loc: { + start: { column: 2, line: 12 }, + end: { column: 7, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [243, 250], + loc: { + start: { column: 8, line: 12 }, + end: { column: 15, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [251, 252], + loc: { + start: { column: 16, line: 12 }, + end: { column: 17, line: 12 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [253, 254], + loc: { + start: { column: 18, line: 12 }, + end: { column: 19, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [254, 255], + loc: { + start: { column: 19, line: 12 }, + end: { column: 20, line: 12 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [258, 263], + loc: { + start: { column: 2, line: 13 }, + end: { column: 7, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "get", + + range: [264, 267], + loc: { + start: { column: 8, line: 13 }, + end: { column: 11, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [268, 269], + loc: { + start: { column: 12, line: 13 }, + end: { column: 13, line: 13 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [270, 271], + loc: { + start: { column: 14, line: 13 }, + end: { column: 15, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [271, 272], + loc: { + start: { column: 15, line: 13 }, + end: { column: 16, line: 13 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [275, 280], + loc: { + start: { column: 2, line: 14 }, + end: { column: 7, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [281, 286], + loc: { + start: { column: 8, line: 14 }, + end: { column: 13, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [287, 288], + loc: { + start: { column: 14, line: 14 }, + end: { column: 15, line: 14 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [289, 290], + loc: { + start: { column: 16, line: 14 }, + end: { column: 17, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [290, 291], + loc: { + start: { column: 17, line: 14 }, + end: { column: 18, line: 14 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [294, 299], + loc: { + start: { column: 2, line: 15 }, + end: { column: 7, line: 15 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [300, 302], + loc: { + start: { column: 8, line: 15 }, + end: { column: 10, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [303, 304], + loc: { + start: { column: 11, line: 15 }, + end: { column: 12, line: 15 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [305, 306], + loc: { + start: { column: 13, line: 15 }, + end: { column: 14, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [306, 307], + loc: { + start: { column: 14, line: 15 }, + end: { column: 15, line: 15 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [310, 315], + loc: { + start: { column: 2, line: 16 }, + end: { column: 7, line: 16 }, + }, + }, + Identifier { + type: "Identifier", + value: "keyof", + + range: [316, 321], + loc: { + start: { column: 8, line: 16 }, + end: { column: 13, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [322, 323], + loc: { + start: { column: 14, line: 16 }, + end: { column: 15, line: 16 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [324, 325], + loc: { + start: { column: 16, line: 16 }, + end: { column: 17, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [325, 326], + loc: { + start: { column: 17, line: 16 }, + end: { column: 18, line: 16 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [329, 334], + loc: { + start: { column: 2, line: 17 }, + end: { column: 7, line: 17 }, + }, + }, + Identifier { + type: "Identifier", + value: "module", + + range: [335, 341], + loc: { + start: { column: 8, line: 17 }, + end: { column: 14, line: 17 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [342, 343], + loc: { + start: { column: 15, line: 17 }, + end: { column: 16, line: 17 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [344, 345], + loc: { + start: { column: 17, line: 17 }, + end: { column: 18, line: 17 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [345, 346], + loc: { + start: { column: 18, line: 17 }, + end: { column: 19, line: 17 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [349, 354], + loc: { + start: { column: 2, line: 18 }, + end: { column: 7, line: 18 }, + }, + }, + Identifier { + type: "Identifier", + value: "namespace", + + range: [355, 364], + loc: { + start: { column: 8, line: 18 }, + end: { column: 17, line: 18 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [365, 366], + loc: { + start: { column: 18, line: 18 }, + end: { column: 19, line: 18 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [367, 368], + loc: { + start: { column: 20, line: 18 }, + end: { column: 21, line: 18 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [368, 369], + loc: { + start: { column: 21, line: 18 }, + end: { column: 22, line: 18 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [372, 377], + loc: { + start: { column: 2, line: 19 }, + end: { column: 7, line: 19 }, + }, + }, + Identifier { + type: "Identifier", + value: "never", + + range: [378, 383], + loc: { + start: { column: 8, line: 19 }, + end: { column: 13, line: 19 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [384, 385], + loc: { + start: { column: 14, line: 19 }, + end: { column: 15, line: 19 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [386, 387], + loc: { + start: { column: 16, line: 19 }, + end: { column: 17, line: 19 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [387, 388], + loc: { + start: { column: 17, line: 19 }, + end: { column: 18, line: 19 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [391, 396], + loc: { + start: { column: 2, line: 20 }, + end: { column: 7, line: 20 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [397, 405], + loc: { + start: { column: 8, line: 20 }, + end: { column: 16, line: 20 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [406, 407], + loc: { + start: { column: 17, line: 20 }, + end: { column: 18, line: 20 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [408, 409], + loc: { + start: { column: 19, line: 20 }, + end: { column: 20, line: 20 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [409, 410], + loc: { + start: { column: 20, line: 20 }, + end: { column: 21, line: 20 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [413, 418], + loc: { + start: { column: 2, line: 21 }, + end: { column: 7, line: 21 }, + }, + }, + Identifier { + type: "Identifier", + value: "require", + + range: [419, 426], + loc: { + start: { column: 8, line: 21 }, + end: { column: 15, line: 21 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [427, 428], + loc: { + start: { column: 16, line: 21 }, + end: { column: 17, line: 21 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [429, 430], + loc: { + start: { column: 18, line: 21 }, + end: { column: 19, line: 21 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [430, 431], + loc: { + start: { column: 19, line: 21 }, + end: { column: 20, line: 21 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [434, 439], + loc: { + start: { column: 2, line: 22 }, + end: { column: 7, line: 22 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [440, 446], + loc: { + start: { column: 8, line: 22 }, + end: { column: 14, line: 22 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [447, 448], + loc: { + start: { column: 15, line: 22 }, + end: { column: 16, line: 22 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [449, 450], + loc: { + start: { column: 17, line: 22 }, + end: { column: 18, line: 22 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [450, 451], + loc: { + start: { column: 18, line: 22 }, + end: { column: 19, line: 22 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [454, 459], + loc: { + start: { column: 2, line: 23 }, + end: { column: 7, line: 23 }, + }, + }, + Identifier { + type: "Identifier", + value: "object", + + range: [460, 466], + loc: { + start: { column: 8, line: 23 }, + end: { column: 14, line: 23 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [467, 468], + loc: { + start: { column: 15, line: 23 }, + end: { column: 16, line: 23 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [469, 470], + loc: { + start: { column: 17, line: 23 }, + end: { column: 18, line: 23 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [470, 471], + loc: { + start: { column: 18, line: 23 }, + end: { column: 19, line: 23 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [474, 479], + loc: { + start: { column: 2, line: 24 }, + end: { column: 7, line: 24 }, + }, + }, + Identifier { + type: "Identifier", + value: "set", + + range: [480, 483], + loc: { + start: { column: 8, line: 24 }, + end: { column: 11, line: 24 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [484, 485], + loc: { + start: { column: 12, line: 24 }, + end: { column: 13, line: 24 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [486, 487], + loc: { + start: { column: 14, line: 24 }, + end: { column: 15, line: 24 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [487, 488], + loc: { + start: { column: 15, line: 24 }, + end: { column: 16, line: 24 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [491, 496], + loc: { + start: { column: 2, line: 25 }, + end: { column: 7, line: 25 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [497, 503], + loc: { + start: { column: 8, line: 25 }, + end: { column: 14, line: 25 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [504, 505], + loc: { + start: { column: 15, line: 25 }, + end: { column: 16, line: 25 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [506, 507], + loc: { + start: { column: 17, line: 25 }, + end: { column: 18, line: 25 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [507, 508], + loc: { + start: { column: 18, line: 25 }, + end: { column: 19, line: 25 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [511, 516], + loc: { + start: { column: 2, line: 26 }, + end: { column: 7, line: 26 }, + }, + }, + Identifier { + type: "Identifier", + value: "symbol", + + range: [517, 523], + loc: { + start: { column: 8, line: 26 }, + end: { column: 14, line: 26 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [524, 525], + loc: { + start: { column: 15, line: 26 }, + end: { column: 16, line: 26 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [526, 527], + loc: { + start: { column: 17, line: 26 }, + end: { column: 18, line: 26 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [527, 528], + loc: { + start: { column: 18, line: 26 }, + end: { column: 19, line: 26 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [531, 536], + loc: { + start: { column: 2, line: 27 }, + end: { column: 7, line: 27 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [537, 541], + loc: { + start: { column: 8, line: 27 }, + end: { column: 12, line: 27 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [542, 543], + loc: { + start: { column: 13, line: 27 }, + end: { column: 14, line: 27 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [544, 545], + loc: { + start: { column: 15, line: 27 }, + end: { column: 16, line: 27 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [545, 546], + loc: { + start: { column: 16, line: 27 }, + end: { column: 17, line: 27 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [549, 554], + loc: { + start: { column: 2, line: 28 }, + end: { column: 7, line: 28 }, + }, + }, + Identifier { + type: "Identifier", + value: "undefined", + + range: [555, 564], + loc: { + start: { column: 8, line: 28 }, + end: { column: 17, line: 28 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [565, 566], + loc: { + start: { column: 18, line: 28 }, + end: { column: 19, line: 28 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [567, 568], + loc: { + start: { column: 20, line: 28 }, + end: { column: 21, line: 28 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [568, 569], + loc: { + start: { column: 21, line: 28 }, + end: { column: 22, line: 28 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [572, 577], + loc: { + start: { column: 2, line: 29 }, + end: { column: 7, line: 29 }, + }, + }, + Identifier { + type: "Identifier", + value: "unique", + + range: [578, 584], + loc: { + start: { column: 8, line: 29 }, + end: { column: 14, line: 29 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [585, 586], + loc: { + start: { column: 15, line: 29 }, + end: { column: 16, line: 29 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [587, 588], + loc: { + start: { column: 17, line: 29 }, + end: { column: 18, line: 29 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [588, 589], + loc: { + start: { column: 18, line: 29 }, + end: { column: 19, line: 29 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [592, 597], + loc: { + start: { column: 2, line: 30 }, + end: { column: 7, line: 30 }, + }, + }, + Identifier { + type: "Identifier", + value: "unknown", + + range: [598, 605], + loc: { + start: { column: 8, line: 30 }, + end: { column: 15, line: 30 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [606, 607], + loc: { + start: { column: 16, line: 30 }, + end: { column: 17, line: 30 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [608, 609], + loc: { + start: { column: 18, line: 30 }, + end: { column: 19, line: 30 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [609, 610], + loc: { + start: { column: 19, line: 30 }, + end: { column: 20, line: 30 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [613, 618], + loc: { + start: { column: 2, line: 31 }, + end: { column: 7, line: 31 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [619, 623], + loc: { + start: { column: 8, line: 31 }, + end: { column: 12, line: 31 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [624, 625], + loc: { + start: { column: 13, line: 31 }, + end: { column: 14, line: 31 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [626, 627], + loc: { + start: { column: 15, line: 31 }, + end: { column: 16, line: 31 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [627, 628], + loc: { + start: { column: 16, line: 31 }, + end: { column: 17, line: 31 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [631, 636], + loc: { + start: { column: 2, line: 32 }, + end: { column: 7, line: 32 }, + }, + }, + Identifier { + type: "Identifier", + value: "global", + + range: [637, 643], + loc: { + start: { column: 8, line: 32 }, + end: { column: 14, line: 32 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [644, 645], + loc: { + start: { column: 15, line: 32 }, + end: { column: 16, line: 32 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [646, 647], + loc: { + start: { column: 17, line: 32 }, + end: { column: 18, line: 32 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [647, 648], + loc: { + start: { column: 18, line: 32 }, + end: { column: 19, line: 32 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [651, 656], + loc: { + start: { column: 2, line: 33 }, + end: { column: 7, line: 33 }, + }, + }, + Identifier { + type: "Identifier", + value: "bigint", + + range: [657, 663], + loc: { + start: { column: 8, line: 33 }, + end: { column: 14, line: 33 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [664, 665], + loc: { + start: { column: 15, line: 33 }, + end: { column: 16, line: 33 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [666, 667], + loc: { + start: { column: 17, line: 33 }, + end: { column: 18, line: 33 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [667, 668], + loc: { + start: { column: 18, line: 33 }, + end: { column: 19, line: 33 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [671, 676], + loc: { + start: { column: 2, line: 34 }, + end: { column: 7, line: 34 }, + }, + }, + Identifier { + type: "Identifier", + value: "of", + + range: [677, 679], + loc: { + start: { column: 8, line: 34 }, + end: { column: 10, line: 34 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [680, 681], + loc: { + start: { column: 11, line: 34 }, + end: { column: 12, line: 34 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [682, 683], + loc: { + start: { column: 13, line: 34 }, + end: { column: 14, line: 34 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [683, 684], + loc: { + start: { column: 14, line: 34 }, + end: { column: 15, line: 34 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [685, 686], + loc: { + start: { column: 0, line: 35 }, + end: { column: 1, line: 35 }, + }, + }, + Keyword { + type: "Keyword", + value: "import", + + range: [688, 694], + loc: { + start: { column: 0, line: 37 }, + end: { column: 6, line: 37 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [695, 696], + loc: { + start: { column: 7, line: 37 }, + end: { column: 8, line: 37 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [699, 707], + loc: { + start: { column: 2, line: 38 }, + end: { column: 10, line: 38 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [707, 708], + loc: { + start: { column: 10, line: 38 }, + end: { column: 11, line: 38 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [711, 713], + loc: { + start: { column: 2, line: 39 }, + end: { column: 4, line: 39 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [713, 714], + loc: { + start: { column: 4, line: 39 }, + end: { column: 5, line: 39 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [717, 724], + loc: { + start: { column: 2, line: 40 }, + end: { column: 9, line: 40 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [724, 725], + loc: { + start: { column: 9, line: 40 }, + end: { column: 10, line: 40 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [728, 731], + loc: { + start: { column: 2, line: 41 }, + end: { column: 5, line: 41 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [731, 732], + loc: { + start: { column: 5, line: 41 }, + end: { column: 6, line: 41 }, + }, + }, + Identifier { + type: "Identifier", + value: "async", + + range: [735, 740], + loc: { + start: { column: 2, line: 42 }, + end: { column: 7, line: 42 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [740, 741], + loc: { + start: { column: 7, line: 42 }, + end: { column: 8, line: 42 }, + }, + }, + Identifier { + type: "Identifier", + value: "await", + + range: [744, 749], + loc: { + start: { column: 2, line: 43 }, + end: { column: 7, line: 43 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [749, 750], + loc: { + start: { column: 7, line: 43 }, + end: { column: 8, line: 43 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [753, 760], + loc: { + start: { column: 2, line: 44 }, + end: { column: 9, line: 44 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [760, 761], + loc: { + start: { column: 9, line: 44 }, + end: { column: 10, line: 44 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [764, 775], + loc: { + start: { column: 2, line: 45 }, + end: { column: 13, line: 45 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [775, 776], + loc: { + start: { column: 13, line: 45 }, + end: { column: 14, line: 45 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [779, 786], + loc: { + start: { column: 2, line: 46 }, + end: { column: 9, line: 46 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [786, 787], + loc: { + start: { column: 9, line: 46 }, + end: { column: 10, line: 46 }, + }, + }, + Identifier { + type: "Identifier", + value: "get", + + range: [790, 793], + loc: { + start: { column: 2, line: 47 }, + end: { column: 5, line: 47 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [793, 794], + loc: { + start: { column: 5, line: 47 }, + end: { column: 6, line: 47 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [797, 802], + loc: { + start: { column: 2, line: 48 }, + end: { column: 7, line: 48 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [802, 803], + loc: { + start: { column: 7, line: 48 }, + end: { column: 8, line: 48 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [806, 808], + loc: { + start: { column: 2, line: 49 }, + end: { column: 4, line: 49 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [808, 809], + loc: { + start: { column: 4, line: 49 }, + end: { column: 5, line: 49 }, + }, + }, + Identifier { + type: "Identifier", + value: "keyof", + + range: [812, 817], + loc: { + start: { column: 2, line: 50 }, + end: { column: 7, line: 50 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [817, 818], + loc: { + start: { column: 7, line: 50 }, + end: { column: 8, line: 50 }, + }, + }, + Identifier { + type: "Identifier", + value: "module", + + range: [821, 827], + loc: { + start: { column: 2, line: 51 }, + end: { column: 8, line: 51 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [827, 828], + loc: { + start: { column: 8, line: 51 }, + end: { column: 9, line: 51 }, + }, + }, + Identifier { + type: "Identifier", + value: "namespace", + + range: [831, 840], + loc: { + start: { column: 2, line: 52 }, + end: { column: 11, line: 52 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [840, 841], + loc: { + start: { column: 11, line: 52 }, + end: { column: 12, line: 52 }, + }, + }, + Identifier { + type: "Identifier", + value: "never", + + range: [844, 849], + loc: { + start: { column: 2, line: 53 }, + end: { column: 7, line: 53 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [849, 850], + loc: { + start: { column: 7, line: 53 }, + end: { column: 8, line: 53 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [853, 861], + loc: { + start: { column: 2, line: 54 }, + end: { column: 10, line: 54 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [861, 862], + loc: { + start: { column: 10, line: 54 }, + end: { column: 11, line: 54 }, + }, + }, + Identifier { + type: "Identifier", + value: "require", + + range: [865, 872], + loc: { + start: { column: 2, line: 55 }, + end: { column: 9, line: 55 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [872, 873], + loc: { + start: { column: 9, line: 55 }, + end: { column: 10, line: 55 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [876, 882], + loc: { + start: { column: 2, line: 56 }, + end: { column: 8, line: 56 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [882, 883], + loc: { + start: { column: 8, line: 56 }, + end: { column: 9, line: 56 }, + }, + }, + Identifier { + type: "Identifier", + value: "object", + + range: [886, 892], + loc: { + start: { column: 2, line: 57 }, + end: { column: 8, line: 57 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [892, 893], + loc: { + start: { column: 8, line: 57 }, + end: { column: 9, line: 57 }, + }, + }, + Identifier { + type: "Identifier", + value: "set", + + range: [896, 899], + loc: { + start: { column: 2, line: 58 }, + end: { column: 5, line: 58 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [899, 900], + loc: { + start: { column: 5, line: 58 }, + end: { column: 6, line: 58 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [903, 909], + loc: { + start: { column: 2, line: 59 }, + end: { column: 8, line: 59 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [909, 910], + loc: { + start: { column: 8, line: 59 }, + end: { column: 9, line: 59 }, + }, + }, + Identifier { + type: "Identifier", + value: "symbol", + + range: [913, 919], + loc: { + start: { column: 2, line: 60 }, + end: { column: 8, line: 60 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [919, 920], + loc: { + start: { column: 8, line: 60 }, + end: { column: 9, line: 60 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [923, 927], + loc: { + start: { column: 2, line: 61 }, + end: { column: 6, line: 61 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [927, 928], + loc: { + start: { column: 6, line: 61 }, + end: { column: 7, line: 61 }, + }, + }, + Identifier { + type: "Identifier", + value: "undefined", + + range: [931, 940], + loc: { + start: { column: 2, line: 62 }, + end: { column: 11, line: 62 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [940, 941], + loc: { + start: { column: 11, line: 62 }, + end: { column: 12, line: 62 }, + }, + }, + Identifier { + type: "Identifier", + value: "unique", + + range: [944, 950], + loc: { + start: { column: 2, line: 63 }, + end: { column: 8, line: 63 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [950, 951], + loc: { + start: { column: 8, line: 63 }, + end: { column: 9, line: 63 }, + }, + }, + Identifier { + type: "Identifier", + value: "unknown", + + range: [954, 961], + loc: { + start: { column: 2, line: 64 }, + end: { column: 9, line: 64 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [961, 962], + loc: { + start: { column: 9, line: 64 }, + end: { column: 10, line: 64 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [965, 969], + loc: { + start: { column: 2, line: 65 }, + end: { column: 6, line: 65 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [969, 970], + loc: { + start: { column: 6, line: 65 }, + end: { column: 7, line: 65 }, + }, + }, + Identifier { + type: "Identifier", + value: "global", + + range: [973, 979], + loc: { + start: { column: 2, line: 66 }, + end: { column: 8, line: 66 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [979, 980], + loc: { + start: { column: 8, line: 66 }, + end: { column: 9, line: 66 }, + }, + }, + Identifier { + type: "Identifier", + value: "bigint", + + range: [983, 989], + loc: { + start: { column: 2, line: 67 }, + end: { column: 8, line: 67 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [989, 990], + loc: { + start: { column: 8, line: 67 }, + end: { column: 9, line: 67 }, + }, + }, + Identifier { + type: "Identifier", + value: "of", + + range: [993, 995], + loc: { + start: { column: 2, line: 68 }, + end: { column: 4, line: 68 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [995, 996], + loc: { + start: { column: 4, line: 68 }, + end: { column: 5, line: 68 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [997, 998], + loc: { + start: { column: 0, line: 69 }, + end: { column: 1, line: 69 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [999, 1003], + loc: { + start: { column: 2, line: 69 }, + end: { column: 6, line: 69 }, + }, + }, + String { + type: "String", + value: "'fake-module'", + + range: [1004, 1017], + loc: { + start: { column: 7, line: 69 }, + end: { column: 20, line: 69 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [1017, 1018], + loc: { + start: { column: 20, line: 69 }, + end: { column: 21, line: 69 }, + }, + }, + Keyword { + type: "Keyword", + value: "interface", + + range: [1020, 1029], + loc: { + start: { column: 0, line: 71 }, + end: { column: 9, line: 71 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [1030, 1031], + loc: { + start: { column: 10, line: 71 }, + end: { column: 11, line: 71 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [1032, 1033], + loc: { + start: { column: 12, line: 71 }, + end: { column: 13, line: 71 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [1033, 1034], + loc: { + start: { column: 13, line: 71 }, + end: { column: 14, line: 71 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [1035, 1040], + loc: { + start: { column: 0, line: 72 }, + end: { column: 5, line: 72 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [1041, 1042], + loc: { + start: { column: 6, line: 72 }, + end: { column: 7, line: 72 }, + }, + }, + Keyword { + type: "Keyword", + value: "implements", + + range: [1043, 1053], + loc: { + start: { column: 8, line: 72 }, + end: { column: 18, line: 72 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [1054, 1055], + loc: { + start: { column: 19, line: 72 }, + end: { column: 20, line: 72 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [1056, 1057], + loc: { + start: { column: 21, line: 72 }, + end: { column: 22, line: 72 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [1060, 1066], + loc: { + start: { column: 2, line: 73 }, + end: { column: 8, line: 73 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [1067, 1068], + loc: { + start: { column: 9, line: 73 }, + end: { column: 10, line: 73 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [1068, 1069], + loc: { + start: { column: 10, line: 73 }, + end: { column: 11, line: 73 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [1069, 1070], + loc: { + start: { column: 11, line: 73 }, + end: { column: 12, line: 73 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [1071, 1072], + loc: { + start: { column: 13, line: 73 }, + end: { column: 14, line: 73 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [1072, 1073], + loc: { + start: { column: 14, line: 73 }, + end: { column: 15, line: 73 }, + }, + }, + Keyword { + type: "Keyword", + value: "private", + + range: [1076, 1083], + loc: { + start: { column: 2, line: 74 }, + end: { column: 9, line: 74 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [1084, 1085], + loc: { + start: { column: 10, line: 74 }, + end: { column: 11, line: 74 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [1085, 1086], + loc: { + start: { column: 11, line: 74 }, + end: { column: 12, line: 74 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [1086, 1087], + loc: { + start: { column: 12, line: 74 }, + end: { column: 13, line: 74 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [1088, 1089], + loc: { + start: { column: 14, line: 74 }, + end: { column: 15, line: 74 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [1089, 1090], + loc: { + start: { column: 15, line: 74 }, + end: { column: 16, line: 74 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [1093, 1099], + loc: { + start: { column: 2, line: 75 }, + end: { column: 8, line: 75 }, + }, + }, + Identifier { + type: "Identifier", + value: "c", + + range: [1100, 1101], + loc: { + start: { column: 9, line: 75 }, + end: { column: 10, line: 75 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [1101, 1102], + loc: { + start: { column: 10, line: 75 }, + end: { column: 11, line: 75 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [1102, 1103], + loc: { + start: { column: 11, line: 75 }, + end: { column: 12, line: 75 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [1104, 1105], + loc: { + start: { column: 13, line: 75 }, + end: { column: 14, line: 75 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [1105, 1106], + loc: { + start: { column: 14, line: 75 }, + end: { column: 15, line: 75 }, + }, + }, + Keyword { + type: "Keyword", + value: "protected", + + range: [1109, 1118], + loc: { + start: { column: 2, line: 76 }, + end: { column: 11, line: 76 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "*", + + range: [1119, 1120], + loc: { + start: { column: 12, line: 76 }, + end: { column: 13, line: 76 }, + }, + }, + Identifier { + type: "Identifier", + value: "d", + + range: [1120, 1121], + loc: { + start: { column: 13, line: 76 }, + end: { column: 14, line: 76 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [1121, 1122], + loc: { + start: { column: 14, line: 76 }, + end: { column: 15, line: 76 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [1122, 1123], + loc: { + start: { column: 15, line: 76 }, + end: { column: 16, line: 76 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [1124, 1125], + loc: { + start: { column: 17, line: 76 }, + end: { column: 18, line: 76 }, + }, + }, + Keyword { + type: "Keyword", + value: "let", + + range: [1130, 1133], + loc: { + start: { column: 4, line: 77 }, + end: { column: 7, line: 77 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [1134, 1135], + loc: { + start: { column: 8, line: 77 }, + end: { column: 9, line: 77 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [1136, 1137], + loc: { + start: { column: 10, line: 77 }, + end: { column: 11, line: 77 }, + }, + }, + Keyword { + type: "Keyword", + value: "yield", + + range: [1138, 1143], + loc: { + start: { column: 12, line: 77 }, + end: { column: 17, line: 77 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [1143, 1144], + loc: { + start: { column: 17, line: 77 }, + end: { column: 18, line: 77 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [1147, 1148], + loc: { + start: { column: 2, line: 78 }, + end: { column: 3, line: 78 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [1149, 1150], + loc: { + start: { column: 0, line: 79 }, + end: { column: 1, line: 79 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..81f35fdd1774 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/3-Babel-AST.shot @@ -0,0 +1,2594 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics keyword-variables Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + BlockStatement { + type: "BlockStatement", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "abstract", + + range: [83, 91], + loc: { + start: { column: 8, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [94, 95], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [83, 95], + loc: { + start: { column: 8, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + kind: "const", + + range: [77, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "as", + + range: [105, 107], + loc: { + start: { column: 8, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [110, 111], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + + range: [105, 111], + loc: { + start: { column: 8, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + ], + kind: "const", + + range: [99, 112], + loc: { + start: { column: 2, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "asserts", + + range: [121, 128], + loc: { + start: { column: 8, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [131, 132], + loc: { + start: { column: 18, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + + range: [121, 132], + loc: { + start: { column: 8, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + ], + kind: "const", + + range: [115, 133], + loc: { + start: { column: 2, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "any", + + range: [142, 145], + loc: { + start: { column: 8, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [148, 149], + loc: { + start: { column: 14, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + + range: [142, 149], + loc: { + start: { column: 8, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + ], + kind: "const", + + range: [136, 150], + loc: { + start: { column: 2, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "async", + + range: [159, 164], + loc: { + start: { column: 8, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [167, 168], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + + range: [159, 168], + loc: { + start: { column: 8, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + ], + kind: "const", + + range: [153, 169], + loc: { + start: { column: 2, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "await", + + range: [178, 183], + loc: { + start: { column: 8, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [186, 187], + loc: { + start: { column: 16, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + + range: [178, 187], + loc: { + start: { column: 8, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + ], + kind: "const", + + range: [172, 188], + loc: { + start: { column: 2, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "boolean", + + range: [197, 204], + loc: { + start: { column: 8, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [207, 208], + loc: { + start: { column: 18, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + + range: [197, 208], + loc: { + start: { column: 8, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + ], + kind: "const", + + range: [191, 209], + loc: { + start: { column: 2, line: 10 }, + end: { column: 20, line: 10 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "constructor", + + range: [218, 229], + loc: { + start: { column: 8, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [232, 233], + loc: { + start: { column: 22, line: 11 }, + end: { column: 23, line: 11 }, + }, + }, + + range: [218, 233], + loc: { + start: { column: 8, line: 11 }, + end: { column: 23, line: 11 }, + }, + }, + ], + kind: "const", + + range: [212, 234], + loc: { + start: { column: 2, line: 11 }, + end: { column: 24, line: 11 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "declare", + + range: [243, 250], + loc: { + start: { column: 8, line: 12 }, + end: { column: 15, line: 12 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [253, 254], + loc: { + start: { column: 18, line: 12 }, + end: { column: 19, line: 12 }, + }, + }, + + range: [243, 254], + loc: { + start: { column: 8, line: 12 }, + end: { column: 19, line: 12 }, + }, + }, + ], + kind: "const", + + range: [237, 255], + loc: { + start: { column: 2, line: 12 }, + end: { column: 20, line: 12 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "get", + + range: [264, 267], + loc: { + start: { column: 8, line: 13 }, + end: { column: 11, line: 13 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [270, 271], + loc: { + start: { column: 14, line: 13 }, + end: { column: 15, line: 13 }, + }, + }, + + range: [264, 271], + loc: { + start: { column: 8, line: 13 }, + end: { column: 15, line: 13 }, + }, + }, + ], + kind: "const", + + range: [258, 272], + loc: { + start: { column: 2, line: 13 }, + end: { column: 16, line: 13 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "infer", + + range: [281, 286], + loc: { + start: { column: 8, line: 14 }, + end: { column: 13, line: 14 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [289, 290], + loc: { + start: { column: 16, line: 14 }, + end: { column: 17, line: 14 }, + }, + }, + + range: [281, 290], + loc: { + start: { column: 8, line: 14 }, + end: { column: 17, line: 14 }, + }, + }, + ], + kind: "const", + + range: [275, 291], + loc: { + start: { column: 2, line: 14 }, + end: { column: 18, line: 14 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "is", + + range: [300, 302], + loc: { + start: { column: 8, line: 15 }, + end: { column: 10, line: 15 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [305, 306], + loc: { + start: { column: 13, line: 15 }, + end: { column: 14, line: 15 }, + }, + }, + + range: [300, 306], + loc: { + start: { column: 8, line: 15 }, + end: { column: 14, line: 15 }, + }, + }, + ], + kind: "const", + + range: [294, 307], + loc: { + start: { column: 2, line: 15 }, + end: { column: 15, line: 15 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "keyof", + + range: [316, 321], + loc: { + start: { column: 8, line: 16 }, + end: { column: 13, line: 16 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [324, 325], + loc: { + start: { column: 16, line: 16 }, + end: { column: 17, line: 16 }, + }, + }, + + range: [316, 325], + loc: { + start: { column: 8, line: 16 }, + end: { column: 17, line: 16 }, + }, + }, + ], + kind: "const", + + range: [310, 326], + loc: { + start: { column: 2, line: 16 }, + end: { column: 18, line: 16 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "module", + + range: [335, 341], + loc: { + start: { column: 8, line: 17 }, + end: { column: 14, line: 17 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [344, 345], + loc: { + start: { column: 17, line: 17 }, + end: { column: 18, line: 17 }, + }, + }, + + range: [335, 345], + loc: { + start: { column: 8, line: 17 }, + end: { column: 18, line: 17 }, + }, + }, + ], + kind: "const", + + range: [329, 346], + loc: { + start: { column: 2, line: 17 }, + end: { column: 19, line: 17 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "namespace", + + range: [355, 364], + loc: { + start: { column: 8, line: 18 }, + end: { column: 17, line: 18 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [367, 368], + loc: { + start: { column: 20, line: 18 }, + end: { column: 21, line: 18 }, + }, + }, + + range: [355, 368], + loc: { + start: { column: 8, line: 18 }, + end: { column: 21, line: 18 }, + }, + }, + ], + kind: "const", + + range: [349, 369], + loc: { + start: { column: 2, line: 18 }, + end: { column: 22, line: 18 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "never", + + range: [378, 383], + loc: { + start: { column: 8, line: 19 }, + end: { column: 13, line: 19 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [386, 387], + loc: { + start: { column: 16, line: 19 }, + end: { column: 17, line: 19 }, + }, + }, + + range: [378, 387], + loc: { + start: { column: 8, line: 19 }, + end: { column: 17, line: 19 }, + }, + }, + ], + kind: "const", + + range: [372, 388], + loc: { + start: { column: 2, line: 19 }, + end: { column: 18, line: 19 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "readonly", + + range: [397, 405], + loc: { + start: { column: 8, line: 20 }, + end: { column: 16, line: 20 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [408, 409], + loc: { + start: { column: 19, line: 20 }, + end: { column: 20, line: 20 }, + }, + }, + + range: [397, 409], + loc: { + start: { column: 8, line: 20 }, + end: { column: 20, line: 20 }, + }, + }, + ], + kind: "const", + + range: [391, 410], + loc: { + start: { column: 2, line: 20 }, + end: { column: 21, line: 20 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "require", + + range: [419, 426], + loc: { + start: { column: 8, line: 21 }, + end: { column: 15, line: 21 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [429, 430], + loc: { + start: { column: 18, line: 21 }, + end: { column: 19, line: 21 }, + }, + }, + + range: [419, 430], + loc: { + start: { column: 8, line: 21 }, + end: { column: 19, line: 21 }, + }, + }, + ], + kind: "const", + + range: [413, 431], + loc: { + start: { column: 2, line: 21 }, + end: { column: 20, line: 21 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "number", + + range: [440, 446], + loc: { + start: { column: 8, line: 22 }, + end: { column: 14, line: 22 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [449, 450], + loc: { + start: { column: 17, line: 22 }, + end: { column: 18, line: 22 }, + }, + }, + + range: [440, 450], + loc: { + start: { column: 8, line: 22 }, + end: { column: 18, line: 22 }, + }, + }, + ], + kind: "const", + + range: [434, 451], + loc: { + start: { column: 2, line: 22 }, + end: { column: 19, line: 22 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "object", + + range: [460, 466], + loc: { + start: { column: 8, line: 23 }, + end: { column: 14, line: 23 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [469, 470], + loc: { + start: { column: 17, line: 23 }, + end: { column: 18, line: 23 }, + }, + }, + + range: [460, 470], + loc: { + start: { column: 8, line: 23 }, + end: { column: 18, line: 23 }, + }, + }, + ], + kind: "const", + + range: [454, 471], + loc: { + start: { column: 2, line: 23 }, + end: { column: 19, line: 23 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "set", + + range: [480, 483], + loc: { + start: { column: 8, line: 24 }, + end: { column: 11, line: 24 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [486, 487], + loc: { + start: { column: 14, line: 24 }, + end: { column: 15, line: 24 }, + }, + }, + + range: [480, 487], + loc: { + start: { column: 8, line: 24 }, + end: { column: 15, line: 24 }, + }, + }, + ], + kind: "const", + + range: [474, 488], + loc: { + start: { column: 2, line: 24 }, + end: { column: 16, line: 24 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "string", + + range: [497, 503], + loc: { + start: { column: 8, line: 25 }, + end: { column: 14, line: 25 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [506, 507], + loc: { + start: { column: 17, line: 25 }, + end: { column: 18, line: 25 }, + }, + }, + + range: [497, 507], + loc: { + start: { column: 8, line: 25 }, + end: { column: 18, line: 25 }, + }, + }, + ], + kind: "const", + + range: [491, 508], + loc: { + start: { column: 2, line: 25 }, + end: { column: 19, line: 25 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "symbol", + + range: [517, 523], + loc: { + start: { column: 8, line: 26 }, + end: { column: 14, line: 26 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [526, 527], + loc: { + start: { column: 17, line: 26 }, + end: { column: 18, line: 26 }, + }, + }, + + range: [517, 527], + loc: { + start: { column: 8, line: 26 }, + end: { column: 18, line: 26 }, + }, + }, + ], + kind: "const", + + range: [511, 528], + loc: { + start: { column: 2, line: 26 }, + end: { column: 19, line: 26 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "type", + + range: [537, 541], + loc: { + start: { column: 8, line: 27 }, + end: { column: 12, line: 27 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [544, 545], + loc: { + start: { column: 15, line: 27 }, + end: { column: 16, line: 27 }, + }, + }, + + range: [537, 545], + loc: { + start: { column: 8, line: 27 }, + end: { column: 16, line: 27 }, + }, + }, + ], + kind: "const", + + range: [531, 546], + loc: { + start: { column: 2, line: 27 }, + end: { column: 17, line: 27 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "undefined", + + range: [555, 564], + loc: { + start: { column: 8, line: 28 }, + end: { column: 17, line: 28 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [567, 568], + loc: { + start: { column: 20, line: 28 }, + end: { column: 21, line: 28 }, + }, + }, + + range: [555, 568], + loc: { + start: { column: 8, line: 28 }, + end: { column: 21, line: 28 }, + }, + }, + ], + kind: "const", + + range: [549, 569], + loc: { + start: { column: 2, line: 28 }, + end: { column: 22, line: 28 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "unique", + + range: [578, 584], + loc: { + start: { column: 8, line: 29 }, + end: { column: 14, line: 29 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [587, 588], + loc: { + start: { column: 17, line: 29 }, + end: { column: 18, line: 29 }, + }, + }, + + range: [578, 588], + loc: { + start: { column: 8, line: 29 }, + end: { column: 18, line: 29 }, + }, + }, + ], + kind: "const", + + range: [572, 589], + loc: { + start: { column: 2, line: 29 }, + end: { column: 19, line: 29 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "unknown", + + range: [598, 605], + loc: { + start: { column: 8, line: 30 }, + end: { column: 15, line: 30 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [608, 609], + loc: { + start: { column: 18, line: 30 }, + end: { column: 19, line: 30 }, + }, + }, + + range: [598, 609], + loc: { + start: { column: 8, line: 30 }, + end: { column: 19, line: 30 }, + }, + }, + ], + kind: "const", + + range: [592, 610], + loc: { + start: { column: 2, line: 30 }, + end: { column: 20, line: 30 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "from", + + range: [619, 623], + loc: { + start: { column: 8, line: 31 }, + end: { column: 12, line: 31 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [626, 627], + loc: { + start: { column: 15, line: 31 }, + end: { column: 16, line: 31 }, + }, + }, + + range: [619, 627], + loc: { + start: { column: 8, line: 31 }, + end: { column: 16, line: 31 }, + }, + }, + ], + kind: "const", + + range: [613, 628], + loc: { + start: { column: 2, line: 31 }, + end: { column: 17, line: 31 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "global", + + range: [637, 643], + loc: { + start: { column: 8, line: 32 }, + end: { column: 14, line: 32 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [646, 647], + loc: { + start: { column: 17, line: 32 }, + end: { column: 18, line: 32 }, + }, + }, + + range: [637, 647], + loc: { + start: { column: 8, line: 32 }, + end: { column: 18, line: 32 }, + }, + }, + ], + kind: "const", + + range: [631, 648], + loc: { + start: { column: 2, line: 32 }, + end: { column: 19, line: 32 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "bigint", + + range: [657, 663], + loc: { + start: { column: 8, line: 33 }, + end: { column: 14, line: 33 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [666, 667], + loc: { + start: { column: 17, line: 33 }, + end: { column: 18, line: 33 }, + }, + }, + + range: [657, 667], + loc: { + start: { column: 8, line: 33 }, + end: { column: 18, line: 33 }, + }, + }, + ], + kind: "const", + + range: [651, 668], + loc: { + start: { column: 2, line: 33 }, + end: { column: 19, line: 33 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "of", + + range: [677, 679], + loc: { + start: { column: 8, line: 34 }, + end: { column: 10, line: 34 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [682, 683], + loc: { + start: { column: 13, line: 34 }, + end: { column: 14, line: 34 }, + }, + }, + + range: [677, 683], + loc: { + start: { column: 8, line: 34 }, + end: { column: 14, line: 34 }, + }, + }, + ], + kind: "const", + + range: [671, 684], + loc: { + start: { column: 2, line: 34 }, + end: { column: 15, line: 34 }, + }, + }, + ], + + range: [73, 686], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 35 }, + }, + }, + ImportDeclaration { + type: "ImportDeclaration", + assertions: Array [], + importKind: "value", + source: Literal { + type: "Literal", + raw: "'fake-module'", + value: "fake-module", + + range: [1004, 1017], + loc: { + start: { column: 7, line: 69 }, + end: { column: 20, line: 69 }, + }, + }, + specifiers: Array [ + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "abstract", + + range: [699, 707], + loc: { + start: { column: 2, line: 38 }, + end: { column: 10, line: 38 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "abstract", + + range: [699, 707], + loc: { + start: { column: 2, line: 38 }, + end: { column: 10, line: 38 }, + }, + }, + + range: [699, 707], + loc: { + start: { column: 2, line: 38 }, + end: { column: 10, line: 38 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "as", + + range: [711, 713], + loc: { + start: { column: 2, line: 39 }, + end: { column: 4, line: 39 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "as", + + range: [711, 713], + loc: { + start: { column: 2, line: 39 }, + end: { column: 4, line: 39 }, + }, + }, + + range: [711, 713], + loc: { + start: { column: 2, line: 39 }, + end: { column: 4, line: 39 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "asserts", + + range: [717, 724], + loc: { + start: { column: 2, line: 40 }, + end: { column: 9, line: 40 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "asserts", + + range: [717, 724], + loc: { + start: { column: 2, line: 40 }, + end: { column: 9, line: 40 }, + }, + }, + + range: [717, 724], + loc: { + start: { column: 2, line: 40 }, + end: { column: 9, line: 40 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "any", + + range: [728, 731], + loc: { + start: { column: 2, line: 41 }, + end: { column: 5, line: 41 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "any", + + range: [728, 731], + loc: { + start: { column: 2, line: 41 }, + end: { column: 5, line: 41 }, + }, + }, + + range: [728, 731], + loc: { + start: { column: 2, line: 41 }, + end: { column: 5, line: 41 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "async", + + range: [735, 740], + loc: { + start: { column: 2, line: 42 }, + end: { column: 7, line: 42 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "async", + + range: [735, 740], + loc: { + start: { column: 2, line: 42 }, + end: { column: 7, line: 42 }, + }, + }, + + range: [735, 740], + loc: { + start: { column: 2, line: 42 }, + end: { column: 7, line: 42 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "await", + + range: [744, 749], + loc: { + start: { column: 2, line: 43 }, + end: { column: 7, line: 43 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "await", + + range: [744, 749], + loc: { + start: { column: 2, line: 43 }, + end: { column: 7, line: 43 }, + }, + }, + + range: [744, 749], + loc: { + start: { column: 2, line: 43 }, + end: { column: 7, line: 43 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "boolean", + + range: [753, 760], + loc: { + start: { column: 2, line: 44 }, + end: { column: 9, line: 44 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "boolean", + + range: [753, 760], + loc: { + start: { column: 2, line: 44 }, + end: { column: 9, line: 44 }, + }, + }, + + range: [753, 760], + loc: { + start: { column: 2, line: 44 }, + end: { column: 9, line: 44 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "constructor", + + range: [764, 775], + loc: { + start: { column: 2, line: 45 }, + end: { column: 13, line: 45 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "constructor", + + range: [764, 775], + loc: { + start: { column: 2, line: 45 }, + end: { column: 13, line: 45 }, + }, + }, + + range: [764, 775], + loc: { + start: { column: 2, line: 45 }, + end: { column: 13, line: 45 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "declare", + + range: [779, 786], + loc: { + start: { column: 2, line: 46 }, + end: { column: 9, line: 46 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "declare", + + range: [779, 786], + loc: { + start: { column: 2, line: 46 }, + end: { column: 9, line: 46 }, + }, + }, + + range: [779, 786], + loc: { + start: { column: 2, line: 46 }, + end: { column: 9, line: 46 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "get", + + range: [790, 793], + loc: { + start: { column: 2, line: 47 }, + end: { column: 5, line: 47 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "get", + + range: [790, 793], + loc: { + start: { column: 2, line: 47 }, + end: { column: 5, line: 47 }, + }, + }, + + range: [790, 793], + loc: { + start: { column: 2, line: 47 }, + end: { column: 5, line: 47 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "infer", + + range: [797, 802], + loc: { + start: { column: 2, line: 48 }, + end: { column: 7, line: 48 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "infer", + + range: [797, 802], + loc: { + start: { column: 2, line: 48 }, + end: { column: 7, line: 48 }, + }, + }, + + range: [797, 802], + loc: { + start: { column: 2, line: 48 }, + end: { column: 7, line: 48 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "is", + + range: [806, 808], + loc: { + start: { column: 2, line: 49 }, + end: { column: 4, line: 49 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "is", + + range: [806, 808], + loc: { + start: { column: 2, line: 49 }, + end: { column: 4, line: 49 }, + }, + }, + + range: [806, 808], + loc: { + start: { column: 2, line: 49 }, + end: { column: 4, line: 49 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "keyof", + + range: [812, 817], + loc: { + start: { column: 2, line: 50 }, + end: { column: 7, line: 50 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "keyof", + + range: [812, 817], + loc: { + start: { column: 2, line: 50 }, + end: { column: 7, line: 50 }, + }, + }, + + range: [812, 817], + loc: { + start: { column: 2, line: 50 }, + end: { column: 7, line: 50 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "module", + + range: [821, 827], + loc: { + start: { column: 2, line: 51 }, + end: { column: 8, line: 51 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "module", + + range: [821, 827], + loc: { + start: { column: 2, line: 51 }, + end: { column: 8, line: 51 }, + }, + }, + + range: [821, 827], + loc: { + start: { column: 2, line: 51 }, + end: { column: 8, line: 51 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "namespace", + + range: [831, 840], + loc: { + start: { column: 2, line: 52 }, + end: { column: 11, line: 52 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "namespace", + + range: [831, 840], + loc: { + start: { column: 2, line: 52 }, + end: { column: 11, line: 52 }, + }, + }, + + range: [831, 840], + loc: { + start: { column: 2, line: 52 }, + end: { column: 11, line: 52 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "never", + + range: [844, 849], + loc: { + start: { column: 2, line: 53 }, + end: { column: 7, line: 53 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "never", + + range: [844, 849], + loc: { + start: { column: 2, line: 53 }, + end: { column: 7, line: 53 }, + }, + }, + + range: [844, 849], + loc: { + start: { column: 2, line: 53 }, + end: { column: 7, line: 53 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "readonly", + + range: [853, 861], + loc: { + start: { column: 2, line: 54 }, + end: { column: 10, line: 54 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "readonly", + + range: [853, 861], + loc: { + start: { column: 2, line: 54 }, + end: { column: 10, line: 54 }, + }, + }, + + range: [853, 861], + loc: { + start: { column: 2, line: 54 }, + end: { column: 10, line: 54 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "require", + + range: [865, 872], + loc: { + start: { column: 2, line: 55 }, + end: { column: 9, line: 55 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "require", + + range: [865, 872], + loc: { + start: { column: 2, line: 55 }, + end: { column: 9, line: 55 }, + }, + }, + + range: [865, 872], + loc: { + start: { column: 2, line: 55 }, + end: { column: 9, line: 55 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "number", + + range: [876, 882], + loc: { + start: { column: 2, line: 56 }, + end: { column: 8, line: 56 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "number", + + range: [876, 882], + loc: { + start: { column: 2, line: 56 }, + end: { column: 8, line: 56 }, + }, + }, + + range: [876, 882], + loc: { + start: { column: 2, line: 56 }, + end: { column: 8, line: 56 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "object", + + range: [886, 892], + loc: { + start: { column: 2, line: 57 }, + end: { column: 8, line: 57 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "object", + + range: [886, 892], + loc: { + start: { column: 2, line: 57 }, + end: { column: 8, line: 57 }, + }, + }, + + range: [886, 892], + loc: { + start: { column: 2, line: 57 }, + end: { column: 8, line: 57 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "set", + + range: [896, 899], + loc: { + start: { column: 2, line: 58 }, + end: { column: 5, line: 58 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "set", + + range: [896, 899], + loc: { + start: { column: 2, line: 58 }, + end: { column: 5, line: 58 }, + }, + }, + + range: [896, 899], + loc: { + start: { column: 2, line: 58 }, + end: { column: 5, line: 58 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "string", + + range: [903, 909], + loc: { + start: { column: 2, line: 59 }, + end: { column: 8, line: 59 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "string", + + range: [903, 909], + loc: { + start: { column: 2, line: 59 }, + end: { column: 8, line: 59 }, + }, + }, + + range: [903, 909], + loc: { + start: { column: 2, line: 59 }, + end: { column: 8, line: 59 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "symbol", + + range: [913, 919], + loc: { + start: { column: 2, line: 60 }, + end: { column: 8, line: 60 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "symbol", + + range: [913, 919], + loc: { + start: { column: 2, line: 60 }, + end: { column: 8, line: 60 }, + }, + }, + + range: [913, 919], + loc: { + start: { column: 2, line: 60 }, + end: { column: 8, line: 60 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "type", + + range: [923, 927], + loc: { + start: { column: 2, line: 61 }, + end: { column: 6, line: 61 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "type", + + range: [923, 927], + loc: { + start: { column: 2, line: 61 }, + end: { column: 6, line: 61 }, + }, + }, + + range: [923, 927], + loc: { + start: { column: 2, line: 61 }, + end: { column: 6, line: 61 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "undefined", + + range: [931, 940], + loc: { + start: { column: 2, line: 62 }, + end: { column: 11, line: 62 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "undefined", + + range: [931, 940], + loc: { + start: { column: 2, line: 62 }, + end: { column: 11, line: 62 }, + }, + }, + + range: [931, 940], + loc: { + start: { column: 2, line: 62 }, + end: { column: 11, line: 62 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "unique", + + range: [944, 950], + loc: { + start: { column: 2, line: 63 }, + end: { column: 8, line: 63 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "unique", + + range: [944, 950], + loc: { + start: { column: 2, line: 63 }, + end: { column: 8, line: 63 }, + }, + }, + + range: [944, 950], + loc: { + start: { column: 2, line: 63 }, + end: { column: 8, line: 63 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "unknown", + + range: [954, 961], + loc: { + start: { column: 2, line: 64 }, + end: { column: 9, line: 64 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "unknown", + + range: [954, 961], + loc: { + start: { column: 2, line: 64 }, + end: { column: 9, line: 64 }, + }, + }, + + range: [954, 961], + loc: { + start: { column: 2, line: 64 }, + end: { column: 9, line: 64 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "from", + + range: [965, 969], + loc: { + start: { column: 2, line: 65 }, + end: { column: 6, line: 65 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "from", + + range: [965, 969], + loc: { + start: { column: 2, line: 65 }, + end: { column: 6, line: 65 }, + }, + }, + + range: [965, 969], + loc: { + start: { column: 2, line: 65 }, + end: { column: 6, line: 65 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "global", + + range: [973, 979], + loc: { + start: { column: 2, line: 66 }, + end: { column: 8, line: 66 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "global", + + range: [973, 979], + loc: { + start: { column: 2, line: 66 }, + end: { column: 8, line: 66 }, + }, + }, + + range: [973, 979], + loc: { + start: { column: 2, line: 66 }, + end: { column: 8, line: 66 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "bigint", + + range: [983, 989], + loc: { + start: { column: 2, line: 67 }, + end: { column: 8, line: 67 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "bigint", + + range: [983, 989], + loc: { + start: { column: 2, line: 67 }, + end: { column: 8, line: 67 }, + }, + }, + + range: [983, 989], + loc: { + start: { column: 2, line: 67 }, + end: { column: 8, line: 67 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "of", + + range: [993, 995], + loc: { + start: { column: 2, line: 68 }, + end: { column: 4, line: 68 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "of", + + range: [993, 995], + loc: { + start: { column: 2, line: 68 }, + end: { column: 4, line: 68 }, + }, + }, + + range: [993, 995], + loc: { + start: { column: 2, line: 68 }, + end: { column: 4, line: 68 }, + }, + }, + ], + + range: [688, 1018], + loc: { + start: { column: 0, line: 37 }, + end: { column: 21, line: 69 }, + }, + }, + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [1032, 1034], + loc: { + start: { column: 12, line: 71 }, + end: { column: 14, line: 71 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "X", + + range: [1030, 1031], + loc: { + start: { column: 10, line: 71 }, + end: { column: 11, line: 71 }, + }, + }, + + range: [1020, 1034], + loc: { + start: { column: 0, line: 71 }, + end: { column: 14, line: 71 }, + }, + }, + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "a", + + range: [1067, 1068], + loc: { + start: { column: 9, line: 73 }, + end: { column: 10, line: 73 }, + }, + }, + kind: "method", + static: true, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [1071, 1073], + loc: { + start: { column: 13, line: 73 }, + end: { column: 15, line: 73 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [1068, 1073], + loc: { + start: { column: 10, line: 73 }, + end: { column: 15, line: 73 }, + }, + }, + + range: [1060, 1073], + loc: { + start: { column: 2, line: 73 }, + end: { column: 15, line: 73 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + accessibility: "private", + computed: false, + key: Identifier { + type: "Identifier", + name: "b", + + range: [1084, 1085], + loc: { + start: { column: 10, line: 74 }, + end: { column: 11, line: 74 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [1088, 1090], + loc: { + start: { column: 14, line: 74 }, + end: { column: 16, line: 74 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [1085, 1090], + loc: { + start: { column: 11, line: 74 }, + end: { column: 16, line: 74 }, + }, + }, + + range: [1076, 1090], + loc: { + start: { column: 2, line: 74 }, + end: { column: 16, line: 74 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + accessibility: "public", + computed: false, + key: Identifier { + type: "Identifier", + name: "c", + + range: [1100, 1101], + loc: { + start: { column: 9, line: 75 }, + end: { column: 10, line: 75 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [1104, 1106], + loc: { + start: { column: 13, line: 75 }, + end: { column: 15, line: 75 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [1101, 1106], + loc: { + start: { column: 10, line: 75 }, + end: { column: 15, line: 75 }, + }, + }, + + range: [1093, 1106], + loc: { + start: { column: 2, line: 75 }, + end: { column: 15, line: 75 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + accessibility: "protected", + computed: false, + key: Identifier { + type: "Identifier", + name: "d", + + range: [1120, 1121], + loc: { + start: { column: 13, line: 76 }, + end: { column: 14, line: 76 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + + range: [1134, 1135], + loc: { + start: { column: 8, line: 77 }, + end: { column: 9, line: 77 }, + }, + }, + init: YieldExpression { + type: "YieldExpression", + argument: null, + delegate: false, + + range: [1138, 1143], + loc: { + start: { column: 12, line: 77 }, + end: { column: 17, line: 77 }, + }, + }, + + range: [1134, 1143], + loc: { + start: { column: 8, line: 77 }, + end: { column: 17, line: 77 }, + }, + }, + ], + kind: "let", + + range: [1130, 1144], + loc: { + start: { column: 4, line: 77 }, + end: { column: 18, line: 77 }, + }, + }, + ], + + range: [1124, 1148], + loc: { + start: { column: 17, line: 76 }, + end: { column: 3, line: 78 }, + }, + }, + expression: false, + generator: true, + id: null, + params: Array [], + + range: [1121, 1148], + loc: { + start: { column: 14, line: 76 }, + end: { column: 3, line: 78 }, + }, + }, + + range: [1109, 1148], + loc: { + start: { column: 2, line: 76 }, + end: { column: 3, line: 78 }, + }, + }, + ], + + range: [1056, 1150], + loc: { + start: { column: 21, line: 72 }, + end: { column: 1, line: 79 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "C", + + range: [1041, 1042], + loc: { + start: { column: 6, line: 72 }, + end: { column: 7, line: 72 }, + }, + }, + implements: Array [ + TSExpressionWithTypeArguments { + type: "TSExpressionWithTypeArguments", + expression: Identifier { + type: "Identifier", + name: "X", + + range: [1054, 1055], + loc: { + start: { column: 19, line: 72 }, + end: { column: 20, line: 72 }, + }, + }, + + range: [1054, 1055], + loc: { + start: { column: 19, line: 72 }, + end: { column: 20, line: 72 }, + }, + }, + ], + superClass: null, + + range: [1035, 1150], + loc: { + start: { column: 0, line: 72 }, + end: { column: 1, line: 79 }, + }, + }, + ], + sourceType: "script", + + range: [73, 1151], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 80 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..84970292e9fd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,2656 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics keyword-variables Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "{", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [77, 82], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [83, 91], + loc: { + start: { column: 8, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [92, 93], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [94, 95], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [95, 96], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [99, 104], + loc: { + start: { column: 2, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [105, 107], + loc: { + start: { column: 8, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [108, 109], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [110, 111], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [111, 112], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [115, 120], + loc: { + start: { column: 2, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [121, 128], + loc: { + start: { column: 8, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [129, 130], + loc: { + start: { column: 16, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [131, 132], + loc: { + start: { column: 18, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [132, 133], + loc: { + start: { column: 19, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [136, 141], + loc: { + start: { column: 2, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [142, 145], + loc: { + start: { column: 8, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [146, 147], + loc: { + start: { column: 12, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [148, 149], + loc: { + start: { column: 14, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [149, 150], + loc: { + start: { column: 15, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [153, 158], + loc: { + start: { column: 2, line: 8 }, + end: { column: 7, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "async", + + range: [159, 164], + loc: { + start: { column: 8, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [165, 166], + loc: { + start: { column: 14, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [167, 168], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [168, 169], + loc: { + start: { column: 17, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [172, 177], + loc: { + start: { column: 2, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "await", + + range: [178, 183], + loc: { + start: { column: 8, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [184, 185], + loc: { + start: { column: 14, line: 9 }, + end: { column: 15, line: 9 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [186, 187], + loc: { + start: { column: 16, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [187, 188], + loc: { + start: { column: 17, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [191, 196], + loc: { + start: { column: 2, line: 10 }, + end: { column: 7, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [197, 204], + loc: { + start: { column: 8, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [205, 206], + loc: { + start: { column: 16, line: 10 }, + end: { column: 17, line: 10 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [207, 208], + loc: { + start: { column: 18, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [208, 209], + loc: { + start: { column: 19, line: 10 }, + end: { column: 20, line: 10 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [212, 217], + loc: { + start: { column: 2, line: 11 }, + end: { column: 7, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [218, 229], + loc: { + start: { column: 8, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [230, 231], + loc: { + start: { column: 20, line: 11 }, + end: { column: 21, line: 11 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [232, 233], + loc: { + start: { column: 22, line: 11 }, + end: { column: 23, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [233, 234], + loc: { + start: { column: 23, line: 11 }, + end: { column: 24, line: 11 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [237, 242], + loc: { + start: { column: 2, line: 12 }, + end: { column: 7, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [243, 250], + loc: { + start: { column: 8, line: 12 }, + end: { column: 15, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [251, 252], + loc: { + start: { column: 16, line: 12 }, + end: { column: 17, line: 12 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [253, 254], + loc: { + start: { column: 18, line: 12 }, + end: { column: 19, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [254, 255], + loc: { + start: { column: 19, line: 12 }, + end: { column: 20, line: 12 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [258, 263], + loc: { + start: { column: 2, line: 13 }, + end: { column: 7, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "get", + + range: [264, 267], + loc: { + start: { column: 8, line: 13 }, + end: { column: 11, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [268, 269], + loc: { + start: { column: 12, line: 13 }, + end: { column: 13, line: 13 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [270, 271], + loc: { + start: { column: 14, line: 13 }, + end: { column: 15, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [271, 272], + loc: { + start: { column: 15, line: 13 }, + end: { column: 16, line: 13 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [275, 280], + loc: { + start: { column: 2, line: 14 }, + end: { column: 7, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [281, 286], + loc: { + start: { column: 8, line: 14 }, + end: { column: 13, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [287, 288], + loc: { + start: { column: 14, line: 14 }, + end: { column: 15, line: 14 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [289, 290], + loc: { + start: { column: 16, line: 14 }, + end: { column: 17, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [290, 291], + loc: { + start: { column: 17, line: 14 }, + end: { column: 18, line: 14 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [294, 299], + loc: { + start: { column: 2, line: 15 }, + end: { column: 7, line: 15 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [300, 302], + loc: { + start: { column: 8, line: 15 }, + end: { column: 10, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [303, 304], + loc: { + start: { column: 11, line: 15 }, + end: { column: 12, line: 15 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [305, 306], + loc: { + start: { column: 13, line: 15 }, + end: { column: 14, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [306, 307], + loc: { + start: { column: 14, line: 15 }, + end: { column: 15, line: 15 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [310, 315], + loc: { + start: { column: 2, line: 16 }, + end: { column: 7, line: 16 }, + }, + }, + Identifier { + type: "Identifier", + value: "keyof", + + range: [316, 321], + loc: { + start: { column: 8, line: 16 }, + end: { column: 13, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [322, 323], + loc: { + start: { column: 14, line: 16 }, + end: { column: 15, line: 16 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [324, 325], + loc: { + start: { column: 16, line: 16 }, + end: { column: 17, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [325, 326], + loc: { + start: { column: 17, line: 16 }, + end: { column: 18, line: 16 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [329, 334], + loc: { + start: { column: 2, line: 17 }, + end: { column: 7, line: 17 }, + }, + }, + Identifier { + type: "Identifier", + value: "module", + + range: [335, 341], + loc: { + start: { column: 8, line: 17 }, + end: { column: 14, line: 17 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [342, 343], + loc: { + start: { column: 15, line: 17 }, + end: { column: 16, line: 17 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [344, 345], + loc: { + start: { column: 17, line: 17 }, + end: { column: 18, line: 17 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [345, 346], + loc: { + start: { column: 18, line: 17 }, + end: { column: 19, line: 17 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [349, 354], + loc: { + start: { column: 2, line: 18 }, + end: { column: 7, line: 18 }, + }, + }, + Identifier { + type: "Identifier", + value: "namespace", + + range: [355, 364], + loc: { + start: { column: 8, line: 18 }, + end: { column: 17, line: 18 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [365, 366], + loc: { + start: { column: 18, line: 18 }, + end: { column: 19, line: 18 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [367, 368], + loc: { + start: { column: 20, line: 18 }, + end: { column: 21, line: 18 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [368, 369], + loc: { + start: { column: 21, line: 18 }, + end: { column: 22, line: 18 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [372, 377], + loc: { + start: { column: 2, line: 19 }, + end: { column: 7, line: 19 }, + }, + }, + Identifier { + type: "Identifier", + value: "never", + + range: [378, 383], + loc: { + start: { column: 8, line: 19 }, + end: { column: 13, line: 19 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [384, 385], + loc: { + start: { column: 14, line: 19 }, + end: { column: 15, line: 19 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [386, 387], + loc: { + start: { column: 16, line: 19 }, + end: { column: 17, line: 19 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [387, 388], + loc: { + start: { column: 17, line: 19 }, + end: { column: 18, line: 19 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [391, 396], + loc: { + start: { column: 2, line: 20 }, + end: { column: 7, line: 20 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [397, 405], + loc: { + start: { column: 8, line: 20 }, + end: { column: 16, line: 20 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [406, 407], + loc: { + start: { column: 17, line: 20 }, + end: { column: 18, line: 20 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [408, 409], + loc: { + start: { column: 19, line: 20 }, + end: { column: 20, line: 20 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [409, 410], + loc: { + start: { column: 20, line: 20 }, + end: { column: 21, line: 20 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [413, 418], + loc: { + start: { column: 2, line: 21 }, + end: { column: 7, line: 21 }, + }, + }, + Identifier { + type: "Identifier", + value: "require", + + range: [419, 426], + loc: { + start: { column: 8, line: 21 }, + end: { column: 15, line: 21 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [427, 428], + loc: { + start: { column: 16, line: 21 }, + end: { column: 17, line: 21 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [429, 430], + loc: { + start: { column: 18, line: 21 }, + end: { column: 19, line: 21 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [430, 431], + loc: { + start: { column: 19, line: 21 }, + end: { column: 20, line: 21 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [434, 439], + loc: { + start: { column: 2, line: 22 }, + end: { column: 7, line: 22 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [440, 446], + loc: { + start: { column: 8, line: 22 }, + end: { column: 14, line: 22 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [447, 448], + loc: { + start: { column: 15, line: 22 }, + end: { column: 16, line: 22 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [449, 450], + loc: { + start: { column: 17, line: 22 }, + end: { column: 18, line: 22 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [450, 451], + loc: { + start: { column: 18, line: 22 }, + end: { column: 19, line: 22 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [454, 459], + loc: { + start: { column: 2, line: 23 }, + end: { column: 7, line: 23 }, + }, + }, + Identifier { + type: "Identifier", + value: "object", + + range: [460, 466], + loc: { + start: { column: 8, line: 23 }, + end: { column: 14, line: 23 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [467, 468], + loc: { + start: { column: 15, line: 23 }, + end: { column: 16, line: 23 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [469, 470], + loc: { + start: { column: 17, line: 23 }, + end: { column: 18, line: 23 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [470, 471], + loc: { + start: { column: 18, line: 23 }, + end: { column: 19, line: 23 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [474, 479], + loc: { + start: { column: 2, line: 24 }, + end: { column: 7, line: 24 }, + }, + }, + Identifier { + type: "Identifier", + value: "set", + + range: [480, 483], + loc: { + start: { column: 8, line: 24 }, + end: { column: 11, line: 24 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [484, 485], + loc: { + start: { column: 12, line: 24 }, + end: { column: 13, line: 24 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [486, 487], + loc: { + start: { column: 14, line: 24 }, + end: { column: 15, line: 24 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [487, 488], + loc: { + start: { column: 15, line: 24 }, + end: { column: 16, line: 24 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [491, 496], + loc: { + start: { column: 2, line: 25 }, + end: { column: 7, line: 25 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [497, 503], + loc: { + start: { column: 8, line: 25 }, + end: { column: 14, line: 25 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [504, 505], + loc: { + start: { column: 15, line: 25 }, + end: { column: 16, line: 25 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [506, 507], + loc: { + start: { column: 17, line: 25 }, + end: { column: 18, line: 25 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [507, 508], + loc: { + start: { column: 18, line: 25 }, + end: { column: 19, line: 25 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [511, 516], + loc: { + start: { column: 2, line: 26 }, + end: { column: 7, line: 26 }, + }, + }, + Identifier { + type: "Identifier", + value: "symbol", + + range: [517, 523], + loc: { + start: { column: 8, line: 26 }, + end: { column: 14, line: 26 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [524, 525], + loc: { + start: { column: 15, line: 26 }, + end: { column: 16, line: 26 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [526, 527], + loc: { + start: { column: 17, line: 26 }, + end: { column: 18, line: 26 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [527, 528], + loc: { + start: { column: 18, line: 26 }, + end: { column: 19, line: 26 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [531, 536], + loc: { + start: { column: 2, line: 27 }, + end: { column: 7, line: 27 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [537, 541], + loc: { + start: { column: 8, line: 27 }, + end: { column: 12, line: 27 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [542, 543], + loc: { + start: { column: 13, line: 27 }, + end: { column: 14, line: 27 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [544, 545], + loc: { + start: { column: 15, line: 27 }, + end: { column: 16, line: 27 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [545, 546], + loc: { + start: { column: 16, line: 27 }, + end: { column: 17, line: 27 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [549, 554], + loc: { + start: { column: 2, line: 28 }, + end: { column: 7, line: 28 }, + }, + }, + Identifier { + type: "Identifier", + value: "undefined", + + range: [555, 564], + loc: { + start: { column: 8, line: 28 }, + end: { column: 17, line: 28 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [565, 566], + loc: { + start: { column: 18, line: 28 }, + end: { column: 19, line: 28 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [567, 568], + loc: { + start: { column: 20, line: 28 }, + end: { column: 21, line: 28 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [568, 569], + loc: { + start: { column: 21, line: 28 }, + end: { column: 22, line: 28 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [572, 577], + loc: { + start: { column: 2, line: 29 }, + end: { column: 7, line: 29 }, + }, + }, + Identifier { + type: "Identifier", + value: "unique", + + range: [578, 584], + loc: { + start: { column: 8, line: 29 }, + end: { column: 14, line: 29 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [585, 586], + loc: { + start: { column: 15, line: 29 }, + end: { column: 16, line: 29 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [587, 588], + loc: { + start: { column: 17, line: 29 }, + end: { column: 18, line: 29 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [588, 589], + loc: { + start: { column: 18, line: 29 }, + end: { column: 19, line: 29 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [592, 597], + loc: { + start: { column: 2, line: 30 }, + end: { column: 7, line: 30 }, + }, + }, + Identifier { + type: "Identifier", + value: "unknown", + + range: [598, 605], + loc: { + start: { column: 8, line: 30 }, + end: { column: 15, line: 30 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [606, 607], + loc: { + start: { column: 16, line: 30 }, + end: { column: 17, line: 30 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [608, 609], + loc: { + start: { column: 18, line: 30 }, + end: { column: 19, line: 30 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [609, 610], + loc: { + start: { column: 19, line: 30 }, + end: { column: 20, line: 30 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [613, 618], + loc: { + start: { column: 2, line: 31 }, + end: { column: 7, line: 31 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [619, 623], + loc: { + start: { column: 8, line: 31 }, + end: { column: 12, line: 31 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [624, 625], + loc: { + start: { column: 13, line: 31 }, + end: { column: 14, line: 31 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [626, 627], + loc: { + start: { column: 15, line: 31 }, + end: { column: 16, line: 31 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [627, 628], + loc: { + start: { column: 16, line: 31 }, + end: { column: 17, line: 31 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [631, 636], + loc: { + start: { column: 2, line: 32 }, + end: { column: 7, line: 32 }, + }, + }, + Identifier { + type: "Identifier", + value: "global", + + range: [637, 643], + loc: { + start: { column: 8, line: 32 }, + end: { column: 14, line: 32 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [644, 645], + loc: { + start: { column: 15, line: 32 }, + end: { column: 16, line: 32 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [646, 647], + loc: { + start: { column: 17, line: 32 }, + end: { column: 18, line: 32 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [647, 648], + loc: { + start: { column: 18, line: 32 }, + end: { column: 19, line: 32 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [651, 656], + loc: { + start: { column: 2, line: 33 }, + end: { column: 7, line: 33 }, + }, + }, + Identifier { + type: "Identifier", + value: "bigint", + + range: [657, 663], + loc: { + start: { column: 8, line: 33 }, + end: { column: 14, line: 33 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [664, 665], + loc: { + start: { column: 15, line: 33 }, + end: { column: 16, line: 33 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [666, 667], + loc: { + start: { column: 17, line: 33 }, + end: { column: 18, line: 33 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [667, 668], + loc: { + start: { column: 18, line: 33 }, + end: { column: 19, line: 33 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [671, 676], + loc: { + start: { column: 2, line: 34 }, + end: { column: 7, line: 34 }, + }, + }, + Identifier { + type: "Identifier", + value: "of", + + range: [677, 679], + loc: { + start: { column: 8, line: 34 }, + end: { column: 10, line: 34 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [680, 681], + loc: { + start: { column: 11, line: 34 }, + end: { column: 12, line: 34 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [682, 683], + loc: { + start: { column: 13, line: 34 }, + end: { column: 14, line: 34 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [683, 684], + loc: { + start: { column: 14, line: 34 }, + end: { column: 15, line: 34 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [685, 686], + loc: { + start: { column: 0, line: 35 }, + end: { column: 1, line: 35 }, + }, + }, + Keyword { + type: "Keyword", + value: "import", + + range: [688, 694], + loc: { + start: { column: 0, line: 37 }, + end: { column: 6, line: 37 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [695, 696], + loc: { + start: { column: 7, line: 37 }, + end: { column: 8, line: 37 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [699, 707], + loc: { + start: { column: 2, line: 38 }, + end: { column: 10, line: 38 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [707, 708], + loc: { + start: { column: 10, line: 38 }, + end: { column: 11, line: 38 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [711, 713], + loc: { + start: { column: 2, line: 39 }, + end: { column: 4, line: 39 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [713, 714], + loc: { + start: { column: 4, line: 39 }, + end: { column: 5, line: 39 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [717, 724], + loc: { + start: { column: 2, line: 40 }, + end: { column: 9, line: 40 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [724, 725], + loc: { + start: { column: 9, line: 40 }, + end: { column: 10, line: 40 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [728, 731], + loc: { + start: { column: 2, line: 41 }, + end: { column: 5, line: 41 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [731, 732], + loc: { + start: { column: 5, line: 41 }, + end: { column: 6, line: 41 }, + }, + }, + Identifier { + type: "Identifier", + value: "async", + + range: [735, 740], + loc: { + start: { column: 2, line: 42 }, + end: { column: 7, line: 42 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [740, 741], + loc: { + start: { column: 7, line: 42 }, + end: { column: 8, line: 42 }, + }, + }, + Identifier { + type: "Identifier", + value: "await", + + range: [744, 749], + loc: { + start: { column: 2, line: 43 }, + end: { column: 7, line: 43 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [749, 750], + loc: { + start: { column: 7, line: 43 }, + end: { column: 8, line: 43 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [753, 760], + loc: { + start: { column: 2, line: 44 }, + end: { column: 9, line: 44 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [760, 761], + loc: { + start: { column: 9, line: 44 }, + end: { column: 10, line: 44 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [764, 775], + loc: { + start: { column: 2, line: 45 }, + end: { column: 13, line: 45 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [775, 776], + loc: { + start: { column: 13, line: 45 }, + end: { column: 14, line: 45 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [779, 786], + loc: { + start: { column: 2, line: 46 }, + end: { column: 9, line: 46 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [786, 787], + loc: { + start: { column: 9, line: 46 }, + end: { column: 10, line: 46 }, + }, + }, + Identifier { + type: "Identifier", + value: "get", + + range: [790, 793], + loc: { + start: { column: 2, line: 47 }, + end: { column: 5, line: 47 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [793, 794], + loc: { + start: { column: 5, line: 47 }, + end: { column: 6, line: 47 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [797, 802], + loc: { + start: { column: 2, line: 48 }, + end: { column: 7, line: 48 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [802, 803], + loc: { + start: { column: 7, line: 48 }, + end: { column: 8, line: 48 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [806, 808], + loc: { + start: { column: 2, line: 49 }, + end: { column: 4, line: 49 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [808, 809], + loc: { + start: { column: 4, line: 49 }, + end: { column: 5, line: 49 }, + }, + }, + Identifier { + type: "Identifier", + value: "keyof", + + range: [812, 817], + loc: { + start: { column: 2, line: 50 }, + end: { column: 7, line: 50 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [817, 818], + loc: { + start: { column: 7, line: 50 }, + end: { column: 8, line: 50 }, + }, + }, + Identifier { + type: "Identifier", + value: "module", + + range: [821, 827], + loc: { + start: { column: 2, line: 51 }, + end: { column: 8, line: 51 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [827, 828], + loc: { + start: { column: 8, line: 51 }, + end: { column: 9, line: 51 }, + }, + }, + Identifier { + type: "Identifier", + value: "namespace", + + range: [831, 840], + loc: { + start: { column: 2, line: 52 }, + end: { column: 11, line: 52 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [840, 841], + loc: { + start: { column: 11, line: 52 }, + end: { column: 12, line: 52 }, + }, + }, + Identifier { + type: "Identifier", + value: "never", + + range: [844, 849], + loc: { + start: { column: 2, line: 53 }, + end: { column: 7, line: 53 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [849, 850], + loc: { + start: { column: 7, line: 53 }, + end: { column: 8, line: 53 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [853, 861], + loc: { + start: { column: 2, line: 54 }, + end: { column: 10, line: 54 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [861, 862], + loc: { + start: { column: 10, line: 54 }, + end: { column: 11, line: 54 }, + }, + }, + Identifier { + type: "Identifier", + value: "require", + + range: [865, 872], + loc: { + start: { column: 2, line: 55 }, + end: { column: 9, line: 55 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [872, 873], + loc: { + start: { column: 9, line: 55 }, + end: { column: 10, line: 55 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [876, 882], + loc: { + start: { column: 2, line: 56 }, + end: { column: 8, line: 56 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [882, 883], + loc: { + start: { column: 8, line: 56 }, + end: { column: 9, line: 56 }, + }, + }, + Identifier { + type: "Identifier", + value: "object", + + range: [886, 892], + loc: { + start: { column: 2, line: 57 }, + end: { column: 8, line: 57 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [892, 893], + loc: { + start: { column: 8, line: 57 }, + end: { column: 9, line: 57 }, + }, + }, + Identifier { + type: "Identifier", + value: "set", + + range: [896, 899], + loc: { + start: { column: 2, line: 58 }, + end: { column: 5, line: 58 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [899, 900], + loc: { + start: { column: 5, line: 58 }, + end: { column: 6, line: 58 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [903, 909], + loc: { + start: { column: 2, line: 59 }, + end: { column: 8, line: 59 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [909, 910], + loc: { + start: { column: 8, line: 59 }, + end: { column: 9, line: 59 }, + }, + }, + Identifier { + type: "Identifier", + value: "symbol", + + range: [913, 919], + loc: { + start: { column: 2, line: 60 }, + end: { column: 8, line: 60 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [919, 920], + loc: { + start: { column: 8, line: 60 }, + end: { column: 9, line: 60 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [923, 927], + loc: { + start: { column: 2, line: 61 }, + end: { column: 6, line: 61 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [927, 928], + loc: { + start: { column: 6, line: 61 }, + end: { column: 7, line: 61 }, + }, + }, + Identifier { + type: "Identifier", + value: "undefined", + + range: [931, 940], + loc: { + start: { column: 2, line: 62 }, + end: { column: 11, line: 62 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [940, 941], + loc: { + start: { column: 11, line: 62 }, + end: { column: 12, line: 62 }, + }, + }, + Identifier { + type: "Identifier", + value: "unique", + + range: [944, 950], + loc: { + start: { column: 2, line: 63 }, + end: { column: 8, line: 63 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [950, 951], + loc: { + start: { column: 8, line: 63 }, + end: { column: 9, line: 63 }, + }, + }, + Identifier { + type: "Identifier", + value: "unknown", + + range: [954, 961], + loc: { + start: { column: 2, line: 64 }, + end: { column: 9, line: 64 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [961, 962], + loc: { + start: { column: 9, line: 64 }, + end: { column: 10, line: 64 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [965, 969], + loc: { + start: { column: 2, line: 65 }, + end: { column: 6, line: 65 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [969, 970], + loc: { + start: { column: 6, line: 65 }, + end: { column: 7, line: 65 }, + }, + }, + Identifier { + type: "Identifier", + value: "global", + + range: [973, 979], + loc: { + start: { column: 2, line: 66 }, + end: { column: 8, line: 66 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [979, 980], + loc: { + start: { column: 8, line: 66 }, + end: { column: 9, line: 66 }, + }, + }, + Identifier { + type: "Identifier", + value: "bigint", + + range: [983, 989], + loc: { + start: { column: 2, line: 67 }, + end: { column: 8, line: 67 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [989, 990], + loc: { + start: { column: 8, line: 67 }, + end: { column: 9, line: 67 }, + }, + }, + Identifier { + type: "Identifier", + value: "of", + + range: [993, 995], + loc: { + start: { column: 2, line: 68 }, + end: { column: 4, line: 68 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [995, 996], + loc: { + start: { column: 4, line: 68 }, + end: { column: 5, line: 68 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [997, 998], + loc: { + start: { column: 0, line: 69 }, + end: { column: 1, line: 69 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [999, 1003], + loc: { + start: { column: 2, line: 69 }, + end: { column: 6, line: 69 }, + }, + }, + String { + type: "String", + value: "'fake-module'", + + range: [1004, 1017], + loc: { + start: { column: 7, line: 69 }, + end: { column: 20, line: 69 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [1017, 1018], + loc: { + start: { column: 20, line: 69 }, + end: { column: 21, line: 69 }, + }, + }, + Identifier { + type: "Identifier", + value: "interface", + + range: [1020, 1029], + loc: { + start: { column: 0, line: 71 }, + end: { column: 9, line: 71 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [1030, 1031], + loc: { + start: { column: 10, line: 71 }, + end: { column: 11, line: 71 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [1032, 1033], + loc: { + start: { column: 12, line: 71 }, + end: { column: 13, line: 71 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [1033, 1034], + loc: { + start: { column: 13, line: 71 }, + end: { column: 14, line: 71 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [1035, 1040], + loc: { + start: { column: 0, line: 72 }, + end: { column: 5, line: 72 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [1041, 1042], + loc: { + start: { column: 6, line: 72 }, + end: { column: 7, line: 72 }, + }, + }, + Identifier { + type: "Identifier", + value: "implements", + + range: [1043, 1053], + loc: { + start: { column: 8, line: 72 }, + end: { column: 18, line: 72 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [1054, 1055], + loc: { + start: { column: 19, line: 72 }, + end: { column: 20, line: 72 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [1056, 1057], + loc: { + start: { column: 21, line: 72 }, + end: { column: 22, line: 72 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [1060, 1066], + loc: { + start: { column: 2, line: 73 }, + end: { column: 8, line: 73 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [1067, 1068], + loc: { + start: { column: 9, line: 73 }, + end: { column: 10, line: 73 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [1068, 1069], + loc: { + start: { column: 10, line: 73 }, + end: { column: 11, line: 73 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [1069, 1070], + loc: { + start: { column: 11, line: 73 }, + end: { column: 12, line: 73 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [1071, 1072], + loc: { + start: { column: 13, line: 73 }, + end: { column: 14, line: 73 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [1072, 1073], + loc: { + start: { column: 14, line: 73 }, + end: { column: 15, line: 73 }, + }, + }, + Identifier { + type: "Identifier", + value: "private", + + range: [1076, 1083], + loc: { + start: { column: 2, line: 74 }, + end: { column: 9, line: 74 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [1084, 1085], + loc: { + start: { column: 10, line: 74 }, + end: { column: 11, line: 74 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [1085, 1086], + loc: { + start: { column: 11, line: 74 }, + end: { column: 12, line: 74 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [1086, 1087], + loc: { + start: { column: 12, line: 74 }, + end: { column: 13, line: 74 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [1088, 1089], + loc: { + start: { column: 14, line: 74 }, + end: { column: 15, line: 74 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [1089, 1090], + loc: { + start: { column: 15, line: 74 }, + end: { column: 16, line: 74 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [1093, 1099], + loc: { + start: { column: 2, line: 75 }, + end: { column: 8, line: 75 }, + }, + }, + Identifier { + type: "Identifier", + value: "c", + + range: [1100, 1101], + loc: { + start: { column: 9, line: 75 }, + end: { column: 10, line: 75 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [1101, 1102], + loc: { + start: { column: 10, line: 75 }, + end: { column: 11, line: 75 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [1102, 1103], + loc: { + start: { column: 11, line: 75 }, + end: { column: 12, line: 75 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [1104, 1105], + loc: { + start: { column: 13, line: 75 }, + end: { column: 14, line: 75 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [1105, 1106], + loc: { + start: { column: 14, line: 75 }, + end: { column: 15, line: 75 }, + }, + }, + Identifier { + type: "Identifier", + value: "protected", + + range: [1109, 1118], + loc: { + start: { column: 2, line: 76 }, + end: { column: 11, line: 76 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "*", + + range: [1119, 1120], + loc: { + start: { column: 12, line: 76 }, + end: { column: 13, line: 76 }, + }, + }, + Identifier { + type: "Identifier", + value: "d", + + range: [1120, 1121], + loc: { + start: { column: 13, line: 76 }, + end: { column: 14, line: 76 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [1121, 1122], + loc: { + start: { column: 14, line: 76 }, + end: { column: 15, line: 76 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [1122, 1123], + loc: { + start: { column: 15, line: 76 }, + end: { column: 16, line: 76 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [1124, 1125], + loc: { + start: { column: 17, line: 76 }, + end: { column: 18, line: 76 }, + }, + }, + Identifier { + type: "Identifier", + value: "let", + + range: [1130, 1133], + loc: { + start: { column: 4, line: 77 }, + end: { column: 7, line: 77 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [1134, 1135], + loc: { + start: { column: 8, line: 77 }, + end: { column: 9, line: 77 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [1136, 1137], + loc: { + start: { column: 10, line: 77 }, + end: { column: 11, line: 77 }, + }, + }, + Identifier { + type: "Identifier", + value: "yield", + + range: [1138, 1143], + loc: { + start: { column: 12, line: 77 }, + end: { column: 17, line: 77 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [1143, 1144], + loc: { + start: { column: 17, line: 77 }, + end: { column: 18, line: 77 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [1147, 1148], + loc: { + start: { column: 2, line: 78 }, + end: { column: 3, line: 78 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [1149, 1150], + loc: { + start: { column: 0, line: 79 }, + end: { column: 1, line: 79 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..8563a77d1a3c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,2605 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + BlockStatement { + type: 'BlockStatement', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'abstract', + + range: [83, 91], + loc: { + start: { column: 8, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [94, 95], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [83, 95], + loc: { + start: { column: 8, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + kind: 'const', + + range: [77, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'as', + + range: [105, 107], + loc: { + start: { column: 8, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [110, 111], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + + range: [105, 111], + loc: { + start: { column: 8, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + ], + kind: 'const', + + range: [99, 112], + loc: { + start: { column: 2, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'asserts', + + range: [121, 128], + loc: { + start: { column: 8, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [131, 132], + loc: { + start: { column: 18, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + + range: [121, 132], + loc: { + start: { column: 8, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + ], + kind: 'const', + + range: [115, 133], + loc: { + start: { column: 2, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'any', + + range: [142, 145], + loc: { + start: { column: 8, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [148, 149], + loc: { + start: { column: 14, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + + range: [142, 149], + loc: { + start: { column: 8, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + ], + kind: 'const', + + range: [136, 150], + loc: { + start: { column: 2, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'async', + + range: [159, 164], + loc: { + start: { column: 8, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [167, 168], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + + range: [159, 168], + loc: { + start: { column: 8, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + ], + kind: 'const', + + range: [153, 169], + loc: { + start: { column: 2, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'await', + + range: [178, 183], + loc: { + start: { column: 8, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [186, 187], + loc: { + start: { column: 16, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + + range: [178, 187], + loc: { + start: { column: 8, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + ], + kind: 'const', + + range: [172, 188], + loc: { + start: { column: 2, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'boolean', + + range: [197, 204], + loc: { + start: { column: 8, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [207, 208], + loc: { + start: { column: 18, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + + range: [197, 208], + loc: { + start: { column: 8, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + ], + kind: 'const', + + range: [191, 209], + loc: { + start: { column: 2, line: 10 }, + end: { column: 20, line: 10 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'constructor', + + range: [218, 229], + loc: { + start: { column: 8, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [232, 233], + loc: { + start: { column: 22, line: 11 }, + end: { column: 23, line: 11 }, + }, + }, + + range: [218, 233], + loc: { + start: { column: 8, line: 11 }, + end: { column: 23, line: 11 }, + }, + }, + ], + kind: 'const', + + range: [212, 234], + loc: { + start: { column: 2, line: 11 }, + end: { column: 24, line: 11 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'declare', + + range: [243, 250], + loc: { + start: { column: 8, line: 12 }, + end: { column: 15, line: 12 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [253, 254], + loc: { + start: { column: 18, line: 12 }, + end: { column: 19, line: 12 }, + }, + }, + + range: [243, 254], + loc: { + start: { column: 8, line: 12 }, + end: { column: 19, line: 12 }, + }, + }, + ], + kind: 'const', + + range: [237, 255], + loc: { + start: { column: 2, line: 12 }, + end: { column: 20, line: 12 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'get', + + range: [264, 267], + loc: { + start: { column: 8, line: 13 }, + end: { column: 11, line: 13 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [270, 271], + loc: { + start: { column: 14, line: 13 }, + end: { column: 15, line: 13 }, + }, + }, + + range: [264, 271], + loc: { + start: { column: 8, line: 13 }, + end: { column: 15, line: 13 }, + }, + }, + ], + kind: 'const', + + range: [258, 272], + loc: { + start: { column: 2, line: 13 }, + end: { column: 16, line: 13 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'infer', + + range: [281, 286], + loc: { + start: { column: 8, line: 14 }, + end: { column: 13, line: 14 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [289, 290], + loc: { + start: { column: 16, line: 14 }, + end: { column: 17, line: 14 }, + }, + }, + + range: [281, 290], + loc: { + start: { column: 8, line: 14 }, + end: { column: 17, line: 14 }, + }, + }, + ], + kind: 'const', + + range: [275, 291], + loc: { + start: { column: 2, line: 14 }, + end: { column: 18, line: 14 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'is', + + range: [300, 302], + loc: { + start: { column: 8, line: 15 }, + end: { column: 10, line: 15 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [305, 306], + loc: { + start: { column: 13, line: 15 }, + end: { column: 14, line: 15 }, + }, + }, + + range: [300, 306], + loc: { + start: { column: 8, line: 15 }, + end: { column: 14, line: 15 }, + }, + }, + ], + kind: 'const', + + range: [294, 307], + loc: { + start: { column: 2, line: 15 }, + end: { column: 15, line: 15 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'keyof', + + range: [316, 321], + loc: { + start: { column: 8, line: 16 }, + end: { column: 13, line: 16 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [324, 325], + loc: { + start: { column: 16, line: 16 }, + end: { column: 17, line: 16 }, + }, + }, + + range: [316, 325], + loc: { + start: { column: 8, line: 16 }, + end: { column: 17, line: 16 }, + }, + }, + ], + kind: 'const', + + range: [310, 326], + loc: { + start: { column: 2, line: 16 }, + end: { column: 18, line: 16 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'module', + + range: [335, 341], + loc: { + start: { column: 8, line: 17 }, + end: { column: 14, line: 17 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [344, 345], + loc: { + start: { column: 17, line: 17 }, + end: { column: 18, line: 17 }, + }, + }, + + range: [335, 345], + loc: { + start: { column: 8, line: 17 }, + end: { column: 18, line: 17 }, + }, + }, + ], + kind: 'const', + + range: [329, 346], + loc: { + start: { column: 2, line: 17 }, + end: { column: 19, line: 17 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'namespace', + + range: [355, 364], + loc: { + start: { column: 8, line: 18 }, + end: { column: 17, line: 18 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [367, 368], + loc: { + start: { column: 20, line: 18 }, + end: { column: 21, line: 18 }, + }, + }, + + range: [355, 368], + loc: { + start: { column: 8, line: 18 }, + end: { column: 21, line: 18 }, + }, + }, + ], + kind: 'const', + + range: [349, 369], + loc: { + start: { column: 2, line: 18 }, + end: { column: 22, line: 18 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'never', + + range: [378, 383], + loc: { + start: { column: 8, line: 19 }, + end: { column: 13, line: 19 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [386, 387], + loc: { + start: { column: 16, line: 19 }, + end: { column: 17, line: 19 }, + }, + }, + + range: [378, 387], + loc: { + start: { column: 8, line: 19 }, + end: { column: 17, line: 19 }, + }, + }, + ], + kind: 'const', + + range: [372, 388], + loc: { + start: { column: 2, line: 19 }, + end: { column: 18, line: 19 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'readonly', + + range: [397, 405], + loc: { + start: { column: 8, line: 20 }, + end: { column: 16, line: 20 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [408, 409], + loc: { + start: { column: 19, line: 20 }, + end: { column: 20, line: 20 }, + }, + }, + + range: [397, 409], + loc: { + start: { column: 8, line: 20 }, + end: { column: 20, line: 20 }, + }, + }, + ], + kind: 'const', + + range: [391, 410], + loc: { + start: { column: 2, line: 20 }, + end: { column: 21, line: 20 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'require', + + range: [419, 426], + loc: { + start: { column: 8, line: 21 }, + end: { column: 15, line: 21 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [429, 430], + loc: { + start: { column: 18, line: 21 }, + end: { column: 19, line: 21 }, + }, + }, + + range: [419, 430], + loc: { + start: { column: 8, line: 21 }, + end: { column: 19, line: 21 }, + }, + }, + ], + kind: 'const', + + range: [413, 431], + loc: { + start: { column: 2, line: 21 }, + end: { column: 20, line: 21 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'number', + + range: [440, 446], + loc: { + start: { column: 8, line: 22 }, + end: { column: 14, line: 22 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [449, 450], + loc: { + start: { column: 17, line: 22 }, + end: { column: 18, line: 22 }, + }, + }, + + range: [440, 450], + loc: { + start: { column: 8, line: 22 }, + end: { column: 18, line: 22 }, + }, + }, + ], + kind: 'const', + + range: [434, 451], + loc: { + start: { column: 2, line: 22 }, + end: { column: 19, line: 22 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'object', + + range: [460, 466], + loc: { + start: { column: 8, line: 23 }, + end: { column: 14, line: 23 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [469, 470], + loc: { + start: { column: 17, line: 23 }, + end: { column: 18, line: 23 }, + }, + }, + + range: [460, 470], + loc: { + start: { column: 8, line: 23 }, + end: { column: 18, line: 23 }, + }, + }, + ], + kind: 'const', + + range: [454, 471], + loc: { + start: { column: 2, line: 23 }, + end: { column: 19, line: 23 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'set', + + range: [480, 483], + loc: { + start: { column: 8, line: 24 }, + end: { column: 11, line: 24 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [486, 487], + loc: { + start: { column: 14, line: 24 }, + end: { column: 15, line: 24 }, + }, + }, + + range: [480, 487], + loc: { + start: { column: 8, line: 24 }, + end: { column: 15, line: 24 }, + }, + }, + ], + kind: 'const', + + range: [474, 488], + loc: { + start: { column: 2, line: 24 }, + end: { column: 16, line: 24 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'string', + + range: [497, 503], + loc: { + start: { column: 8, line: 25 }, + end: { column: 14, line: 25 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [506, 507], + loc: { + start: { column: 17, line: 25 }, + end: { column: 18, line: 25 }, + }, + }, + + range: [497, 507], + loc: { + start: { column: 8, line: 25 }, + end: { column: 18, line: 25 }, + }, + }, + ], + kind: 'const', + + range: [491, 508], + loc: { + start: { column: 2, line: 25 }, + end: { column: 19, line: 25 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'symbol', + + range: [517, 523], + loc: { + start: { column: 8, line: 26 }, + end: { column: 14, line: 26 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [526, 527], + loc: { + start: { column: 17, line: 26 }, + end: { column: 18, line: 26 }, + }, + }, + + range: [517, 527], + loc: { + start: { column: 8, line: 26 }, + end: { column: 18, line: 26 }, + }, + }, + ], + kind: 'const', + + range: [511, 528], + loc: { + start: { column: 2, line: 26 }, + end: { column: 19, line: 26 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'type', + + range: [537, 541], + loc: { + start: { column: 8, line: 27 }, + end: { column: 12, line: 27 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [544, 545], + loc: { + start: { column: 15, line: 27 }, + end: { column: 16, line: 27 }, + }, + }, + + range: [537, 545], + loc: { + start: { column: 8, line: 27 }, + end: { column: 16, line: 27 }, + }, + }, + ], + kind: 'const', + + range: [531, 546], + loc: { + start: { column: 2, line: 27 }, + end: { column: 17, line: 27 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'undefined', + + range: [555, 564], + loc: { + start: { column: 8, line: 28 }, + end: { column: 17, line: 28 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [567, 568], + loc: { + start: { column: 20, line: 28 }, + end: { column: 21, line: 28 }, + }, + }, + + range: [555, 568], + loc: { + start: { column: 8, line: 28 }, + end: { column: 21, line: 28 }, + }, + }, + ], + kind: 'const', + + range: [549, 569], + loc: { + start: { column: 2, line: 28 }, + end: { column: 22, line: 28 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'unique', + + range: [578, 584], + loc: { + start: { column: 8, line: 29 }, + end: { column: 14, line: 29 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [587, 588], + loc: { + start: { column: 17, line: 29 }, + end: { column: 18, line: 29 }, + }, + }, + + range: [578, 588], + loc: { + start: { column: 8, line: 29 }, + end: { column: 18, line: 29 }, + }, + }, + ], + kind: 'const', + + range: [572, 589], + loc: { + start: { column: 2, line: 29 }, + end: { column: 19, line: 29 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'unknown', + + range: [598, 605], + loc: { + start: { column: 8, line: 30 }, + end: { column: 15, line: 30 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [608, 609], + loc: { + start: { column: 18, line: 30 }, + end: { column: 19, line: 30 }, + }, + }, + + range: [598, 609], + loc: { + start: { column: 8, line: 30 }, + end: { column: 19, line: 30 }, + }, + }, + ], + kind: 'const', + + range: [592, 610], + loc: { + start: { column: 2, line: 30 }, + end: { column: 20, line: 30 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'from', + + range: [619, 623], + loc: { + start: { column: 8, line: 31 }, + end: { column: 12, line: 31 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [626, 627], + loc: { + start: { column: 15, line: 31 }, + end: { column: 16, line: 31 }, + }, + }, + + range: [619, 627], + loc: { + start: { column: 8, line: 31 }, + end: { column: 16, line: 31 }, + }, + }, + ], + kind: 'const', + + range: [613, 628], + loc: { + start: { column: 2, line: 31 }, + end: { column: 17, line: 31 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'global', + + range: [637, 643], + loc: { + start: { column: 8, line: 32 }, + end: { column: 14, line: 32 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [646, 647], + loc: { + start: { column: 17, line: 32 }, + end: { column: 18, line: 32 }, + }, + }, + + range: [637, 647], + loc: { + start: { column: 8, line: 32 }, + end: { column: 18, line: 32 }, + }, + }, + ], + kind: 'const', + + range: [631, 648], + loc: { + start: { column: 2, line: 32 }, + end: { column: 19, line: 32 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'bigint', + + range: [657, 663], + loc: { + start: { column: 8, line: 33 }, + end: { column: 14, line: 33 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [666, 667], + loc: { + start: { column: 17, line: 33 }, + end: { column: 18, line: 33 }, + }, + }, + + range: [657, 667], + loc: { + start: { column: 8, line: 33 }, + end: { column: 18, line: 33 }, + }, + }, + ], + kind: 'const', + + range: [651, 668], + loc: { + start: { column: 2, line: 33 }, + end: { column: 19, line: 33 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'of', + + range: [677, 679], + loc: { + start: { column: 8, line: 34 }, + end: { column: 10, line: 34 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [682, 683], + loc: { + start: { column: 13, line: 34 }, + end: { column: 14, line: 34 }, + }, + }, + + range: [677, 683], + loc: { + start: { column: 8, line: 34 }, + end: { column: 14, line: 34 }, + }, + }, + ], + kind: 'const', + + range: [671, 684], + loc: { + start: { column: 2, line: 34 }, + end: { column: 15, line: 34 }, + }, + }, + ], + + range: [73, 686], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 35 }, + }, + }, + ImportDeclaration { + type: 'ImportDeclaration', + assertions: Array [], + importKind: 'value', + source: Literal { + type: 'Literal', + raw: '\\\\'fake-module\\\\'', + value: 'fake-module', + + range: [1004, 1017], + loc: { + start: { column: 7, line: 69 }, + end: { column: 20, line: 69 }, + }, + }, + specifiers: Array [ + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'abstract', + + range: [699, 707], + loc: { + start: { column: 2, line: 38 }, + end: { column: 10, line: 38 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'abstract', + + range: [699, 707], + loc: { + start: { column: 2, line: 38 }, + end: { column: 10, line: 38 }, + }, + }, + + range: [699, 707], + loc: { + start: { column: 2, line: 38 }, + end: { column: 10, line: 38 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'as', + + range: [711, 713], + loc: { + start: { column: 2, line: 39 }, + end: { column: 4, line: 39 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'as', + + range: [711, 713], + loc: { + start: { column: 2, line: 39 }, + end: { column: 4, line: 39 }, + }, + }, + + range: [711, 713], + loc: { + start: { column: 2, line: 39 }, + end: { column: 4, line: 39 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'asserts', + + range: [717, 724], + loc: { + start: { column: 2, line: 40 }, + end: { column: 9, line: 40 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'asserts', + + range: [717, 724], + loc: { + start: { column: 2, line: 40 }, + end: { column: 9, line: 40 }, + }, + }, + + range: [717, 724], + loc: { + start: { column: 2, line: 40 }, + end: { column: 9, line: 40 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'any', + + range: [728, 731], + loc: { + start: { column: 2, line: 41 }, + end: { column: 5, line: 41 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'any', + + range: [728, 731], + loc: { + start: { column: 2, line: 41 }, + end: { column: 5, line: 41 }, + }, + }, + + range: [728, 731], + loc: { + start: { column: 2, line: 41 }, + end: { column: 5, line: 41 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'async', + + range: [735, 740], + loc: { + start: { column: 2, line: 42 }, + end: { column: 7, line: 42 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'async', + + range: [735, 740], + loc: { + start: { column: 2, line: 42 }, + end: { column: 7, line: 42 }, + }, + }, + + range: [735, 740], + loc: { + start: { column: 2, line: 42 }, + end: { column: 7, line: 42 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'await', + + range: [744, 749], + loc: { + start: { column: 2, line: 43 }, + end: { column: 7, line: 43 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'await', + + range: [744, 749], + loc: { + start: { column: 2, line: 43 }, + end: { column: 7, line: 43 }, + }, + }, + + range: [744, 749], + loc: { + start: { column: 2, line: 43 }, + end: { column: 7, line: 43 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'boolean', + + range: [753, 760], + loc: { + start: { column: 2, line: 44 }, + end: { column: 9, line: 44 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'boolean', + + range: [753, 760], + loc: { + start: { column: 2, line: 44 }, + end: { column: 9, line: 44 }, + }, + }, + + range: [753, 760], + loc: { + start: { column: 2, line: 44 }, + end: { column: 9, line: 44 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'constructor', + + range: [764, 775], + loc: { + start: { column: 2, line: 45 }, + end: { column: 13, line: 45 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'constructor', + + range: [764, 775], + loc: { + start: { column: 2, line: 45 }, + end: { column: 13, line: 45 }, + }, + }, + + range: [764, 775], + loc: { + start: { column: 2, line: 45 }, + end: { column: 13, line: 45 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'declare', + + range: [779, 786], + loc: { + start: { column: 2, line: 46 }, + end: { column: 9, line: 46 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'declare', + + range: [779, 786], + loc: { + start: { column: 2, line: 46 }, + end: { column: 9, line: 46 }, + }, + }, + + range: [779, 786], + loc: { + start: { column: 2, line: 46 }, + end: { column: 9, line: 46 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'get', + + range: [790, 793], + loc: { + start: { column: 2, line: 47 }, + end: { column: 5, line: 47 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'get', + + range: [790, 793], + loc: { + start: { column: 2, line: 47 }, + end: { column: 5, line: 47 }, + }, + }, + + range: [790, 793], + loc: { + start: { column: 2, line: 47 }, + end: { column: 5, line: 47 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'infer', + + range: [797, 802], + loc: { + start: { column: 2, line: 48 }, + end: { column: 7, line: 48 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'infer', + + range: [797, 802], + loc: { + start: { column: 2, line: 48 }, + end: { column: 7, line: 48 }, + }, + }, + + range: [797, 802], + loc: { + start: { column: 2, line: 48 }, + end: { column: 7, line: 48 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'is', + + range: [806, 808], + loc: { + start: { column: 2, line: 49 }, + end: { column: 4, line: 49 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'is', + + range: [806, 808], + loc: { + start: { column: 2, line: 49 }, + end: { column: 4, line: 49 }, + }, + }, + + range: [806, 808], + loc: { + start: { column: 2, line: 49 }, + end: { column: 4, line: 49 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'keyof', + + range: [812, 817], + loc: { + start: { column: 2, line: 50 }, + end: { column: 7, line: 50 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'keyof', + + range: [812, 817], + loc: { + start: { column: 2, line: 50 }, + end: { column: 7, line: 50 }, + }, + }, + + range: [812, 817], + loc: { + start: { column: 2, line: 50 }, + end: { column: 7, line: 50 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'module', + + range: [821, 827], + loc: { + start: { column: 2, line: 51 }, + end: { column: 8, line: 51 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'module', + + range: [821, 827], + loc: { + start: { column: 2, line: 51 }, + end: { column: 8, line: 51 }, + }, + }, + + range: [821, 827], + loc: { + start: { column: 2, line: 51 }, + end: { column: 8, line: 51 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'namespace', + + range: [831, 840], + loc: { + start: { column: 2, line: 52 }, + end: { column: 11, line: 52 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'namespace', + + range: [831, 840], + loc: { + start: { column: 2, line: 52 }, + end: { column: 11, line: 52 }, + }, + }, + + range: [831, 840], + loc: { + start: { column: 2, line: 52 }, + end: { column: 11, line: 52 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'never', + + range: [844, 849], + loc: { + start: { column: 2, line: 53 }, + end: { column: 7, line: 53 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'never', + + range: [844, 849], + loc: { + start: { column: 2, line: 53 }, + end: { column: 7, line: 53 }, + }, + }, + + range: [844, 849], + loc: { + start: { column: 2, line: 53 }, + end: { column: 7, line: 53 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'readonly', + + range: [853, 861], + loc: { + start: { column: 2, line: 54 }, + end: { column: 10, line: 54 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'readonly', + + range: [853, 861], + loc: { + start: { column: 2, line: 54 }, + end: { column: 10, line: 54 }, + }, + }, + + range: [853, 861], + loc: { + start: { column: 2, line: 54 }, + end: { column: 10, line: 54 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'require', + + range: [865, 872], + loc: { + start: { column: 2, line: 55 }, + end: { column: 9, line: 55 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'require', + + range: [865, 872], + loc: { + start: { column: 2, line: 55 }, + end: { column: 9, line: 55 }, + }, + }, + + range: [865, 872], + loc: { + start: { column: 2, line: 55 }, + end: { column: 9, line: 55 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'number', + + range: [876, 882], + loc: { + start: { column: 2, line: 56 }, + end: { column: 8, line: 56 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'number', + + range: [876, 882], + loc: { + start: { column: 2, line: 56 }, + end: { column: 8, line: 56 }, + }, + }, + + range: [876, 882], + loc: { + start: { column: 2, line: 56 }, + end: { column: 8, line: 56 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'object', + + range: [886, 892], + loc: { + start: { column: 2, line: 57 }, + end: { column: 8, line: 57 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'object', + + range: [886, 892], + loc: { + start: { column: 2, line: 57 }, + end: { column: 8, line: 57 }, + }, + }, + + range: [886, 892], + loc: { + start: { column: 2, line: 57 }, + end: { column: 8, line: 57 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'set', + + range: [896, 899], + loc: { + start: { column: 2, line: 58 }, + end: { column: 5, line: 58 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'set', + + range: [896, 899], + loc: { + start: { column: 2, line: 58 }, + end: { column: 5, line: 58 }, + }, + }, + + range: [896, 899], + loc: { + start: { column: 2, line: 58 }, + end: { column: 5, line: 58 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'string', + + range: [903, 909], + loc: { + start: { column: 2, line: 59 }, + end: { column: 8, line: 59 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'string', + + range: [903, 909], + loc: { + start: { column: 2, line: 59 }, + end: { column: 8, line: 59 }, + }, + }, + + range: [903, 909], + loc: { + start: { column: 2, line: 59 }, + end: { column: 8, line: 59 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'symbol', + + range: [913, 919], + loc: { + start: { column: 2, line: 60 }, + end: { column: 8, line: 60 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'symbol', + + range: [913, 919], + loc: { + start: { column: 2, line: 60 }, + end: { column: 8, line: 60 }, + }, + }, + + range: [913, 919], + loc: { + start: { column: 2, line: 60 }, + end: { column: 8, line: 60 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'type', + + range: [923, 927], + loc: { + start: { column: 2, line: 61 }, + end: { column: 6, line: 61 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'type', + + range: [923, 927], + loc: { + start: { column: 2, line: 61 }, + end: { column: 6, line: 61 }, + }, + }, + + range: [923, 927], + loc: { + start: { column: 2, line: 61 }, + end: { column: 6, line: 61 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'undefined', + + range: [931, 940], + loc: { + start: { column: 2, line: 62 }, + end: { column: 11, line: 62 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'undefined', + + range: [931, 940], + loc: { + start: { column: 2, line: 62 }, + end: { column: 11, line: 62 }, + }, + }, + + range: [931, 940], + loc: { + start: { column: 2, line: 62 }, + end: { column: 11, line: 62 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'unique', + + range: [944, 950], + loc: { + start: { column: 2, line: 63 }, + end: { column: 8, line: 63 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'unique', + + range: [944, 950], + loc: { + start: { column: 2, line: 63 }, + end: { column: 8, line: 63 }, + }, + }, + + range: [944, 950], + loc: { + start: { column: 2, line: 63 }, + end: { column: 8, line: 63 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'unknown', + + range: [954, 961], + loc: { + start: { column: 2, line: 64 }, + end: { column: 9, line: 64 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'unknown', + + range: [954, 961], + loc: { + start: { column: 2, line: 64 }, + end: { column: 9, line: 64 }, + }, + }, + + range: [954, 961], + loc: { + start: { column: 2, line: 64 }, + end: { column: 9, line: 64 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'from', + + range: [965, 969], + loc: { + start: { column: 2, line: 65 }, + end: { column: 6, line: 65 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'from', + + range: [965, 969], + loc: { + start: { column: 2, line: 65 }, + end: { column: 6, line: 65 }, + }, + }, + + range: [965, 969], + loc: { + start: { column: 2, line: 65 }, + end: { column: 6, line: 65 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'global', + + range: [973, 979], + loc: { + start: { column: 2, line: 66 }, + end: { column: 8, line: 66 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'global', + + range: [973, 979], + loc: { + start: { column: 2, line: 66 }, + end: { column: 8, line: 66 }, + }, + }, + + range: [973, 979], + loc: { + start: { column: 2, line: 66 }, + end: { column: 8, line: 66 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'bigint', + + range: [983, 989], + loc: { + start: { column: 2, line: 67 }, + end: { column: 8, line: 67 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'bigint', + + range: [983, 989], + loc: { + start: { column: 2, line: 67 }, + end: { column: 8, line: 67 }, + }, + }, + + range: [983, 989], + loc: { + start: { column: 2, line: 67 }, + end: { column: 8, line: 67 }, + }, + }, + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', + name: 'of', + + range: [993, 995], + loc: { + start: { column: 2, line: 68 }, + end: { column: 4, line: 68 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'of', + + range: [993, 995], + loc: { + start: { column: 2, line: 68 }, + end: { column: 4, line: 68 }, + }, + }, + + range: [993, 995], + loc: { + start: { column: 2, line: 68 }, + end: { column: 4, line: 68 }, + }, + }, + ], + + range: [688, 1018], + loc: { + start: { column: 0, line: 37 }, + end: { column: 21, line: 69 }, + }, + }, + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [], + + range: [1032, 1034], + loc: { + start: { column: 12, line: 71 }, + end: { column: 14, line: 71 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'X', + + range: [1030, 1031], + loc: { + start: { column: 10, line: 71 }, + end: { column: 11, line: 71 }, + }, + }, + + range: [1020, 1034], + loc: { + start: { column: 0, line: 71 }, + end: { column: 14, line: 71 }, + }, + }, + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'a', + + range: [1067, 1068], + loc: { + start: { column: 9, line: 73 }, + end: { column: 10, line: 73 }, + }, + }, + kind: 'method', +- override: false, + static: true, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [1071, 1073], + loc: { + start: { column: 13, line: 73 }, + end: { column: 15, line: 73 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [1068, 1073], + loc: { + start: { column: 10, line: 73 }, + end: { column: 15, line: 73 }, + }, + }, + + range: [1060, 1073], + loc: { + start: { column: 2, line: 73 }, + end: { column: 15, line: 73 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + accessibility: 'private', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'b', + + range: [1084, 1085], + loc: { + start: { column: 10, line: 74 }, + end: { column: 11, line: 74 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [1088, 1090], + loc: { + start: { column: 14, line: 74 }, + end: { column: 16, line: 74 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [1085, 1090], + loc: { + start: { column: 11, line: 74 }, + end: { column: 16, line: 74 }, + }, + }, + + range: [1076, 1090], + loc: { + start: { column: 2, line: 74 }, + end: { column: 16, line: 74 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + accessibility: 'public', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'c', + + range: [1100, 1101], + loc: { + start: { column: 9, line: 75 }, + end: { column: 10, line: 75 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [1104, 1106], + loc: { + start: { column: 13, line: 75 }, + end: { column: 15, line: 75 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [1101, 1106], + loc: { + start: { column: 10, line: 75 }, + end: { column: 15, line: 75 }, + }, + }, + + range: [1093, 1106], + loc: { + start: { column: 2, line: 75 }, + end: { column: 15, line: 75 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + accessibility: 'protected', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'd', + + range: [1120, 1121], + loc: { + start: { column: 13, line: 76 }, + end: { column: 14, line: 76 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'x', + + range: [1134, 1135], + loc: { + start: { column: 8, line: 77 }, + end: { column: 9, line: 77 }, + }, + }, + init: YieldExpression { + type: 'YieldExpression', + argument: null, + delegate: false, + + range: [1138, 1143], + loc: { + start: { column: 12, line: 77 }, + end: { column: 17, line: 77 }, + }, + }, + + range: [1134, 1143], + loc: { + start: { column: 8, line: 77 }, + end: { column: 17, line: 77 }, + }, + }, + ], + kind: 'let', + + range: [1130, 1144], + loc: { + start: { column: 4, line: 77 }, + end: { column: 18, line: 77 }, + }, + }, + ], + + range: [1124, 1148], + loc: { + start: { column: 17, line: 76 }, + end: { column: 3, line: 78 }, + }, + }, + expression: false, + generator: true, + id: null, + params: Array [], + + range: [1121, 1148], + loc: { + start: { column: 14, line: 76 }, + end: { column: 3, line: 78 }, + }, + }, + + range: [1109, 1148], + loc: { + start: { column: 2, line: 76 }, + end: { column: 3, line: 78 }, + }, + }, + ], + + range: [1056, 1150], + loc: { + start: { column: 21, line: 72 }, + end: { column: 1, line: 79 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'C', + + range: [1041, 1042], + loc: { + start: { column: 6, line: 72 }, + end: { column: 7, line: 72 }, + }, + }, + implements: Array [ +- TSClassImplements { +- type: 'TSClassImplements', ++ TSExpressionWithTypeArguments { ++ type: 'TSExpressionWithTypeArguments', + expression: Identifier { + type: 'Identifier', + name: 'X', + + range: [1054, 1055], + loc: { + start: { column: 19, line: 72 }, + end: { column: 20, line: 72 }, + }, + }, + + range: [1054, 1055], + loc: { + start: { column: 19, line: 72 }, + end: { column: 20, line: 72 }, + }, + }, + ], + superClass: null, + + range: [1035, 1150], + loc: { + start: { column: 0, line: 72 }, + end: { column: 1, line: 79 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [73, 1151], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 80 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..230728cbecdd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,2674 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Punctuator { + type: 'Punctuator', + value: '{', + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [77, 82], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'abstract', + + range: [83, 91], + loc: { + start: { column: 8, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [92, 93], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [94, 95], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [95, 96], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [99, 104], + loc: { + start: { column: 2, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'as', + + range: [105, 107], + loc: { + start: { column: 8, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [108, 109], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [110, 111], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [111, 112], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [115, 120], + loc: { + start: { column: 2, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'asserts', + + range: [121, 128], + loc: { + start: { column: 8, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [129, 130], + loc: { + start: { column: 16, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [131, 132], + loc: { + start: { column: 18, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [132, 133], + loc: { + start: { column: 19, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [136, 141], + loc: { + start: { column: 2, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'any', + + range: [142, 145], + loc: { + start: { column: 8, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [146, 147], + loc: { + start: { column: 12, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [148, 149], + loc: { + start: { column: 14, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [149, 150], + loc: { + start: { column: 15, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [153, 158], + loc: { + start: { column: 2, line: 8 }, + end: { column: 7, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'async', + + range: [159, 164], + loc: { + start: { column: 8, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [165, 166], + loc: { + start: { column: 14, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [167, 168], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [168, 169], + loc: { + start: { column: 17, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [172, 177], + loc: { + start: { column: 2, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'await', + + range: [178, 183], + loc: { + start: { column: 8, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [184, 185], + loc: { + start: { column: 14, line: 9 }, + end: { column: 15, line: 9 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [186, 187], + loc: { + start: { column: 16, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [187, 188], + loc: { + start: { column: 17, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [191, 196], + loc: { + start: { column: 2, line: 10 }, + end: { column: 7, line: 10 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'boolean', + + range: [197, 204], + loc: { + start: { column: 8, line: 10 }, + end: { column: 15, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [205, 206], + loc: { + start: { column: 16, line: 10 }, + end: { column: 17, line: 10 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [207, 208], + loc: { + start: { column: 18, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [208, 209], + loc: { + start: { column: 19, line: 10 }, + end: { column: 20, line: 10 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [212, 217], + loc: { + start: { column: 2, line: 11 }, + end: { column: 7, line: 11 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'constructor', + + range: [218, 229], + loc: { + start: { column: 8, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [230, 231], + loc: { + start: { column: 20, line: 11 }, + end: { column: 21, line: 11 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [232, 233], + loc: { + start: { column: 22, line: 11 }, + end: { column: 23, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [233, 234], + loc: { + start: { column: 23, line: 11 }, + end: { column: 24, line: 11 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [237, 242], + loc: { + start: { column: 2, line: 12 }, + end: { column: 7, line: 12 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'declare', + + range: [243, 250], + loc: { + start: { column: 8, line: 12 }, + end: { column: 15, line: 12 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [251, 252], + loc: { + start: { column: 16, line: 12 }, + end: { column: 17, line: 12 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [253, 254], + loc: { + start: { column: 18, line: 12 }, + end: { column: 19, line: 12 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [254, 255], + loc: { + start: { column: 19, line: 12 }, + end: { column: 20, line: 12 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [258, 263], + loc: { + start: { column: 2, line: 13 }, + end: { column: 7, line: 13 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'get', + + range: [264, 267], + loc: { + start: { column: 8, line: 13 }, + end: { column: 11, line: 13 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [268, 269], + loc: { + start: { column: 12, line: 13 }, + end: { column: 13, line: 13 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [270, 271], + loc: { + start: { column: 14, line: 13 }, + end: { column: 15, line: 13 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [271, 272], + loc: { + start: { column: 15, line: 13 }, + end: { column: 16, line: 13 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [275, 280], + loc: { + start: { column: 2, line: 14 }, + end: { column: 7, line: 14 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'infer', + + range: [281, 286], + loc: { + start: { column: 8, line: 14 }, + end: { column: 13, line: 14 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [287, 288], + loc: { + start: { column: 14, line: 14 }, + end: { column: 15, line: 14 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [289, 290], + loc: { + start: { column: 16, line: 14 }, + end: { column: 17, line: 14 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [290, 291], + loc: { + start: { column: 17, line: 14 }, + end: { column: 18, line: 14 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [294, 299], + loc: { + start: { column: 2, line: 15 }, + end: { column: 7, line: 15 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'is', + + range: [300, 302], + loc: { + start: { column: 8, line: 15 }, + end: { column: 10, line: 15 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [303, 304], + loc: { + start: { column: 11, line: 15 }, + end: { column: 12, line: 15 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [305, 306], + loc: { + start: { column: 13, line: 15 }, + end: { column: 14, line: 15 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [306, 307], + loc: { + start: { column: 14, line: 15 }, + end: { column: 15, line: 15 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [310, 315], + loc: { + start: { column: 2, line: 16 }, + end: { column: 7, line: 16 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'keyof', + + range: [316, 321], + loc: { + start: { column: 8, line: 16 }, + end: { column: 13, line: 16 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [322, 323], + loc: { + start: { column: 14, line: 16 }, + end: { column: 15, line: 16 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [324, 325], + loc: { + start: { column: 16, line: 16 }, + end: { column: 17, line: 16 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [325, 326], + loc: { + start: { column: 17, line: 16 }, + end: { column: 18, line: 16 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [329, 334], + loc: { + start: { column: 2, line: 17 }, + end: { column: 7, line: 17 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'module', + + range: [335, 341], + loc: { + start: { column: 8, line: 17 }, + end: { column: 14, line: 17 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [342, 343], + loc: { + start: { column: 15, line: 17 }, + end: { column: 16, line: 17 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [344, 345], + loc: { + start: { column: 17, line: 17 }, + end: { column: 18, line: 17 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [345, 346], + loc: { + start: { column: 18, line: 17 }, + end: { column: 19, line: 17 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [349, 354], + loc: { + start: { column: 2, line: 18 }, + end: { column: 7, line: 18 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'namespace', + + range: [355, 364], + loc: { + start: { column: 8, line: 18 }, + end: { column: 17, line: 18 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [365, 366], + loc: { + start: { column: 18, line: 18 }, + end: { column: 19, line: 18 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [367, 368], + loc: { + start: { column: 20, line: 18 }, + end: { column: 21, line: 18 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [368, 369], + loc: { + start: { column: 21, line: 18 }, + end: { column: 22, line: 18 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [372, 377], + loc: { + start: { column: 2, line: 19 }, + end: { column: 7, line: 19 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'never', + + range: [378, 383], + loc: { + start: { column: 8, line: 19 }, + end: { column: 13, line: 19 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [384, 385], + loc: { + start: { column: 14, line: 19 }, + end: { column: 15, line: 19 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [386, 387], + loc: { + start: { column: 16, line: 19 }, + end: { column: 17, line: 19 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [387, 388], + loc: { + start: { column: 17, line: 19 }, + end: { column: 18, line: 19 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [391, 396], + loc: { + start: { column: 2, line: 20 }, + end: { column: 7, line: 20 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'readonly', + + range: [397, 405], + loc: { + start: { column: 8, line: 20 }, + end: { column: 16, line: 20 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [406, 407], + loc: { + start: { column: 17, line: 20 }, + end: { column: 18, line: 20 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [408, 409], + loc: { + start: { column: 19, line: 20 }, + end: { column: 20, line: 20 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [409, 410], + loc: { + start: { column: 20, line: 20 }, + end: { column: 21, line: 20 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [413, 418], + loc: { + start: { column: 2, line: 21 }, + end: { column: 7, line: 21 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'require', + + range: [419, 426], + loc: { + start: { column: 8, line: 21 }, + end: { column: 15, line: 21 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [427, 428], + loc: { + start: { column: 16, line: 21 }, + end: { column: 17, line: 21 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [429, 430], + loc: { + start: { column: 18, line: 21 }, + end: { column: 19, line: 21 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [430, 431], + loc: { + start: { column: 19, line: 21 }, + end: { column: 20, line: 21 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [434, 439], + loc: { + start: { column: 2, line: 22 }, + end: { column: 7, line: 22 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [440, 446], + loc: { + start: { column: 8, line: 22 }, + end: { column: 14, line: 22 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [447, 448], + loc: { + start: { column: 15, line: 22 }, + end: { column: 16, line: 22 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [449, 450], + loc: { + start: { column: 17, line: 22 }, + end: { column: 18, line: 22 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [450, 451], + loc: { + start: { column: 18, line: 22 }, + end: { column: 19, line: 22 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [454, 459], + loc: { + start: { column: 2, line: 23 }, + end: { column: 7, line: 23 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'object', + + range: [460, 466], + loc: { + start: { column: 8, line: 23 }, + end: { column: 14, line: 23 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [467, 468], + loc: { + start: { column: 15, line: 23 }, + end: { column: 16, line: 23 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [469, 470], + loc: { + start: { column: 17, line: 23 }, + end: { column: 18, line: 23 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [470, 471], + loc: { + start: { column: 18, line: 23 }, + end: { column: 19, line: 23 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [474, 479], + loc: { + start: { column: 2, line: 24 }, + end: { column: 7, line: 24 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'set', + + range: [480, 483], + loc: { + start: { column: 8, line: 24 }, + end: { column: 11, line: 24 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [484, 485], + loc: { + start: { column: 12, line: 24 }, + end: { column: 13, line: 24 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [486, 487], + loc: { + start: { column: 14, line: 24 }, + end: { column: 15, line: 24 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [487, 488], + loc: { + start: { column: 15, line: 24 }, + end: { column: 16, line: 24 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [491, 496], + loc: { + start: { column: 2, line: 25 }, + end: { column: 7, line: 25 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [497, 503], + loc: { + start: { column: 8, line: 25 }, + end: { column: 14, line: 25 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [504, 505], + loc: { + start: { column: 15, line: 25 }, + end: { column: 16, line: 25 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [506, 507], + loc: { + start: { column: 17, line: 25 }, + end: { column: 18, line: 25 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [507, 508], + loc: { + start: { column: 18, line: 25 }, + end: { column: 19, line: 25 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [511, 516], + loc: { + start: { column: 2, line: 26 }, + end: { column: 7, line: 26 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'symbol', + + range: [517, 523], + loc: { + start: { column: 8, line: 26 }, + end: { column: 14, line: 26 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [524, 525], + loc: { + start: { column: 15, line: 26 }, + end: { column: 16, line: 26 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [526, 527], + loc: { + start: { column: 17, line: 26 }, + end: { column: 18, line: 26 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [527, 528], + loc: { + start: { column: 18, line: 26 }, + end: { column: 19, line: 26 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [531, 536], + loc: { + start: { column: 2, line: 27 }, + end: { column: 7, line: 27 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'type', + + range: [537, 541], + loc: { + start: { column: 8, line: 27 }, + end: { column: 12, line: 27 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [542, 543], + loc: { + start: { column: 13, line: 27 }, + end: { column: 14, line: 27 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [544, 545], + loc: { + start: { column: 15, line: 27 }, + end: { column: 16, line: 27 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [545, 546], + loc: { + start: { column: 16, line: 27 }, + end: { column: 17, line: 27 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [549, 554], + loc: { + start: { column: 2, line: 28 }, + end: { column: 7, line: 28 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'undefined', + + range: [555, 564], + loc: { + start: { column: 8, line: 28 }, + end: { column: 17, line: 28 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [565, 566], + loc: { + start: { column: 18, line: 28 }, + end: { column: 19, line: 28 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [567, 568], + loc: { + start: { column: 20, line: 28 }, + end: { column: 21, line: 28 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [568, 569], + loc: { + start: { column: 21, line: 28 }, + end: { column: 22, line: 28 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [572, 577], + loc: { + start: { column: 2, line: 29 }, + end: { column: 7, line: 29 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'unique', + + range: [578, 584], + loc: { + start: { column: 8, line: 29 }, + end: { column: 14, line: 29 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [585, 586], + loc: { + start: { column: 15, line: 29 }, + end: { column: 16, line: 29 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [587, 588], + loc: { + start: { column: 17, line: 29 }, + end: { column: 18, line: 29 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [588, 589], + loc: { + start: { column: 18, line: 29 }, + end: { column: 19, line: 29 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [592, 597], + loc: { + start: { column: 2, line: 30 }, + end: { column: 7, line: 30 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'unknown', + + range: [598, 605], + loc: { + start: { column: 8, line: 30 }, + end: { column: 15, line: 30 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [606, 607], + loc: { + start: { column: 16, line: 30 }, + end: { column: 17, line: 30 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [608, 609], + loc: { + start: { column: 18, line: 30 }, + end: { column: 19, line: 30 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [609, 610], + loc: { + start: { column: 19, line: 30 }, + end: { column: 20, line: 30 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [613, 618], + loc: { + start: { column: 2, line: 31 }, + end: { column: 7, line: 31 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'from', + + range: [619, 623], + loc: { + start: { column: 8, line: 31 }, + end: { column: 12, line: 31 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [624, 625], + loc: { + start: { column: 13, line: 31 }, + end: { column: 14, line: 31 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [626, 627], + loc: { + start: { column: 15, line: 31 }, + end: { column: 16, line: 31 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [627, 628], + loc: { + start: { column: 16, line: 31 }, + end: { column: 17, line: 31 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [631, 636], + loc: { + start: { column: 2, line: 32 }, + end: { column: 7, line: 32 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'global', + + range: [637, 643], + loc: { + start: { column: 8, line: 32 }, + end: { column: 14, line: 32 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [644, 645], + loc: { + start: { column: 15, line: 32 }, + end: { column: 16, line: 32 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [646, 647], + loc: { + start: { column: 17, line: 32 }, + end: { column: 18, line: 32 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [647, 648], + loc: { + start: { column: 18, line: 32 }, + end: { column: 19, line: 32 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [651, 656], + loc: { + start: { column: 2, line: 33 }, + end: { column: 7, line: 33 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bigint', + + range: [657, 663], + loc: { + start: { column: 8, line: 33 }, + end: { column: 14, line: 33 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [664, 665], + loc: { + start: { column: 15, line: 33 }, + end: { column: 16, line: 33 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [666, 667], + loc: { + start: { column: 17, line: 33 }, + end: { column: 18, line: 33 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [667, 668], + loc: { + start: { column: 18, line: 33 }, + end: { column: 19, line: 33 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [671, 676], + loc: { + start: { column: 2, line: 34 }, + end: { column: 7, line: 34 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'of', + + range: [677, 679], + loc: { + start: { column: 8, line: 34 }, + end: { column: 10, line: 34 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [680, 681], + loc: { + start: { column: 11, line: 34 }, + end: { column: 12, line: 34 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [682, 683], + loc: { + start: { column: 13, line: 34 }, + end: { column: 14, line: 34 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [683, 684], + loc: { + start: { column: 14, line: 34 }, + end: { column: 15, line: 34 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [685, 686], + loc: { + start: { column: 0, line: 35 }, + end: { column: 1, line: 35 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'import', + + range: [688, 694], + loc: { + start: { column: 0, line: 37 }, + end: { column: 6, line: 37 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [695, 696], + loc: { + start: { column: 7, line: 37 }, + end: { column: 8, line: 37 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'abstract', + + range: [699, 707], + loc: { + start: { column: 2, line: 38 }, + end: { column: 10, line: 38 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [707, 708], + loc: { + start: { column: 10, line: 38 }, + end: { column: 11, line: 38 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'as', + + range: [711, 713], + loc: { + start: { column: 2, line: 39 }, + end: { column: 4, line: 39 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [713, 714], + loc: { + start: { column: 4, line: 39 }, + end: { column: 5, line: 39 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'asserts', + + range: [717, 724], + loc: { + start: { column: 2, line: 40 }, + end: { column: 9, line: 40 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [724, 725], + loc: { + start: { column: 9, line: 40 }, + end: { column: 10, line: 40 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'any', + + range: [728, 731], + loc: { + start: { column: 2, line: 41 }, + end: { column: 5, line: 41 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [731, 732], + loc: { + start: { column: 5, line: 41 }, + end: { column: 6, line: 41 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'async', + + range: [735, 740], + loc: { + start: { column: 2, line: 42 }, + end: { column: 7, line: 42 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [740, 741], + loc: { + start: { column: 7, line: 42 }, + end: { column: 8, line: 42 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'await', + + range: [744, 749], + loc: { + start: { column: 2, line: 43 }, + end: { column: 7, line: 43 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [749, 750], + loc: { + start: { column: 7, line: 43 }, + end: { column: 8, line: 43 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'boolean', + + range: [753, 760], + loc: { + start: { column: 2, line: 44 }, + end: { column: 9, line: 44 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [760, 761], + loc: { + start: { column: 9, line: 44 }, + end: { column: 10, line: 44 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'constructor', + + range: [764, 775], + loc: { + start: { column: 2, line: 45 }, + end: { column: 13, line: 45 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [775, 776], + loc: { + start: { column: 13, line: 45 }, + end: { column: 14, line: 45 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'declare', + + range: [779, 786], + loc: { + start: { column: 2, line: 46 }, + end: { column: 9, line: 46 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [786, 787], + loc: { + start: { column: 9, line: 46 }, + end: { column: 10, line: 46 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'get', + + range: [790, 793], + loc: { + start: { column: 2, line: 47 }, + end: { column: 5, line: 47 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [793, 794], + loc: { + start: { column: 5, line: 47 }, + end: { column: 6, line: 47 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'infer', + + range: [797, 802], + loc: { + start: { column: 2, line: 48 }, + end: { column: 7, line: 48 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [802, 803], + loc: { + start: { column: 7, line: 48 }, + end: { column: 8, line: 48 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'is', + + range: [806, 808], + loc: { + start: { column: 2, line: 49 }, + end: { column: 4, line: 49 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [808, 809], + loc: { + start: { column: 4, line: 49 }, + end: { column: 5, line: 49 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'keyof', + + range: [812, 817], + loc: { + start: { column: 2, line: 50 }, + end: { column: 7, line: 50 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [817, 818], + loc: { + start: { column: 7, line: 50 }, + end: { column: 8, line: 50 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'module', + + range: [821, 827], + loc: { + start: { column: 2, line: 51 }, + end: { column: 8, line: 51 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [827, 828], + loc: { + start: { column: 8, line: 51 }, + end: { column: 9, line: 51 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'namespace', + + range: [831, 840], + loc: { + start: { column: 2, line: 52 }, + end: { column: 11, line: 52 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [840, 841], + loc: { + start: { column: 11, line: 52 }, + end: { column: 12, line: 52 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'never', + + range: [844, 849], + loc: { + start: { column: 2, line: 53 }, + end: { column: 7, line: 53 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [849, 850], + loc: { + start: { column: 7, line: 53 }, + end: { column: 8, line: 53 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'readonly', + + range: [853, 861], + loc: { + start: { column: 2, line: 54 }, + end: { column: 10, line: 54 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [861, 862], + loc: { + start: { column: 10, line: 54 }, + end: { column: 11, line: 54 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'require', + + range: [865, 872], + loc: { + start: { column: 2, line: 55 }, + end: { column: 9, line: 55 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [872, 873], + loc: { + start: { column: 9, line: 55 }, + end: { column: 10, line: 55 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [876, 882], + loc: { + start: { column: 2, line: 56 }, + end: { column: 8, line: 56 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [882, 883], + loc: { + start: { column: 8, line: 56 }, + end: { column: 9, line: 56 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'object', + + range: [886, 892], + loc: { + start: { column: 2, line: 57 }, + end: { column: 8, line: 57 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [892, 893], + loc: { + start: { column: 8, line: 57 }, + end: { column: 9, line: 57 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'set', + + range: [896, 899], + loc: { + start: { column: 2, line: 58 }, + end: { column: 5, line: 58 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [899, 900], + loc: { + start: { column: 5, line: 58 }, + end: { column: 6, line: 58 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [903, 909], + loc: { + start: { column: 2, line: 59 }, + end: { column: 8, line: 59 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [909, 910], + loc: { + start: { column: 8, line: 59 }, + end: { column: 9, line: 59 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'symbol', + + range: [913, 919], + loc: { + start: { column: 2, line: 60 }, + end: { column: 8, line: 60 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [919, 920], + loc: { + start: { column: 8, line: 60 }, + end: { column: 9, line: 60 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'type', + + range: [923, 927], + loc: { + start: { column: 2, line: 61 }, + end: { column: 6, line: 61 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [927, 928], + loc: { + start: { column: 6, line: 61 }, + end: { column: 7, line: 61 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'undefined', + + range: [931, 940], + loc: { + start: { column: 2, line: 62 }, + end: { column: 11, line: 62 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [940, 941], + loc: { + start: { column: 11, line: 62 }, + end: { column: 12, line: 62 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'unique', + + range: [944, 950], + loc: { + start: { column: 2, line: 63 }, + end: { column: 8, line: 63 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [950, 951], + loc: { + start: { column: 8, line: 63 }, + end: { column: 9, line: 63 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'unknown', + + range: [954, 961], + loc: { + start: { column: 2, line: 64 }, + end: { column: 9, line: 64 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [961, 962], + loc: { + start: { column: 9, line: 64 }, + end: { column: 10, line: 64 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'from', + + range: [965, 969], + loc: { + start: { column: 2, line: 65 }, + end: { column: 6, line: 65 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [969, 970], + loc: { + start: { column: 6, line: 65 }, + end: { column: 7, line: 65 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'global', + + range: [973, 979], + loc: { + start: { column: 2, line: 66 }, + end: { column: 8, line: 66 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [979, 980], + loc: { + start: { column: 8, line: 66 }, + end: { column: 9, line: 66 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bigint', + + range: [983, 989], + loc: { + start: { column: 2, line: 67 }, + end: { column: 8, line: 67 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [989, 990], + loc: { + start: { column: 8, line: 67 }, + end: { column: 9, line: 67 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'of', + + range: [993, 995], + loc: { + start: { column: 2, line: 68 }, + end: { column: 4, line: 68 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [995, 996], + loc: { + start: { column: 4, line: 68 }, + end: { column: 5, line: 68 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [997, 998], + loc: { + start: { column: 0, line: 69 }, + end: { column: 1, line: 69 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'from', + + range: [999, 1003], + loc: { + start: { column: 2, line: 69 }, + end: { column: 6, line: 69 }, + }, + }, + String { + type: 'String', + value: '\\\\'fake-module\\\\'', + + range: [1004, 1017], + loc: { + start: { column: 7, line: 69 }, + end: { column: 20, line: 69 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [1017, 1018], + loc: { + start: { column: 20, line: 69 }, + end: { column: 21, line: 69 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [1020, 1029], + loc: { + start: { column: 0, line: 71 }, + end: { column: 9, line: 71 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'X', + + range: [1030, 1031], + loc: { + start: { column: 10, line: 71 }, + end: { column: 11, line: 71 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [1032, 1033], + loc: { + start: { column: 12, line: 71 }, + end: { column: 13, line: 71 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [1033, 1034], + loc: { + start: { column: 13, line: 71 }, + end: { column: 14, line: 71 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'class', + + range: [1035, 1040], + loc: { + start: { column: 0, line: 72 }, + end: { column: 5, line: 72 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'C', + + range: [1041, 1042], + loc: { + start: { column: 6, line: 72 }, + end: { column: 7, line: 72 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'implements', + + range: [1043, 1053], + loc: { + start: { column: 8, line: 72 }, + end: { column: 18, line: 72 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'X', + + range: [1054, 1055], + loc: { + start: { column: 19, line: 72 }, + end: { column: 20, line: 72 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [1056, 1057], + loc: { + start: { column: 21, line: 72 }, + end: { column: 22, line: 72 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'static', + + range: [1060, 1066], + loc: { + start: { column: 2, line: 73 }, + end: { column: 8, line: 73 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'a', + + range: [1067, 1068], + loc: { + start: { column: 9, line: 73 }, + end: { column: 10, line: 73 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [1068, 1069], + loc: { + start: { column: 10, line: 73 }, + end: { column: 11, line: 73 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [1069, 1070], + loc: { + start: { column: 11, line: 73 }, + end: { column: 12, line: 73 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [1071, 1072], + loc: { + start: { column: 13, line: 73 }, + end: { column: 14, line: 73 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [1072, 1073], + loc: { + start: { column: 14, line: 73 }, + end: { column: 15, line: 73 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'private', + + range: [1076, 1083], + loc: { + start: { column: 2, line: 74 }, + end: { column: 9, line: 74 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'b', + + range: [1084, 1085], + loc: { + start: { column: 10, line: 74 }, + end: { column: 11, line: 74 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [1085, 1086], + loc: { + start: { column: 11, line: 74 }, + end: { column: 12, line: 74 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [1086, 1087], + loc: { + start: { column: 12, line: 74 }, + end: { column: 13, line: 74 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [1088, 1089], + loc: { + start: { column: 14, line: 74 }, + end: { column: 15, line: 74 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [1089, 1090], + loc: { + start: { column: 15, line: 74 }, + end: { column: 16, line: 74 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [1093, 1099], + loc: { + start: { column: 2, line: 75 }, + end: { column: 8, line: 75 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'c', + + range: [1100, 1101], + loc: { + start: { column: 9, line: 75 }, + end: { column: 10, line: 75 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [1101, 1102], + loc: { + start: { column: 10, line: 75 }, + end: { column: 11, line: 75 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [1102, 1103], + loc: { + start: { column: 11, line: 75 }, + end: { column: 12, line: 75 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [1104, 1105], + loc: { + start: { column: 13, line: 75 }, + end: { column: 14, line: 75 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [1105, 1106], + loc: { + start: { column: 14, line: 75 }, + end: { column: 15, line: 75 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'protected', + + range: [1109, 1118], + loc: { + start: { column: 2, line: 76 }, + end: { column: 11, line: 76 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '*', + + range: [1119, 1120], + loc: { + start: { column: 12, line: 76 }, + end: { column: 13, line: 76 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'd', + + range: [1120, 1121], + loc: { + start: { column: 13, line: 76 }, + end: { column: 14, line: 76 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [1121, 1122], + loc: { + start: { column: 14, line: 76 }, + end: { column: 15, line: 76 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [1122, 1123], + loc: { + start: { column: 15, line: 76 }, + end: { column: 16, line: 76 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [1124, 1125], + loc: { + start: { column: 17, line: 76 }, + end: { column: 18, line: 76 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [1130, 1133], + loc: { + start: { column: 4, line: 77 }, + end: { column: 7, line: 77 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [1134, 1135], + loc: { + start: { column: 8, line: 77 }, + end: { column: 9, line: 77 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [1136, 1137], + loc: { + start: { column: 10, line: 77 }, + end: { column: 11, line: 77 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'yield', + + range: [1138, 1143], + loc: { + start: { column: 12, line: 77 }, + end: { column: 17, line: 77 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [1143, 1144], + loc: { + start: { column: 17, line: 77 }, + end: { column: 18, line: 77 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [1147, 1148], + loc: { + start: { column: 2, line: 78 }, + end: { column: 3, line: 78 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [1149, 1150], + loc: { + start: { column: 0, line: 79 }, + end: { column: 1, line: 79 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/fixture.ts new file mode 100644 index 000000000000..90c0d3127709 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +var nestedArray: Array>>; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..8fdb5eba9043 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics nested-type-arguments TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "nestedArray", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Array", + + range: [90, 95], + loc: { + start: { column: 17, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Array", + + range: [96, 101], + loc: { + start: { column: 23, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Array", + + range: [102, 107], + loc: { + start: { column: 29, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + ], + + range: [107, 115], + loc: { + start: { column: 34, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + + range: [102, 115], + loc: { + start: { column: 29, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + ], + + range: [101, 116], + loc: { + start: { column: 28, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + + range: [96, 116], + loc: { + start: { column: 23, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + ], + + range: [95, 117], + loc: { + start: { column: 22, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [90, 117], + loc: { + start: { column: 17, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [88, 117], + loc: { + start: { column: 15, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [77, 117], + loc: { + start: { column: 4, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + init: null, + + range: [77, 117], + loc: { + start: { column: 4, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + ], + kind: "var", + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 119], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..f3a290017554 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics nested-type-arguments TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "var", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "nestedArray", + + range: [77, 88], + loc: { + start: { column: 4, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Array", + + range: [90, 95], + loc: { + start: { column: 17, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Array", + + range: [96, 101], + loc: { + start: { column: 23, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Array", + + range: [102, 107], + loc: { + start: { column: 29, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..e61622b8eab5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/3-Babel-AST.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics nested-type-arguments Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "nestedArray", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Array", + + range: [90, 95], + loc: { + start: { column: 17, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Array", + + range: [96, 101], + loc: { + start: { column: 23, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Array", + + range: [102, 107], + loc: { + start: { column: 29, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + ], + + range: [107, 115], + loc: { + start: { column: 34, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + + range: [102, 115], + loc: { + start: { column: 29, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + ], + + range: [101, 116], + loc: { + start: { column: 28, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + + range: [96, 116], + loc: { + start: { column: 23, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + ], + + range: [95, 117], + loc: { + start: { column: 22, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [90, 117], + loc: { + start: { column: 17, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [88, 117], + loc: { + start: { column: 15, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [77, 117], + loc: { + start: { column: 4, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + init: null, + + range: [77, 117], + loc: { + start: { column: 4, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + ], + kind: "var", + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 119], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..00e8869613ba --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics nested-type-arguments Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "var", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "nestedArray", + + range: [77, 88], + loc: { + start: { column: 4, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Array", + + range: [90, 95], + loc: { + start: { column: 17, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Array", + + range: [96, 101], + loc: { + start: { column: 23, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Array", + + range: [102, 107], + loc: { + start: { column: 29, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..fff61afeb9b4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics nested-type-arguments AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..9df8dcbaa419 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics nested-type-arguments AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/fixture.ts new file mode 100644 index 000000000000..5f7012c43883 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/fixture.ts @@ -0,0 +1,4 @@ +// TODO: This fixture might be too large, and if so should be split up. + +var x: X; +Observable.empty(); diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..8fcc5c1ce1fa --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,167 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics never-type-param TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "X", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSNeverKeyword { + type: "TSNeverKeyword", + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ], + + range: [81, 88], + loc: { + start: { column: 8, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [80, 88], + loc: { + start: { column: 7, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [78, 88], + loc: { + start: { column: 5, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [77, 88], + loc: { + start: { column: 4, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + init: null, + + range: [77, 88], + loc: { + start: { column: 4, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + kind: "var", + + range: [73, 89], + loc: { + start: { column: 0, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "Observable", + + range: [90, 100], + loc: { + start: { column: 0, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "empty", + + range: [101, 106], + loc: { + start: { column: 11, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [90, 106], + loc: { + start: { column: 0, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + optional: false, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSNeverKeyword { + type: "TSNeverKeyword", + + range: [107, 112], + loc: { + start: { column: 17, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + ], + + range: [106, 113], + loc: { + start: { column: 16, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [90, 115], + loc: { + start: { column: 0, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [90, 116], + loc: { + start: { column: 0, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 117], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..dfe71090fa13 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics never-type-param TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "var", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "never", + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Observable", + + range: [90, 100], + loc: { + start: { column: 0, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [100, 101], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "empty", + + range: [101, 106], + loc: { + start: { column: 11, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [106, 107], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "never", + + range: [107, 112], + loc: { + start: { column: 17, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [112, 113], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [113, 114], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [114, 115], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [115, 116], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..fd29e7c58369 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/3-Babel-AST.shot @@ -0,0 +1,167 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics never-type-param Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "X", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSNeverKeyword { + type: "TSNeverKeyword", + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ], + + range: [81, 88], + loc: { + start: { column: 8, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [80, 88], + loc: { + start: { column: 7, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [78, 88], + loc: { + start: { column: 5, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [77, 88], + loc: { + start: { column: 4, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + init: null, + + range: [77, 88], + loc: { + start: { column: 4, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + kind: "var", + + range: [73, 89], + loc: { + start: { column: 0, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "Observable", + + range: [90, 100], + loc: { + start: { column: 0, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "empty", + + range: [101, 106], + loc: { + start: { column: 11, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [90, 106], + loc: { + start: { column: 0, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + optional: false, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSNeverKeyword { + type: "TSNeverKeyword", + + range: [107, 112], + loc: { + start: { column: 17, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + ], + + range: [106, 113], + loc: { + start: { column: 16, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [90, 115], + loc: { + start: { column: 0, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [90, 116], + loc: { + start: { column: 0, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 117], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..e09dbbd84c5c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics never-type-param Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "var", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "never", + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Observable", + + range: [90, 100], + loc: { + start: { column: 0, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [100, 101], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "empty", + + range: [101, 106], + loc: { + start: { column: 11, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [106, 107], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "never", + + range: [107, 112], + loc: { + start: { column: 17, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [112, 113], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [113, 114], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [114, 115], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [115, 116], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..3405c7b4b919 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics never-type-param AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..2f7a7dd8222d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics never-type-param AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/fixture.ts new file mode 100644 index 000000000000..6fc8d892865e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function processEntity(e?: Entity) { + validateEntity(e); + let s = e!.name; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..70afb98ceaf8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,202 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics non-null-assertion-operator TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Identifier { + type: "Identifier", + name: "e", + + range: [127, 128], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "validateEntity", + + range: [112, 126], + loc: { + start: { column: 2, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + optional: false, + + range: [112, 129], + loc: { + start: { column: 2, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + + range: [112, 130], + loc: { + start: { column: 2, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "s", + + range: [137, 138], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + init: MemberExpression { + type: "MemberExpression", + computed: false, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: Identifier { + type: "Identifier", + name: "e", + + range: [141, 142], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [141, 143], + loc: { + start: { column: 10, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "name", + + range: [144, 148], + loc: { + start: { column: 13, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [141, 148], + loc: { + start: { column: 10, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [137, 148], + loc: { + start: { column: 6, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + ], + kind: "let", + + range: [133, 149], + loc: { + start: { column: 2, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + ], + + range: [108, 151], + loc: { + start: { column: 35, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "processEntity", + + range: [82, 95], + loc: { + start: { column: 9, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "e", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Entity", + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [98, 106], + loc: { + start: { column: 25, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [96, 106], + loc: { + start: { column: 23, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + ], + + range: [73, 151], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 152], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..bce0bf745ad9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,236 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics non-null-assertion-operator TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "processEntity", + + range: [82, 95], + loc: { + start: { column: 9, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "e", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Entity", + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "validateEntity", + + range: [112, 126], + loc: { + start: { column: 2, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [126, 127], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "e", + + range: [127, 128], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [128, 129], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [129, 130], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "let", + + range: [133, 136], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "s", + + range: [137, 138], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [139, 140], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "e", + + range: [141, 142], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [142, 143], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [143, 144], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "name", + + range: [144, 148], + loc: { + start: { column: 13, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [148, 149], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [150, 151], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..30889fec908a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/3-Babel-AST.shot @@ -0,0 +1,202 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics non-null-assertion-operator Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Identifier { + type: "Identifier", + name: "e", + + range: [127, 128], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "validateEntity", + + range: [112, 126], + loc: { + start: { column: 2, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + optional: false, + + range: [112, 129], + loc: { + start: { column: 2, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + + range: [112, 130], + loc: { + start: { column: 2, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "s", + + range: [137, 138], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + init: MemberExpression { + type: "MemberExpression", + computed: false, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: Identifier { + type: "Identifier", + name: "e", + + range: [141, 142], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [141, 143], + loc: { + start: { column: 10, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "name", + + range: [144, 148], + loc: { + start: { column: 13, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [141, 148], + loc: { + start: { column: 10, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [137, 148], + loc: { + start: { column: 6, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + ], + kind: "let", + + range: [133, 149], + loc: { + start: { column: 2, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + ], + + range: [108, 151], + loc: { + start: { column: 35, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "processEntity", + + range: [82, 95], + loc: { + start: { column: 9, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "e", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Entity", + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [98, 106], + loc: { + start: { column: 25, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [96, 106], + loc: { + start: { column: 23, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + ], + + range: [73, 151], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 152], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..32ad48799ee9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,236 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics non-null-assertion-operator Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "processEntity", + + range: [82, 95], + loc: { + start: { column: 9, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "e", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Entity", + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "validateEntity", + + range: [112, 126], + loc: { + start: { column: 2, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [126, 127], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "e", + + range: [127, 128], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [128, 129], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [129, 130], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "let", + + range: [133, 136], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "s", + + range: [137, 138], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [139, 140], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "e", + + range: [141, 142], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [142, 143], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [143, 144], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "name", + + range: [144, 148], + loc: { + start: { column: 13, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [148, 149], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [150, 151], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..d8601d442844 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics non-null-assertion-operator AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..b717681cde65 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,242 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics non-null-assertion-operator AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'function', + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'processEntity', + + range: [82, 95], + loc: { + start: { column: 9, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'e', + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Entity', + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'validateEntity', + + range: [112, 126], + loc: { + start: { column: 2, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [126, 127], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'e', + + range: [127, 128], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [128, 129], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [129, 130], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [133, 136], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 's', + + range: [137, 138], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [139, 140], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'e', + + range: [141, 142], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '!', + + range: [142, 143], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '.', + + range: [143, 144], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'name', + + range: [144, 148], + loc: { + start: { column: 13, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [148, 149], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [150, 151], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/fixture.ts new file mode 100644 index 000000000000..893b81e58b39 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/fixture.ts @@ -0,0 +1,4 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let x: null; +let y: undefined; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..f37ac8a2e427 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics null-and-undefined-type-annotations TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNullKeyword { + type: "TSNullKeyword", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [78, 84], + loc: { + start: { column: 5, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [77, 84], + loc: { + start: { column: 4, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + init: null, + + range: [77, 84], + loc: { + start: { column: 4, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 85], + loc: { + start: { column: 0, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "y", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUndefinedKeyword { + type: "TSUndefinedKeyword", + + range: [93, 102], + loc: { + start: { column: 7, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [91, 102], + loc: { + start: { column: 5, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [90, 102], + loc: { + start: { column: 4, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + init: null, + + range: [90, 102], + loc: { + start: { column: 4, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + ], + kind: "let", + + range: [86, 103], + loc: { + start: { column: 0, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..de34a46c2a3f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics null-and-undefined-type-annotations TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "null", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "let", + + range: [86, 89], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "y", + + range: [90, 91], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [91, 92], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "undefined", + + range: [93, 102], + loc: { + start: { column: 7, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [102, 103], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..2e0256a528dd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/3-Babel-AST.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics null-and-undefined-type-annotations Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNullKeyword { + type: "TSNullKeyword", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [78, 84], + loc: { + start: { column: 5, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [77, 84], + loc: { + start: { column: 4, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + init: null, + + range: [77, 84], + loc: { + start: { column: 4, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 85], + loc: { + start: { column: 0, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "y", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUndefinedKeyword { + type: "TSUndefinedKeyword", + + range: [93, 102], + loc: { + start: { column: 7, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [91, 102], + loc: { + start: { column: 5, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [90, 102], + loc: { + start: { column: 4, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + init: null, + + range: [90, 102], + loc: { + start: { column: 4, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + ], + kind: "let", + + range: [86, 103], + loc: { + start: { column: 0, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..9f303ebd56b2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics null-and-undefined-type-annotations Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Null { + type: "Null", + value: "null", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "let", + + range: [86, 89], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "y", + + range: [90, 91], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [91, 92], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "undefined", + + range: [93, 102], + loc: { + start: { column: 7, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [102, 103], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..24b8986179c8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics null-and-undefined-type-annotations AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..27d9971bb2d4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics null-and-undefined-type-annotations AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Null { ++ type: 'Null', + value: 'null', + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [86, 89], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'y', + + range: [90, 91], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [91, 92], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'undefined', + + range: [93, 102], + loc: { + start: { column: 7, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [102, 103], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/fixture.ts new file mode 100644 index 000000000000..18e64122038a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function processNullishCoalesce(s?: string) { + let len = s ?? ''; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..5d1c14376fec --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,142 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics nullish-coalescing TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "len", + + range: [125, 128], + loc: { + start: { column: 6, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + init: LogicalExpression { + type: "LogicalExpression", + left: Identifier { + type: "Identifier", + name: "s", + + range: [131, 132], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + operator: "??", + right: Literal { + type: "Literal", + raw: "''", + value: "", + + range: [136, 138], + loc: { + start: { column: 17, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + + range: [131, 138], + loc: { + start: { column: 12, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + + range: [125, 138], + loc: { + start: { column: 6, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + ], + kind: "let", + + range: [121, 139], + loc: { + start: { column: 2, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + + range: [117, 141], + loc: { + start: { column: 44, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "processNullishCoalesce", + + range: [82, 104], + loc: { + start: { column: 9, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "s", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [109, 115], + loc: { + start: { column: 36, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + + range: [107, 115], + loc: { + start: { column: 34, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + + range: [105, 115], + loc: { + start: { column: 32, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + ], + + range: [73, 141], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 142], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..1708504a6b26 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics nullish-coalescing TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "processNullishCoalesce", + + range: [82, 104], + loc: { + start: { column: 9, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "s", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [109, 115], + loc: { + start: { column: 36, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "let", + + range: [121, 124], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "len", + + range: [125, 128], + loc: { + start: { column: 6, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [129, 130], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "s", + + range: [131, 132], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "??", + + range: [133, 135], + loc: { + start: { column: 14, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + String { + type: "String", + value: "''", + + range: [136, 138], + loc: { + start: { column: 17, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [138, 139], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [140, 141], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..3d645a6735b5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/3-Babel-AST.shot @@ -0,0 +1,142 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics nullish-coalescing Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "len", + + range: [125, 128], + loc: { + start: { column: 6, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + init: LogicalExpression { + type: "LogicalExpression", + left: Identifier { + type: "Identifier", + name: "s", + + range: [131, 132], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + operator: "??", + right: Literal { + type: "Literal", + raw: "''", + value: "", + + range: [136, 138], + loc: { + start: { column: 17, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + + range: [131, 138], + loc: { + start: { column: 12, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + + range: [125, 138], + loc: { + start: { column: 6, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + ], + kind: "let", + + range: [121, 139], + loc: { + start: { column: 2, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + + range: [117, 141], + loc: { + start: { column: 44, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "processNullishCoalesce", + + range: [82, 104], + loc: { + start: { column: 9, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "s", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [109, 115], + loc: { + start: { column: 36, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + + range: [107, 115], + loc: { + start: { column: 34, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + + range: [105, 115], + loc: { + start: { column: 32, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + ], + + range: [73, 141], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 142], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..896ca7a57834 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics nullish-coalescing Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "processNullishCoalesce", + + range: [82, 104], + loc: { + start: { column: 9, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "s", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [109, 115], + loc: { + start: { column: 36, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "let", + + range: [121, 124], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "len", + + range: [125, 128], + loc: { + start: { column: 6, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [129, 130], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "s", + + range: [131, 132], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "??", + + range: [133, 135], + loc: { + start: { column: 14, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + String { + type: "String", + value: "''", + + range: [136, 138], + loc: { + start: { column: 17, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [138, 139], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [140, 141], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..e44cc1eb21fc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics nullish-coalescing AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..df41cd9b8274 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,182 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics nullish-coalescing AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'function', + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'processNullishCoalesce', + + range: [82, 104], + loc: { + start: { column: 9, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 's', + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [109, 115], + loc: { + start: { column: 36, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [121, 124], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'len', + + range: [125, 128], + loc: { + start: { column: 6, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [129, 130], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 's', + + range: [131, 132], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '??', + + range: [133, 135], + loc: { + start: { column: 14, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + String { + type: 'String', + value: '\\\\'\\\\'', + + range: [136, 138], + loc: { + start: { column: 17, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [138, 139], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [140, 141], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/fixture.ts new file mode 100644 index 000000000000..688c4ecd840e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/fixture.ts @@ -0,0 +1,11 @@ +// TODO: This fixture might be too large, and if so should be split up. + +({ __: null }); + +({ __() {} }); + +({ ['__']: null }); + +class X { + '__' = null; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..2942241b82ce --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,258 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics object-with-escaped-properties TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "__", + + range: [76, 78], + loc: { + start: { column: 3, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: "null", + value: null, + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [76, 84], + loc: { + start: { column: 3, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + ], + + range: [74, 86], + loc: { + start: { column: 1, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 88], + loc: { + start: { column: 0, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "__", + + range: [93, 95], + loc: { + start: { column: 3, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + kind: "init", + method: true, + shorthand: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [98, 100], + loc: { + start: { column: 8, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [95, 100], + loc: { + start: { column: 5, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + + range: [93, 100], + loc: { + start: { column: 3, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + ], + + range: [91, 102], + loc: { + start: { column: 1, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + + range: [90, 104], + loc: { + start: { column: 0, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: true, + key: Literal { + type: "Literal", + raw: "'__'", + value: "__", + + range: [110, 114], + loc: { + start: { column: 4, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: "null", + value: null, + + range: [117, 121], + loc: { + start: { column: 11, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + + range: [109, 121], + loc: { + start: { column: 3, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + ], + + range: [107, 123], + loc: { + start: { column: 1, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + + range: [106, 125], + loc: { + start: { column: 0, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + key: Literal { + type: "Literal", + raw: "'__'", + value: "__", + + range: [139, 143], + loc: { + start: { column: 2, line: 10 }, + end: { column: 6, line: 10 }, + }, + }, + override: false, + static: false, + value: Literal { + type: "Literal", + raw: "null", + value: null, + + range: [146, 150], + loc: { + start: { column: 9, line: 10 }, + end: { column: 13, line: 10 }, + }, + }, + + range: [139, 151], + loc: { + start: { column: 2, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + ], + + range: [135, 153], + loc: { + start: { column: 8, line: 9 }, + end: { column: 1, line: 11 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "X", + + range: [133, 134], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + superClass: null, + + range: [127, 153], + loc: { + start: { column: 0, line: 9 }, + end: { column: 1, line: 11 }, + }, + }, + ], + sourceType: "script", + + range: [73, 154], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 12 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..dcd81be4acd4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,366 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics object-with-escaped-properties TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "__", + + range: [76, 78], + loc: { + start: { column: 3, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "null", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [90, 91], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [91, 92], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "__", + + range: [93, 95], + loc: { + start: { column: 3, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [95, 96], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [96, 97], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [98, 99], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [99, 100], + loc: { + start: { column: 9, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [101, 102], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [102, 103], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [103, 104], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [106, 107], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [107, 108], + loc: { + start: { column: 1, line: 7 }, + end: { column: 2, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [109, 110], + loc: { + start: { column: 3, line: 7 }, + end: { column: 4, line: 7 }, + }, + }, + String { + type: "String", + value: "'__'", + + range: [110, 114], + loc: { + start: { column: 4, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [114, 115], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [115, 116], + loc: { + start: { column: 9, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "null", + + range: [117, 121], + loc: { + start: { column: 11, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [122, 123], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [123, 124], + loc: { + start: { column: 17, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [124, 125], + loc: { + start: { column: 18, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [127, 132], + loc: { + start: { column: 0, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [133, 134], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [135, 136], + loc: { + start: { column: 8, line: 9 }, + end: { column: 9, line: 9 }, + }, + }, + String { + type: "String", + value: "'__'", + + range: [139, 143], + loc: { + start: { column: 2, line: 10 }, + end: { column: 6, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [144, 145], + loc: { + start: { column: 7, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Keyword { + type: "Keyword", + value: "null", + + range: [146, 150], + loc: { + start: { column: 9, line: 10 }, + end: { column: 13, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [150, 151], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [152, 153], + loc: { + start: { column: 0, line: 11 }, + end: { column: 1, line: 11 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..f66caa244c13 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/3-Babel-AST.shot @@ -0,0 +1,256 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics object-with-escaped-properties Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "__", + + range: [76, 78], + loc: { + start: { column: 3, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: "null", + value: null, + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [76, 84], + loc: { + start: { column: 3, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + ], + + range: [74, 86], + loc: { + start: { column: 1, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 88], + loc: { + start: { column: 0, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "__", + + range: [93, 95], + loc: { + start: { column: 3, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + kind: "init", + method: true, + shorthand: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [98, 100], + loc: { + start: { column: 8, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [95, 100], + loc: { + start: { column: 5, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + + range: [93, 100], + loc: { + start: { column: 3, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + ], + + range: [91, 102], + loc: { + start: { column: 1, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + + range: [90, 104], + loc: { + start: { column: 0, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: true, + key: Literal { + type: "Literal", + raw: "'__'", + value: "__", + + range: [110, 114], + loc: { + start: { column: 4, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: "null", + value: null, + + range: [117, 121], + loc: { + start: { column: 11, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + + range: [109, 121], + loc: { + start: { column: 3, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + ], + + range: [107, 123], + loc: { + start: { column: 1, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + + range: [106, 125], + loc: { + start: { column: 0, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + key: Literal { + type: "Literal", + raw: "'__'", + value: "__", + + range: [139, 143], + loc: { + start: { column: 2, line: 10 }, + end: { column: 6, line: 10 }, + }, + }, + static: false, + value: Literal { + type: "Literal", + raw: "null", + value: null, + + range: [146, 150], + loc: { + start: { column: 9, line: 10 }, + end: { column: 13, line: 10 }, + }, + }, + + range: [139, 151], + loc: { + start: { column: 2, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + ], + + range: [135, 153], + loc: { + start: { column: 8, line: 9 }, + end: { column: 1, line: 11 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "X", + + range: [133, 134], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + superClass: null, + + range: [127, 153], + loc: { + start: { column: 0, line: 9 }, + end: { column: 1, line: 11 }, + }, + }, + ], + sourceType: "script", + + range: [73, 154], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 12 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..51f022f30177 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,366 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics object-with-escaped-properties Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "__", + + range: [76, 78], + loc: { + start: { column: 3, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Null { + type: "Null", + value: "null", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [90, 91], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [91, 92], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "__", + + range: [93, 95], + loc: { + start: { column: 3, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [95, 96], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [96, 97], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [98, 99], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [99, 100], + loc: { + start: { column: 9, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [101, 102], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [102, 103], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [103, 104], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [106, 107], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [107, 108], + loc: { + start: { column: 1, line: 7 }, + end: { column: 2, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [109, 110], + loc: { + start: { column: 3, line: 7 }, + end: { column: 4, line: 7 }, + }, + }, + String { + type: "String", + value: "'__'", + + range: [110, 114], + loc: { + start: { column: 4, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [114, 115], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [115, 116], + loc: { + start: { column: 9, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Null { + type: "Null", + value: "null", + + range: [117, 121], + loc: { + start: { column: 11, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [122, 123], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [123, 124], + loc: { + start: { column: 17, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [124, 125], + loc: { + start: { column: 18, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [127, 132], + loc: { + start: { column: 0, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [133, 134], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [135, 136], + loc: { + start: { column: 8, line: 9 }, + end: { column: 9, line: 9 }, + }, + }, + String { + type: "String", + value: "'__'", + + range: [139, 143], + loc: { + start: { column: 2, line: 10 }, + end: { column: 6, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [144, 145], + loc: { + start: { column: 7, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Null { + type: "Null", + value: "null", + + range: [146, 150], + loc: { + start: { column: 9, line: 10 }, + end: { column: 13, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [150, 151], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [152, 153], + loc: { + start: { column: 0, line: 11 }, + end: { column: 1, line: 11 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..5d16eed4a91c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,262 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics object-with-escaped-properties AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExpressionStatement { + type: 'ExpressionStatement', + expression: ObjectExpression { + type: 'ObjectExpression', + properties: Array [ + Property { + type: 'Property', + computed: false, + key: Identifier { + type: 'Identifier', + name: '__', + + range: [76, 78], + loc: { + start: { column: 3, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + kind: 'init', + method: false, + shorthand: false, + value: Literal { + type: 'Literal', + raw: 'null', + value: null, + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [76, 84], + loc: { + start: { column: 3, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + ], + + range: [74, 86], + loc: { + start: { column: 1, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 88], + loc: { + start: { column: 0, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ExpressionStatement { + type: 'ExpressionStatement', + expression: ObjectExpression { + type: 'ObjectExpression', + properties: Array [ + Property { + type: 'Property', + computed: false, + key: Identifier { + type: 'Identifier', + name: '__', + + range: [93, 95], + loc: { + start: { column: 3, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + kind: 'init', + method: true, + shorthand: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [98, 100], + loc: { + start: { column: 8, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [95, 100], + loc: { + start: { column: 5, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + + range: [93, 100], + loc: { + start: { column: 3, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + ], + + range: [91, 102], + loc: { + start: { column: 1, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + + range: [90, 104], + loc: { + start: { column: 0, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + ExpressionStatement { + type: 'ExpressionStatement', + expression: ObjectExpression { + type: 'ObjectExpression', + properties: Array [ + Property { + type: 'Property', + computed: true, + key: Literal { + type: 'Literal', + raw: '\\\\'__\\\\'', + value: '__', + + range: [110, 114], + loc: { + start: { column: 4, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + kind: 'init', + method: false, + shorthand: false, + value: Literal { + type: 'Literal', + raw: 'null', + value: null, + + range: [117, 121], + loc: { + start: { column: 11, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + + range: [109, 121], + loc: { + start: { column: 3, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + ], + + range: [107, 123], + loc: { + start: { column: 1, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + + range: [106, 125], + loc: { + start: { column: 0, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + key: Literal { + type: 'Literal', + raw: '\\\\'__\\\\'', + value: '__', + + range: [139, 143], + loc: { + start: { column: 2, line: 10 }, + end: { column: 6, line: 10 }, + }, + }, +- override: false, + static: false, + value: Literal { + type: 'Literal', + raw: 'null', + value: null, + + range: [146, 150], + loc: { + start: { column: 9, line: 10 }, + end: { column: 13, line: 10 }, + }, + }, + + range: [139, 151], + loc: { + start: { column: 2, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + ], + + range: [135, 153], + loc: { + start: { column: 8, line: 9 }, + end: { column: 1, line: 11 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'X', + + range: [133, 134], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + superClass: null, + + range: [127, 153], + loc: { + start: { column: 0, line: 9 }, + end: { column: 1, line: 11 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 154], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 12 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..57a2acde6538 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,376 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics object-with-escaped-properties AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Punctuator { + type: 'Punctuator', + value: '(', + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [74, 75], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: '__', + + range: [76, 78], + loc: { + start: { column: 3, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Null { ++ type: 'Null', + value: 'null', + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [90, 91], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [91, 92], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: '__', + + range: [93, 95], + loc: { + start: { column: 3, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [95, 96], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [96, 97], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [98, 99], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [99, 100], + loc: { + start: { column: 9, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [101, 102], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [102, 103], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [103, 104], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [106, 107], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [107, 108], + loc: { + start: { column: 1, line: 7 }, + end: { column: 2, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [109, 110], + loc: { + start: { column: 3, line: 7 }, + end: { column: 4, line: 7 }, + }, + }, + String { + type: 'String', + value: '\\\\'__\\\\'', + + range: [110, 114], + loc: { + start: { column: 4, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [114, 115], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [115, 116], + loc: { + start: { column: 9, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Null { ++ type: 'Null', + value: 'null', + + range: [117, 121], + loc: { + start: { column: 11, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [122, 123], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [123, 124], + loc: { + start: { column: 17, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [124, 125], + loc: { + start: { column: 18, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'class', + + range: [127, 132], + loc: { + start: { column: 0, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'X', + + range: [133, 134], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [135, 136], + loc: { + start: { column: 8, line: 9 }, + end: { column: 9, line: 9 }, + }, + }, + String { + type: 'String', + value: '\\\\'__\\\\'', + + range: [139, 143], + loc: { + start: { column: 2, line: 10 }, + end: { column: 6, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [144, 145], + loc: { + start: { column: 7, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Null { ++ type: 'Null', + value: 'null', + + range: [146, 150], + loc: { + start: { column: 9, line: 10 }, + end: { column: 13, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [150, 151], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [152, 153], + loc: { + start: { column: 0, line: 11 }, + end: { column: 1, line: 11 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/fixture.ts new file mode 100644 index 000000000000..eb1952817389 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/fixture.ts @@ -0,0 +1,14 @@ +// TODO: This fixture might be too large, and if so should be split up. + +const foo = { + constructor(): number { + return 1; + }, + foo(): number { + return 1; + }, + get a(): number { + return 1; + }, + set a(x: number): number {}, +}; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..e8f81ec7e884 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,474 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + init: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [89, 100], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: "init", + method: true, + shorthand: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [127, 128], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + + range: [120, 129], + loc: { + start: { column: 4, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + ], + + range: [114, 133], + loc: { + start: { column: 27, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [107, 113], + loc: { + start: { column: 20, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + + range: [105, 113], + loc: { + start: { column: 18, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [101, 102], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + out: false, + + range: [101, 102], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + ], + + range: [100, 103], + loc: { + start: { column: 13, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [100, 133], + loc: { + start: { column: 13, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [89, 133], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [137, 140], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + kind: "init", + method: true, + shorthand: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [167, 168], + loc: { + start: { column: 11, line: 8 }, + end: { column: 12, line: 8 }, + }, + }, + + range: [160, 169], + loc: { + start: { column: 4, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + ], + + range: [154, 173], + loc: { + start: { column: 19, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [147, 153], + loc: { + start: { column: 12, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + + range: [145, 153], + loc: { + start: { column: 10, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [141, 142], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + out: false, + + range: [141, 142], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + ], + + range: [140, 143], + loc: { + start: { column: 5, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + + range: [140, 173], + loc: { + start: { column: 5, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + + range: [137, 173], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "a", + + range: [181, 182], + loc: { + start: { column: 6, line: 10 }, + end: { column: 7, line: 10 }, + }, + }, + kind: "get", + method: false, + shorthand: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [206, 207], + loc: { + start: { column: 11, line: 11 }, + end: { column: 12, line: 11 }, + }, + }, + + range: [199, 208], + loc: { + start: { column: 4, line: 11 }, + end: { column: 13, line: 11 }, + }, + }, + ], + + range: [193, 212], + loc: { + start: { column: 18, line: 10 }, + end: { column: 3, line: 12 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [186, 192], + loc: { + start: { column: 11, line: 10 }, + end: { column: 17, line: 10 }, + }, + }, + + range: [184, 192], + loc: { + start: { column: 9, line: 10 }, + end: { column: 17, line: 10 }, + }, + }, + + range: [182, 212], + loc: { + start: { column: 7, line: 10 }, + end: { column: 3, line: 12 }, + }, + }, + + range: [177, 212], + loc: { + start: { column: 2, line: 10 }, + end: { column: 3, line: 12 }, + }, + }, + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "a", + + range: [220, 221], + loc: { + start: { column: 6, line: 13 }, + end: { column: 7, line: 13 }, + }, + }, + kind: "set", + method: false, + shorthand: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [241, 243], + loc: { + start: { column: 27, line: 13 }, + end: { column: 29, line: 13 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [225, 231], + loc: { + start: { column: 11, line: 13 }, + end: { column: 17, line: 13 }, + }, + }, + + range: [223, 231], + loc: { + start: { column: 9, line: 13 }, + end: { column: 17, line: 13 }, + }, + }, + + range: [222, 231], + loc: { + start: { column: 8, line: 13 }, + end: { column: 17, line: 13 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [234, 240], + loc: { + start: { column: 20, line: 13 }, + end: { column: 26, line: 13 }, + }, + }, + + range: [232, 240], + loc: { + start: { column: 18, line: 13 }, + end: { column: 26, line: 13 }, + }, + }, + + range: [221, 243], + loc: { + start: { column: 7, line: 13 }, + end: { column: 29, line: 13 }, + }, + }, + + range: [216, 243], + loc: { + start: { column: 2, line: 13 }, + end: { column: 29, line: 13 }, + }, + }, + ], + + range: [85, 246], + loc: { + start: { column: 12, line: 3 }, + end: { column: 1, line: 14 }, + }, + }, + + range: [79, 246], + loc: { + start: { column: 6, line: 3 }, + end: { column: 1, line: 14 }, + }, + }, + ], + kind: "const", + + range: [73, 247], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 14 }, + }, + }, + ], + sourceType: "script", + + range: [73, 248], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 15 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..232b65323a28 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,586 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "const", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [89, 100], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [100, 101], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [101, 102], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [102, 103], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [103, 104], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [104, 105], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [105, 106], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [107, 113], + loc: { + start: { column: 20, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [114, 115], + loc: { + start: { column: 27, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [120, 126], + loc: { + start: { column: 4, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [127, 128], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [128, 129], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [132, 133], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [133, 134], + loc: { + start: { column: 3, line: 6 }, + end: { column: 4, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [137, 140], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [140, 141], + loc: { + start: { column: 5, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [141, 142], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [142, 143], + loc: { + start: { column: 7, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [143, 144], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [144, 145], + loc: { + start: { column: 9, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [145, 146], + loc: { + start: { column: 10, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [147, 153], + loc: { + start: { column: 12, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [154, 155], + loc: { + start: { column: 19, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [160, 166], + loc: { + start: { column: 4, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [167, 168], + loc: { + start: { column: 11, line: 8 }, + end: { column: 12, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [168, 169], + loc: { + start: { column: 12, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [172, 173], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [173, 174], + loc: { + start: { column: 3, line: 9 }, + end: { column: 4, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "get", + + range: [177, 180], + loc: { + start: { column: 2, line: 10 }, + end: { column: 5, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [181, 182], + loc: { + start: { column: 6, line: 10 }, + end: { column: 7, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [182, 183], + loc: { + start: { column: 7, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [183, 184], + loc: { + start: { column: 8, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [184, 185], + loc: { + start: { column: 9, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [186, 192], + loc: { + start: { column: 11, line: 10 }, + end: { column: 17, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [193, 194], + loc: { + start: { column: 18, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [199, 205], + loc: { + start: { column: 4, line: 11 }, + end: { column: 10, line: 11 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [206, 207], + loc: { + start: { column: 11, line: 11 }, + end: { column: 12, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [207, 208], + loc: { + start: { column: 12, line: 11 }, + end: { column: 13, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [211, 212], + loc: { + start: { column: 2, line: 12 }, + end: { column: 3, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [212, 213], + loc: { + start: { column: 3, line: 12 }, + end: { column: 4, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + value: "set", + + range: [216, 219], + loc: { + start: { column: 2, line: 13 }, + end: { column: 5, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [220, 221], + loc: { + start: { column: 6, line: 13 }, + end: { column: 7, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [221, 222], + loc: { + start: { column: 7, line: 13 }, + end: { column: 8, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [222, 223], + loc: { + start: { column: 8, line: 13 }, + end: { column: 9, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [223, 224], + loc: { + start: { column: 9, line: 13 }, + end: { column: 10, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [225, 231], + loc: { + start: { column: 11, line: 13 }, + end: { column: 17, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [231, 232], + loc: { + start: { column: 17, line: 13 }, + end: { column: 18, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [232, 233], + loc: { + start: { column: 18, line: 13 }, + end: { column: 19, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [234, 240], + loc: { + start: { column: 20, line: 13 }, + end: { column: 26, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [241, 242], + loc: { + start: { column: 27, line: 13 }, + end: { column: 28, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [242, 243], + loc: { + start: { column: 28, line: 13 }, + end: { column: 29, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [243, 244], + loc: { + start: { column: 29, line: 13 }, + end: { column: 30, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [245, 246], + loc: { + start: { column: 0, line: 14 }, + end: { column: 1, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [246, 247], + loc: { + start: { column: 1, line: 14 }, + end: { column: 2, line: 14 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..a020b344a3a8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/3-Babel-AST.shot @@ -0,0 +1,452 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + init: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [89, 100], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: "init", + method: true, + shorthand: false, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [101, 102], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + ], + + range: [100, 103], + loc: { + start: { column: 13, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [127, 128], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + + range: [120, 129], + loc: { + start: { column: 4, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + ], + + range: [114, 133], + loc: { + start: { column: 27, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [107, 113], + loc: { + start: { column: 20, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + + range: [105, 113], + loc: { + start: { column: 18, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + + range: [103, 133], + loc: { + start: { column: 16, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [89, 133], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [137, 140], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + kind: "init", + method: true, + shorthand: false, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [141, 142], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + ], + + range: [140, 143], + loc: { + start: { column: 5, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [167, 168], + loc: { + start: { column: 11, line: 8 }, + end: { column: 12, line: 8 }, + }, + }, + + range: [160, 169], + loc: { + start: { column: 4, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + ], + + range: [154, 173], + loc: { + start: { column: 19, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [147, 153], + loc: { + start: { column: 12, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + + range: [145, 153], + loc: { + start: { column: 10, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + + range: [143, 173], + loc: { + start: { column: 8, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + + range: [137, 173], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "a", + + range: [181, 182], + loc: { + start: { column: 6, line: 10 }, + end: { column: 7, line: 10 }, + }, + }, + kind: "get", + method: false, + shorthand: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [206, 207], + loc: { + start: { column: 11, line: 11 }, + end: { column: 12, line: 11 }, + }, + }, + + range: [199, 208], + loc: { + start: { column: 4, line: 11 }, + end: { column: 13, line: 11 }, + }, + }, + ], + + range: [193, 212], + loc: { + start: { column: 18, line: 10 }, + end: { column: 3, line: 12 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [186, 192], + loc: { + start: { column: 11, line: 10 }, + end: { column: 17, line: 10 }, + }, + }, + + range: [184, 192], + loc: { + start: { column: 9, line: 10 }, + end: { column: 17, line: 10 }, + }, + }, + + range: [182, 212], + loc: { + start: { column: 7, line: 10 }, + end: { column: 3, line: 12 }, + }, + }, + + range: [177, 212], + loc: { + start: { column: 2, line: 10 }, + end: { column: 3, line: 12 }, + }, + }, + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "a", + + range: [220, 221], + loc: { + start: { column: 6, line: 13 }, + end: { column: 7, line: 13 }, + }, + }, + kind: "set", + method: false, + shorthand: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [241, 243], + loc: { + start: { column: 27, line: 13 }, + end: { column: 29, line: 13 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [225, 231], + loc: { + start: { column: 11, line: 13 }, + end: { column: 17, line: 13 }, + }, + }, + + range: [223, 231], + loc: { + start: { column: 9, line: 13 }, + end: { column: 17, line: 13 }, + }, + }, + + range: [222, 231], + loc: { + start: { column: 8, line: 13 }, + end: { column: 17, line: 13 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [234, 240], + loc: { + start: { column: 20, line: 13 }, + end: { column: 26, line: 13 }, + }, + }, + + range: [232, 240], + loc: { + start: { column: 18, line: 13 }, + end: { column: 26, line: 13 }, + }, + }, + + range: [221, 243], + loc: { + start: { column: 7, line: 13 }, + end: { column: 29, line: 13 }, + }, + }, + + range: [216, 243], + loc: { + start: { column: 2, line: 13 }, + end: { column: 29, line: 13 }, + }, + }, + ], + + range: [85, 246], + loc: { + start: { column: 12, line: 3 }, + end: { column: 1, line: 14 }, + }, + }, + + range: [79, 246], + loc: { + start: { column: 6, line: 3 }, + end: { column: 1, line: 14 }, + }, + }, + ], + kind: "const", + + range: [73, 247], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 14 }, + }, + }, + ], + sourceType: "script", + + range: [73, 248], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 15 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..c49a4e5f01dc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,586 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "const", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [89, 100], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [100, 101], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [101, 102], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [102, 103], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [103, 104], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [104, 105], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [105, 106], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [107, 113], + loc: { + start: { column: 20, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [114, 115], + loc: { + start: { column: 27, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [120, 126], + loc: { + start: { column: 4, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [127, 128], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [128, 129], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [132, 133], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [133, 134], + loc: { + start: { column: 3, line: 6 }, + end: { column: 4, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [137, 140], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [140, 141], + loc: { + start: { column: 5, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [141, 142], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [142, 143], + loc: { + start: { column: 7, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [143, 144], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [144, 145], + loc: { + start: { column: 9, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [145, 146], + loc: { + start: { column: 10, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [147, 153], + loc: { + start: { column: 12, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [154, 155], + loc: { + start: { column: 19, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [160, 166], + loc: { + start: { column: 4, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [167, 168], + loc: { + start: { column: 11, line: 8 }, + end: { column: 12, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [168, 169], + loc: { + start: { column: 12, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [172, 173], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [173, 174], + loc: { + start: { column: 3, line: 9 }, + end: { column: 4, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "get", + + range: [177, 180], + loc: { + start: { column: 2, line: 10 }, + end: { column: 5, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [181, 182], + loc: { + start: { column: 6, line: 10 }, + end: { column: 7, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [182, 183], + loc: { + start: { column: 7, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [183, 184], + loc: { + start: { column: 8, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [184, 185], + loc: { + start: { column: 9, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [186, 192], + loc: { + start: { column: 11, line: 10 }, + end: { column: 17, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [193, 194], + loc: { + start: { column: 18, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [199, 205], + loc: { + start: { column: 4, line: 11 }, + end: { column: 10, line: 11 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [206, 207], + loc: { + start: { column: 11, line: 11 }, + end: { column: 12, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [207, 208], + loc: { + start: { column: 12, line: 11 }, + end: { column: 13, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [211, 212], + loc: { + start: { column: 2, line: 12 }, + end: { column: 3, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [212, 213], + loc: { + start: { column: 3, line: 12 }, + end: { column: 4, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + value: "set", + + range: [216, 219], + loc: { + start: { column: 2, line: 13 }, + end: { column: 5, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [220, 221], + loc: { + start: { column: 6, line: 13 }, + end: { column: 7, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [221, 222], + loc: { + start: { column: 7, line: 13 }, + end: { column: 8, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [222, 223], + loc: { + start: { column: 8, line: 13 }, + end: { column: 9, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [223, 224], + loc: { + start: { column: 9, line: 13 }, + end: { column: 10, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [225, 231], + loc: { + start: { column: 11, line: 13 }, + end: { column: 17, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [231, 232], + loc: { + start: { column: 17, line: 13 }, + end: { column: 18, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [232, 233], + loc: { + start: { column: 18, line: 13 }, + end: { column: 19, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [234, 240], + loc: { + start: { column: 20, line: 13 }, + end: { column: 26, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [241, 242], + loc: { + start: { column: 27, line: 13 }, + end: { column: 28, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [242, 243], + loc: { + start: { column: 28, line: 13 }, + end: { column: 29, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [243, 244], + loc: { + start: { column: 29, line: 13 }, + end: { column: 30, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [245, 246], + loc: { + start: { column: 0, line: 14 }, + end: { column: 1, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [246, 247], + loc: { + start: { column: 1, line: 14 }, + end: { column: 2, line: 14 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..6dce128496d8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,524 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + init: ObjectExpression { + type: 'ObjectExpression', + properties: Array [ + Property { + type: 'Property', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'constructor', + + range: [89, 100], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: 'init', + method: true, + shorthand: false, ++ typeParameters: TSTypeParameterDeclaration { ++ type: 'TSTypeParameterDeclaration', ++ params: Array [ ++ TSTypeParameter { ++ type: 'TSTypeParameter', ++ name: 'T', ++ ++ range: [101, 102], ++ loc: { ++ start: { column: 14, line: 4 }, ++ end: { column: 15, line: 4 }, ++ }, ++ }, ++ ], ++ ++ range: [100, 103], ++ loc: { ++ start: { column: 13, line: 4 }, ++ end: { column: 16, line: 4 }, ++ }, ++ }, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [127, 128], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + + range: [120, 129], + loc: { + start: { column: 4, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + ], + + range: [114, 133], + loc: { + start: { column: 27, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [107, 113], + loc: { + start: { column: 20, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + + range: [105, 113], + loc: { + start: { column: 18, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, +- typeParameters: TSTypeParameterDeclaration { +- type: 'TSTypeParameterDeclaration', +- params: Array [ +- TSTypeParameter { +- type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', + +- range: [101, 102], +- loc: { +- start: { column: 14, line: 4 }, +- end: { column: 15, line: 4 }, +- }, +- }, +- out: false, +- +- range: [101, 102], +- loc: { +- start: { column: 14, line: 4 }, +- end: { column: 15, line: 4 }, +- }, +- }, +- ], +- +- range: [100, 103], +- loc: { +- start: { column: 13, line: 4 }, +- end: { column: 16, line: 4 }, +- }, +- }, +- +- range: [100, 133], ++ range: [103, 133], + loc: { +- start: { column: 13, line: 4 }, ++ start: { column: 16, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [89, 133], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + Property { + type: 'Property', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'foo', + + range: [137, 140], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + kind: 'init', + method: true, + shorthand: false, ++ typeParameters: TSTypeParameterDeclaration { ++ type: 'TSTypeParameterDeclaration', ++ params: Array [ ++ TSTypeParameter { ++ type: 'TSTypeParameter', ++ name: 'T', ++ ++ range: [141, 142], ++ loc: { ++ start: { column: 6, line: 7 }, ++ end: { column: 7, line: 7 }, ++ }, ++ }, ++ ], ++ ++ range: [140, 143], ++ loc: { ++ start: { column: 5, line: 7 }, ++ end: { column: 8, line: 7 }, ++ }, ++ }, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [167, 168], + loc: { + start: { column: 11, line: 8 }, + end: { column: 12, line: 8 }, + }, + }, + + range: [160, 169], + loc: { + start: { column: 4, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + ], + + range: [154, 173], + loc: { + start: { column: 19, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [147, 153], + loc: { + start: { column: 12, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + + range: [145, 153], + loc: { + start: { column: 10, line: 7 }, + end: { column: 18, line: 7 }, +- }, +- }, +- typeParameters: TSTypeParameterDeclaration { +- type: 'TSTypeParameterDeclaration', +- params: Array [ +- TSTypeParameter { +- type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [141, 142], +- loc: { +- start: { column: 6, line: 7 }, +- end: { column: 7, line: 7 }, +- }, +- }, +- out: false, +- +- range: [141, 142], +- loc: { +- start: { column: 6, line: 7 }, +- end: { column: 7, line: 7 }, +- }, +- }, +- ], +- +- range: [140, 143], +- loc: { +- start: { column: 5, line: 7 }, +- end: { column: 8, line: 7 }, + }, + }, + +- range: [140, 173], ++ range: [143, 173], + loc: { +- start: { column: 5, line: 7 }, ++ start: { column: 8, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + + range: [137, 173], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + Property { + type: 'Property', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'a', + + range: [181, 182], + loc: { + start: { column: 6, line: 10 }, + end: { column: 7, line: 10 }, + }, + }, + kind: 'get', + method: false, + shorthand: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [206, 207], + loc: { + start: { column: 11, line: 11 }, + end: { column: 12, line: 11 }, + }, + }, + + range: [199, 208], + loc: { + start: { column: 4, line: 11 }, + end: { column: 13, line: 11 }, + }, + }, + ], + + range: [193, 212], + loc: { + start: { column: 18, line: 10 }, + end: { column: 3, line: 12 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [186, 192], + loc: { + start: { column: 11, line: 10 }, + end: { column: 17, line: 10 }, + }, + }, + + range: [184, 192], + loc: { + start: { column: 9, line: 10 }, + end: { column: 17, line: 10 }, + }, + }, + + range: [182, 212], + loc: { + start: { column: 7, line: 10 }, + end: { column: 3, line: 12 }, + }, + }, + + range: [177, 212], + loc: { + start: { column: 2, line: 10 }, + end: { column: 3, line: 12 }, + }, + }, + Property { + type: 'Property', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'a', + + range: [220, 221], + loc: { + start: { column: 6, line: 13 }, + end: { column: 7, line: 13 }, + }, + }, + kind: 'set', + method: false, + shorthand: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [241, 243], + loc: { + start: { column: 27, line: 13 }, + end: { column: 29, line: 13 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: 'Identifier', + name: 'x', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [225, 231], + loc: { + start: { column: 11, line: 13 }, + end: { column: 17, line: 13 }, + }, + }, + + range: [223, 231], + loc: { + start: { column: 9, line: 13 }, + end: { column: 17, line: 13 }, + }, + }, + + range: [222, 231], + loc: { + start: { column: 8, line: 13 }, + end: { column: 17, line: 13 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [234, 240], + loc: { + start: { column: 20, line: 13 }, + end: { column: 26, line: 13 }, + }, + }, + + range: [232, 240], + loc: { + start: { column: 18, line: 13 }, + end: { column: 26, line: 13 }, + }, + }, + + range: [221, 243], + loc: { + start: { column: 7, line: 13 }, + end: { column: 29, line: 13 }, + }, + }, + + range: [216, 243], + loc: { + start: { column: 2, line: 13 }, + end: { column: 29, line: 13 }, + }, + }, + ], + + range: [85, 246], + loc: { + start: { column: 12, line: 3 }, + end: { column: 1, line: 14 }, + }, + }, + + range: [79, 246], + loc: { + start: { column: 6, line: 3 }, + end: { column: 1, line: 14 }, + }, + }, + ], + kind: 'const', + + range: [73, 247], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 14 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 248], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 15 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..723f6c410aa6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/fixture.ts new file mode 100644 index 000000000000..f0f2e8afa940 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/fixture.ts @@ -0,0 +1,10 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function processOptional(one?: any) { + one?.two!(); + one?.two!.three(); + one?.two!(); + one?.two!.three(); + one?.two!(); + one?.two!.three(); +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..a445931c44c9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,557 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-call-with-non-null-assertion TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: TSNonNullExpression { + type: "TSNonNullExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [113, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [118, 121], + loc: { + start: { column: 7, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [113, 121], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [113, 122], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + optional: false, + + range: [113, 124], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [113, 124], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [113, 125], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [128, 131], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [133, 136], + loc: { + start: { column: 7, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + + range: [128, 136], + loc: { + start: { column: 2, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + + range: [128, 137], + loc: { + start: { column: 2, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "three", + + range: [138, 143], + loc: { + start: { column: 12, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [128, 143], + loc: { + start: { column: 2, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + optional: false, + + range: [128, 145], + loc: { + start: { column: 2, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + + range: [128, 145], + loc: { + start: { column: 2, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + + range: [128, 146], + loc: { + start: { column: 2, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: TSNonNullExpression { + type: "TSNonNullExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [149, 152], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [154, 157], + loc: { + start: { column: 7, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + + range: [149, 157], + loc: { + start: { column: 2, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + + range: [149, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + optional: false, + + range: [149, 160], + loc: { + start: { column: 2, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + + range: [149, 160], + loc: { + start: { column: 2, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + + range: [149, 161], + loc: { + start: { column: 2, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [164, 167], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [169, 172], + loc: { + start: { column: 7, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + + range: [164, 172], + loc: { + start: { column: 2, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + + range: [164, 173], + loc: { + start: { column: 2, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "three", + + range: [174, 179], + loc: { + start: { column: 12, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + + range: [164, 179], + loc: { + start: { column: 2, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + optional: false, + + range: [164, 181], + loc: { + start: { column: 2, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + + range: [164, 181], + loc: { + start: { column: 2, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + + range: [164, 182], + loc: { + start: { column: 2, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: TSNonNullExpression { + type: "TSNonNullExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [185, 188], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [190, 193], + loc: { + start: { column: 7, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + + range: [185, 193], + loc: { + start: { column: 2, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + + range: [185, 194], + loc: { + start: { column: 2, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + optional: false, + + range: [185, 196], + loc: { + start: { column: 2, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + + range: [185, 196], + loc: { + start: { column: 2, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + + range: [185, 197], + loc: { + start: { column: 2, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [200, 203], + loc: { + start: { column: 2, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [205, 208], + loc: { + start: { column: 7, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + + range: [200, 208], + loc: { + start: { column: 2, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + + range: [200, 209], + loc: { + start: { column: 2, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "three", + + range: [210, 215], + loc: { + start: { column: 12, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + + range: [200, 215], + loc: { + start: { column: 2, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + optional: false, + + range: [200, 217], + loc: { + start: { column: 2, line: 9 }, + end: { column: 19, line: 9 }, + }, + }, + + range: [200, 217], + loc: { + start: { column: 2, line: 9 }, + end: { column: 19, line: 9 }, + }, + }, + + range: [200, 218], + loc: { + start: { column: 2, line: 9 }, + end: { column: 20, line: 9 }, + }, + }, + ], + + range: [109, 220], + loc: { + start: { column: 36, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "processOptional", + + range: [82, 97], + loc: { + start: { column: 9, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "one", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [102, 107], + loc: { + start: { column: 29, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [98, 107], + loc: { + start: { column: 25, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + + range: [73, 220], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 221], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..5419216c91f2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,586 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-call-with-non-null-assertion TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "processOptional", + + range: [82, 97], + loc: { + start: { column: 9, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [113, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [116, 118], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [118, 121], + loc: { + start: { column: 7, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [121, 122], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [122, 123], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [123, 124], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [124, 125], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [128, 131], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [131, 133], + loc: { + start: { column: 5, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [133, 136], + loc: { + start: { column: 7, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [136, 137], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [137, 138], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [138, 143], + loc: { + start: { column: 12, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [143, 144], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [144, 145], + loc: { + start: { column: 18, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [145, 146], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [149, 152], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [152, 154], + loc: { + start: { column: 5, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [154, 157], + loc: { + start: { column: 7, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [157, 158], + loc: { + start: { column: 10, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [158, 159], + loc: { + start: { column: 11, line: 6 }, + end: { column: 12, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [159, 160], + loc: { + start: { column: 12, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [160, 161], + loc: { + start: { column: 13, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [164, 167], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [167, 169], + loc: { + start: { column: 5, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [169, 172], + loc: { + start: { column: 7, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [172, 173], + loc: { + start: { column: 10, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [173, 174], + loc: { + start: { column: 11, line: 7 }, + end: { column: 12, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [174, 179], + loc: { + start: { column: 12, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [179, 180], + loc: { + start: { column: 17, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [180, 181], + loc: { + start: { column: 18, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [181, 182], + loc: { + start: { column: 19, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [185, 188], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [188, 190], + loc: { + start: { column: 5, line: 8 }, + end: { column: 7, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [190, 193], + loc: { + start: { column: 7, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [193, 194], + loc: { + start: { column: 10, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [194, 195], + loc: { + start: { column: 11, line: 8 }, + end: { column: 12, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [195, 196], + loc: { + start: { column: 12, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [196, 197], + loc: { + start: { column: 13, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [200, 203], + loc: { + start: { column: 2, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [203, 205], + loc: { + start: { column: 5, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [205, 208], + loc: { + start: { column: 7, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [208, 209], + loc: { + start: { column: 10, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [209, 210], + loc: { + start: { column: 11, line: 9 }, + end: { column: 12, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [210, 215], + loc: { + start: { column: 12, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [215, 216], + loc: { + start: { column: 17, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [216, 217], + loc: { + start: { column: 18, line: 9 }, + end: { column: 19, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [217, 218], + loc: { + start: { column: 19, line: 9 }, + end: { column: 20, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [219, 220], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..bd28589abe28 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/3-Babel-AST.shot @@ -0,0 +1,557 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-call-with-non-null-assertion Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: TSNonNullExpression { + type: "TSNonNullExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [113, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [118, 121], + loc: { + start: { column: 7, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [113, 121], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [113, 122], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + optional: false, + + range: [113, 124], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [113, 124], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [113, 125], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [128, 131], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [133, 136], + loc: { + start: { column: 7, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + + range: [128, 136], + loc: { + start: { column: 2, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + + range: [128, 137], + loc: { + start: { column: 2, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "three", + + range: [138, 143], + loc: { + start: { column: 12, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [128, 143], + loc: { + start: { column: 2, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + optional: false, + + range: [128, 145], + loc: { + start: { column: 2, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + + range: [128, 145], + loc: { + start: { column: 2, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + + range: [128, 146], + loc: { + start: { column: 2, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: TSNonNullExpression { + type: "TSNonNullExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [149, 152], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [154, 157], + loc: { + start: { column: 7, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + + range: [149, 157], + loc: { + start: { column: 2, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + + range: [149, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + optional: false, + + range: [149, 160], + loc: { + start: { column: 2, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + + range: [149, 160], + loc: { + start: { column: 2, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + + range: [149, 161], + loc: { + start: { column: 2, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [164, 167], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [169, 172], + loc: { + start: { column: 7, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + + range: [164, 172], + loc: { + start: { column: 2, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + + range: [164, 173], + loc: { + start: { column: 2, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "three", + + range: [174, 179], + loc: { + start: { column: 12, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + + range: [164, 179], + loc: { + start: { column: 2, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + optional: false, + + range: [164, 181], + loc: { + start: { column: 2, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + + range: [164, 181], + loc: { + start: { column: 2, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + + range: [164, 182], + loc: { + start: { column: 2, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: TSNonNullExpression { + type: "TSNonNullExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [185, 188], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [190, 193], + loc: { + start: { column: 7, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + + range: [185, 193], + loc: { + start: { column: 2, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + + range: [185, 194], + loc: { + start: { column: 2, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + optional: false, + + range: [185, 196], + loc: { + start: { column: 2, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + + range: [185, 196], + loc: { + start: { column: 2, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + + range: [185, 197], + loc: { + start: { column: 2, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [200, 203], + loc: { + start: { column: 2, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [205, 208], + loc: { + start: { column: 7, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + + range: [200, 208], + loc: { + start: { column: 2, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + + range: [200, 209], + loc: { + start: { column: 2, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "three", + + range: [210, 215], + loc: { + start: { column: 12, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + + range: [200, 215], + loc: { + start: { column: 2, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + optional: false, + + range: [200, 217], + loc: { + start: { column: 2, line: 9 }, + end: { column: 19, line: 9 }, + }, + }, + + range: [200, 217], + loc: { + start: { column: 2, line: 9 }, + end: { column: 19, line: 9 }, + }, + }, + + range: [200, 218], + loc: { + start: { column: 2, line: 9 }, + end: { column: 20, line: 9 }, + }, + }, + ], + + range: [109, 220], + loc: { + start: { column: 36, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "processOptional", + + range: [82, 97], + loc: { + start: { column: 9, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "one", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [102, 107], + loc: { + start: { column: 29, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [98, 107], + loc: { + start: { column: 25, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + + range: [73, 220], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 221], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..6bccada6b1f2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,586 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-call-with-non-null-assertion Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "processOptional", + + range: [82, 97], + loc: { + start: { column: 9, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [113, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [116, 118], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [118, 121], + loc: { + start: { column: 7, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [121, 122], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [122, 123], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [123, 124], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [124, 125], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [128, 131], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [131, 133], + loc: { + start: { column: 5, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [133, 136], + loc: { + start: { column: 7, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [136, 137], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [137, 138], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [138, 143], + loc: { + start: { column: 12, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [143, 144], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [144, 145], + loc: { + start: { column: 18, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [145, 146], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [149, 152], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [152, 154], + loc: { + start: { column: 5, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [154, 157], + loc: { + start: { column: 7, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [157, 158], + loc: { + start: { column: 10, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [158, 159], + loc: { + start: { column: 11, line: 6 }, + end: { column: 12, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [159, 160], + loc: { + start: { column: 12, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [160, 161], + loc: { + start: { column: 13, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [164, 167], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [167, 169], + loc: { + start: { column: 5, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [169, 172], + loc: { + start: { column: 7, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [172, 173], + loc: { + start: { column: 10, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [173, 174], + loc: { + start: { column: 11, line: 7 }, + end: { column: 12, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [174, 179], + loc: { + start: { column: 12, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [179, 180], + loc: { + start: { column: 17, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [180, 181], + loc: { + start: { column: 18, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [181, 182], + loc: { + start: { column: 19, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [185, 188], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [188, 190], + loc: { + start: { column: 5, line: 8 }, + end: { column: 7, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [190, 193], + loc: { + start: { column: 7, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [193, 194], + loc: { + start: { column: 10, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [194, 195], + loc: { + start: { column: 11, line: 8 }, + end: { column: 12, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [195, 196], + loc: { + start: { column: 12, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [196, 197], + loc: { + start: { column: 13, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [200, 203], + loc: { + start: { column: 2, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [203, 205], + loc: { + start: { column: 5, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [205, 208], + loc: { + start: { column: 7, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [208, 209], + loc: { + start: { column: 10, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [209, 210], + loc: { + start: { column: 11, line: 9 }, + end: { column: 12, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [210, 215], + loc: { + start: { column: 12, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [215, 216], + loc: { + start: { column: 17, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [216, 217], + loc: { + start: { column: 18, line: 9 }, + end: { column: 19, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [217, 218], + loc: { + start: { column: 19, line: 9 }, + end: { column: 20, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [219, 220], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..6356986bf831 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-call-with-non-null-assertion AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..76cfc4a1bfb7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-call-with-non-null-assertion AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/fixture.ts new file mode 100644 index 000000000000..804863f36567 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/fixture.ts @@ -0,0 +1,15 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function processOptionalCallParens(one?: any) { + one?.fn(); + (one?.two).fn(); + one.two?.fn(); + (one.two?.three).fn(); + one.two?.three?.fn(); + + one?.(); + (one?.())(); + one?.()?.(); + + (one?.()).two; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..c7bb252b4848 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,705 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-call-with-parens TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [123, 126], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "fn", + + range: [128, 130], + loc: { + start: { column: 7, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [123, 130], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + optional: false, + + range: [123, 132], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + + range: [123, 132], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + + range: [123, 133], + loc: { + start: { column: 2, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [137, 140], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [142, 145], + loc: { + start: { column: 8, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [137, 145], + loc: { + start: { column: 3, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [137, 145], + loc: { + start: { column: 3, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "fn", + + range: [147, 149], + loc: { + start: { column: 13, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [136, 149], + loc: { + start: { column: 2, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + optional: false, + + range: [136, 151], + loc: { + start: { column: 2, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [136, 152], + loc: { + start: { column: 2, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [155, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [159, 162], + loc: { + start: { column: 6, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + + range: [155, 162], + loc: { + start: { column: 2, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "fn", + + range: [164, 166], + loc: { + start: { column: 11, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + + range: [155, 166], + loc: { + start: { column: 2, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + optional: false, + + range: [155, 168], + loc: { + start: { column: 2, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [155, 168], + loc: { + start: { column: 2, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [155, 169], + loc: { + start: { column: 2, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [173, 176], + loc: { + start: { column: 3, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [177, 180], + loc: { + start: { column: 7, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + + range: [173, 180], + loc: { + start: { column: 3, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "three", + + range: [182, 187], + loc: { + start: { column: 12, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + + range: [173, 187], + loc: { + start: { column: 3, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + + range: [173, 187], + loc: { + start: { column: 3, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "fn", + + range: [189, 191], + loc: { + start: { column: 19, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + + range: [172, 191], + loc: { + start: { column: 2, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + optional: false, + + range: [172, 193], + loc: { + start: { column: 2, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + + range: [172, 194], + loc: { + start: { column: 2, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [197, 200], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [201, 204], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + + range: [197, 204], + loc: { + start: { column: 2, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "three", + + range: [206, 211], + loc: { + start: { column: 11, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + + range: [197, 211], + loc: { + start: { column: 2, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "fn", + + range: [213, 215], + loc: { + start: { column: 18, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + + range: [197, 215], + loc: { + start: { column: 2, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + optional: false, + + range: [197, 217], + loc: { + start: { column: 2, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [197, 217], + loc: { + start: { column: 2, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [197, 218], + loc: { + start: { column: 2, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "one", + + range: [222, 225], + loc: { + start: { column: 2, line: 10 }, + end: { column: 5, line: 10 }, + }, + }, + optional: true, + + range: [222, 229], + loc: { + start: { column: 2, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + + range: [222, 229], + loc: { + start: { column: 2, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + + range: [222, 230], + loc: { + start: { column: 2, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "one", + + range: [234, 237], + loc: { + start: { column: 3, line: 11 }, + end: { column: 6, line: 11 }, + }, + }, + optional: true, + + range: [234, 241], + loc: { + start: { column: 3, line: 11 }, + end: { column: 10, line: 11 }, + }, + }, + + range: [234, 241], + loc: { + start: { column: 3, line: 11 }, + end: { column: 10, line: 11 }, + }, + }, + optional: false, + + range: [233, 244], + loc: { + start: { column: 2, line: 11 }, + end: { column: 13, line: 11 }, + }, + }, + + range: [233, 245], + loc: { + start: { column: 2, line: 11 }, + end: { column: 14, line: 11 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "one", + + range: [248, 251], + loc: { + start: { column: 2, line: 12 }, + end: { column: 5, line: 12 }, + }, + }, + optional: true, + + range: [248, 255], + loc: { + start: { column: 2, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + optional: true, + + range: [248, 259], + loc: { + start: { column: 2, line: 12 }, + end: { column: 13, line: 12 }, + }, + }, + + range: [248, 259], + loc: { + start: { column: 2, line: 12 }, + end: { column: 13, line: 12 }, + }, + }, + + range: [248, 260], + loc: { + start: { column: 2, line: 12 }, + end: { column: 14, line: 12 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "one", + + range: [265, 268], + loc: { + start: { column: 3, line: 14 }, + end: { column: 6, line: 14 }, + }, + }, + optional: true, + + range: [265, 272], + loc: { + start: { column: 3, line: 14 }, + end: { column: 10, line: 14 }, + }, + }, + + range: [265, 272], + loc: { + start: { column: 3, line: 14 }, + end: { column: 10, line: 14 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [274, 277], + loc: { + start: { column: 12, line: 14 }, + end: { column: 15, line: 14 }, + }, + }, + + range: [264, 277], + loc: { + start: { column: 2, line: 14 }, + end: { column: 15, line: 14 }, + }, + }, + + range: [264, 278], + loc: { + start: { column: 2, line: 14 }, + end: { column: 16, line: 14 }, + }, + }, + ], + + range: [119, 280], + loc: { + start: { column: 46, line: 3 }, + end: { column: 1, line: 15 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "processOptionalCallParens", + + range: [82, 107], + loc: { + start: { column: 9, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "one", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [114, 117], + loc: { + start: { column: 41, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [112, 117], + loc: { + start: { column: 39, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [108, 117], + loc: { + start: { column: 35, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + ], + + range: [73, 280], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 15 }, + }, + }, + ], + sourceType: "script", + + range: [73, 281], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 16 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..459e74257b08 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,876 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-call-with-parens TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "processOptionalCallParens", + + range: [82, 107], + loc: { + start: { column: 9, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [108, 111], + loc: { + start: { column: 35, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [114, 117], + loc: { + start: { column: 41, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [123, 126], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [126, 128], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [128, 130], + loc: { + start: { column: 7, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [130, 131], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [131, 132], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [132, 133], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [136, 137], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [137, 140], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [140, 142], + loc: { + start: { column: 6, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [142, 145], + loc: { + start: { column: 8, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [145, 146], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [146, 147], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [147, 149], + loc: { + start: { column: 13, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [149, 150], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [150, 151], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [151, 152], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [155, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [158, 159], + loc: { + start: { column: 5, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [159, 162], + loc: { + start: { column: 6, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [162, 164], + loc: { + start: { column: 9, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [164, 166], + loc: { + start: { column: 11, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [166, 167], + loc: { + start: { column: 13, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [167, 168], + loc: { + start: { column: 14, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [168, 169], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [172, 173], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [173, 176], + loc: { + start: { column: 3, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [176, 177], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [177, 180], + loc: { + start: { column: 7, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [180, 182], + loc: { + start: { column: 10, line: 7 }, + end: { column: 12, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [182, 187], + loc: { + start: { column: 12, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [187, 188], + loc: { + start: { column: 17, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [188, 189], + loc: { + start: { column: 18, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [189, 191], + loc: { + start: { column: 19, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [191, 192], + loc: { + start: { column: 21, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [192, 193], + loc: { + start: { column: 22, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [193, 194], + loc: { + start: { column: 23, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [197, 200], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [200, 201], + loc: { + start: { column: 5, line: 8 }, + end: { column: 6, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [201, 204], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [204, 206], + loc: { + start: { column: 9, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [206, 211], + loc: { + start: { column: 11, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [211, 213], + loc: { + start: { column: 16, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [213, 215], + loc: { + start: { column: 18, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [215, 216], + loc: { + start: { column: 20, line: 8 }, + end: { column: 21, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [216, 217], + loc: { + start: { column: 21, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [217, 218], + loc: { + start: { column: 22, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [222, 225], + loc: { + start: { column: 2, line: 10 }, + end: { column: 5, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [225, 227], + loc: { + start: { column: 5, line: 10 }, + end: { column: 7, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [227, 228], + loc: { + start: { column: 7, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [228, 229], + loc: { + start: { column: 8, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [229, 230], + loc: { + start: { column: 9, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [233, 234], + loc: { + start: { column: 2, line: 11 }, + end: { column: 3, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [234, 237], + loc: { + start: { column: 3, line: 11 }, + end: { column: 6, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [237, 239], + loc: { + start: { column: 6, line: 11 }, + end: { column: 8, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [239, 240], + loc: { + start: { column: 8, line: 11 }, + end: { column: 9, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [240, 241], + loc: { + start: { column: 9, line: 11 }, + end: { column: 10, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [241, 242], + loc: { + start: { column: 10, line: 11 }, + end: { column: 11, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [242, 243], + loc: { + start: { column: 11, line: 11 }, + end: { column: 12, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [243, 244], + loc: { + start: { column: 12, line: 11 }, + end: { column: 13, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [244, 245], + loc: { + start: { column: 13, line: 11 }, + end: { column: 14, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [248, 251], + loc: { + start: { column: 2, line: 12 }, + end: { column: 5, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [251, 253], + loc: { + start: { column: 5, line: 12 }, + end: { column: 7, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [253, 254], + loc: { + start: { column: 7, line: 12 }, + end: { column: 8, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [254, 255], + loc: { + start: { column: 8, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [255, 257], + loc: { + start: { column: 9, line: 12 }, + end: { column: 11, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [257, 258], + loc: { + start: { column: 11, line: 12 }, + end: { column: 12, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [258, 259], + loc: { + start: { column: 12, line: 12 }, + end: { column: 13, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [259, 260], + loc: { + start: { column: 13, line: 12 }, + end: { column: 14, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [264, 265], + loc: { + start: { column: 2, line: 14 }, + end: { column: 3, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [265, 268], + loc: { + start: { column: 3, line: 14 }, + end: { column: 6, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [268, 270], + loc: { + start: { column: 6, line: 14 }, + end: { column: 8, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [270, 271], + loc: { + start: { column: 8, line: 14 }, + end: { column: 9, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [271, 272], + loc: { + start: { column: 9, line: 14 }, + end: { column: 10, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [272, 273], + loc: { + start: { column: 10, line: 14 }, + end: { column: 11, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [273, 274], + loc: { + start: { column: 11, line: 14 }, + end: { column: 12, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [274, 277], + loc: { + start: { column: 12, line: 14 }, + end: { column: 15, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [277, 278], + loc: { + start: { column: 15, line: 14 }, + end: { column: 16, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [279, 280], + loc: { + start: { column: 0, line: 15 }, + end: { column: 1, line: 15 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..0ce3d2d09b0f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/3-Babel-AST.shot @@ -0,0 +1,705 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-call-with-parens Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [123, 126], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "fn", + + range: [128, 130], + loc: { + start: { column: 7, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [123, 130], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + optional: false, + + range: [123, 132], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + + range: [123, 132], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + + range: [123, 133], + loc: { + start: { column: 2, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [137, 140], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [142, 145], + loc: { + start: { column: 8, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [137, 145], + loc: { + start: { column: 3, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [137, 145], + loc: { + start: { column: 3, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "fn", + + range: [147, 149], + loc: { + start: { column: 13, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [136, 149], + loc: { + start: { column: 2, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + optional: false, + + range: [136, 151], + loc: { + start: { column: 2, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [136, 152], + loc: { + start: { column: 2, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [155, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [159, 162], + loc: { + start: { column: 6, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + + range: [155, 162], + loc: { + start: { column: 2, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "fn", + + range: [164, 166], + loc: { + start: { column: 11, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + + range: [155, 166], + loc: { + start: { column: 2, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + optional: false, + + range: [155, 168], + loc: { + start: { column: 2, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [155, 168], + loc: { + start: { column: 2, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [155, 169], + loc: { + start: { column: 2, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [173, 176], + loc: { + start: { column: 3, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [177, 180], + loc: { + start: { column: 7, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + + range: [173, 180], + loc: { + start: { column: 3, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "three", + + range: [182, 187], + loc: { + start: { column: 12, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + + range: [173, 187], + loc: { + start: { column: 3, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + + range: [173, 187], + loc: { + start: { column: 3, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "fn", + + range: [189, 191], + loc: { + start: { column: 19, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + + range: [172, 191], + loc: { + start: { column: 2, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + optional: false, + + range: [172, 193], + loc: { + start: { column: 2, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + + range: [172, 194], + loc: { + start: { column: 2, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [197, 200], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [201, 204], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + + range: [197, 204], + loc: { + start: { column: 2, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "three", + + range: [206, 211], + loc: { + start: { column: 11, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + + range: [197, 211], + loc: { + start: { column: 2, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "fn", + + range: [213, 215], + loc: { + start: { column: 18, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + + range: [197, 215], + loc: { + start: { column: 2, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + optional: false, + + range: [197, 217], + loc: { + start: { column: 2, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [197, 217], + loc: { + start: { column: 2, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [197, 218], + loc: { + start: { column: 2, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "one", + + range: [222, 225], + loc: { + start: { column: 2, line: 10 }, + end: { column: 5, line: 10 }, + }, + }, + optional: true, + + range: [222, 229], + loc: { + start: { column: 2, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + + range: [222, 229], + loc: { + start: { column: 2, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + + range: [222, 230], + loc: { + start: { column: 2, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "one", + + range: [234, 237], + loc: { + start: { column: 3, line: 11 }, + end: { column: 6, line: 11 }, + }, + }, + optional: true, + + range: [234, 241], + loc: { + start: { column: 3, line: 11 }, + end: { column: 10, line: 11 }, + }, + }, + + range: [234, 241], + loc: { + start: { column: 3, line: 11 }, + end: { column: 10, line: 11 }, + }, + }, + optional: false, + + range: [233, 244], + loc: { + start: { column: 2, line: 11 }, + end: { column: 13, line: 11 }, + }, + }, + + range: [233, 245], + loc: { + start: { column: 2, line: 11 }, + end: { column: 14, line: 11 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "one", + + range: [248, 251], + loc: { + start: { column: 2, line: 12 }, + end: { column: 5, line: 12 }, + }, + }, + optional: true, + + range: [248, 255], + loc: { + start: { column: 2, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + optional: true, + + range: [248, 259], + loc: { + start: { column: 2, line: 12 }, + end: { column: 13, line: 12 }, + }, + }, + + range: [248, 259], + loc: { + start: { column: 2, line: 12 }, + end: { column: 13, line: 12 }, + }, + }, + + range: [248, 260], + loc: { + start: { column: 2, line: 12 }, + end: { column: 14, line: 12 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "one", + + range: [265, 268], + loc: { + start: { column: 3, line: 14 }, + end: { column: 6, line: 14 }, + }, + }, + optional: true, + + range: [265, 272], + loc: { + start: { column: 3, line: 14 }, + end: { column: 10, line: 14 }, + }, + }, + + range: [265, 272], + loc: { + start: { column: 3, line: 14 }, + end: { column: 10, line: 14 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [274, 277], + loc: { + start: { column: 12, line: 14 }, + end: { column: 15, line: 14 }, + }, + }, + + range: [264, 277], + loc: { + start: { column: 2, line: 14 }, + end: { column: 15, line: 14 }, + }, + }, + + range: [264, 278], + loc: { + start: { column: 2, line: 14 }, + end: { column: 16, line: 14 }, + }, + }, + ], + + range: [119, 280], + loc: { + start: { column: 46, line: 3 }, + end: { column: 1, line: 15 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "processOptionalCallParens", + + range: [82, 107], + loc: { + start: { column: 9, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "one", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [114, 117], + loc: { + start: { column: 41, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [112, 117], + loc: { + start: { column: 39, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [108, 117], + loc: { + start: { column: 35, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + ], + + range: [73, 280], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 15 }, + }, + }, + ], + sourceType: "script", + + range: [73, 281], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 16 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..0cb653ce6e1d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,876 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-call-with-parens Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "processOptionalCallParens", + + range: [82, 107], + loc: { + start: { column: 9, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [108, 111], + loc: { + start: { column: 35, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [114, 117], + loc: { + start: { column: 41, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [123, 126], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [126, 128], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [128, 130], + loc: { + start: { column: 7, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [130, 131], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [131, 132], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [132, 133], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [136, 137], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [137, 140], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [140, 142], + loc: { + start: { column: 6, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [142, 145], + loc: { + start: { column: 8, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [145, 146], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [146, 147], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [147, 149], + loc: { + start: { column: 13, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [149, 150], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [150, 151], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [151, 152], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [155, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [158, 159], + loc: { + start: { column: 5, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [159, 162], + loc: { + start: { column: 6, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [162, 164], + loc: { + start: { column: 9, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [164, 166], + loc: { + start: { column: 11, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [166, 167], + loc: { + start: { column: 13, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [167, 168], + loc: { + start: { column: 14, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [168, 169], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [172, 173], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [173, 176], + loc: { + start: { column: 3, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [176, 177], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [177, 180], + loc: { + start: { column: 7, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [180, 182], + loc: { + start: { column: 10, line: 7 }, + end: { column: 12, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [182, 187], + loc: { + start: { column: 12, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [187, 188], + loc: { + start: { column: 17, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [188, 189], + loc: { + start: { column: 18, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [189, 191], + loc: { + start: { column: 19, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [191, 192], + loc: { + start: { column: 21, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [192, 193], + loc: { + start: { column: 22, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [193, 194], + loc: { + start: { column: 23, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [197, 200], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [200, 201], + loc: { + start: { column: 5, line: 8 }, + end: { column: 6, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [201, 204], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [204, 206], + loc: { + start: { column: 9, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [206, 211], + loc: { + start: { column: 11, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [211, 213], + loc: { + start: { column: 16, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [213, 215], + loc: { + start: { column: 18, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [215, 216], + loc: { + start: { column: 20, line: 8 }, + end: { column: 21, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [216, 217], + loc: { + start: { column: 21, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [217, 218], + loc: { + start: { column: 22, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [222, 225], + loc: { + start: { column: 2, line: 10 }, + end: { column: 5, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [225, 227], + loc: { + start: { column: 5, line: 10 }, + end: { column: 7, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [227, 228], + loc: { + start: { column: 7, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [228, 229], + loc: { + start: { column: 8, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [229, 230], + loc: { + start: { column: 9, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [233, 234], + loc: { + start: { column: 2, line: 11 }, + end: { column: 3, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [234, 237], + loc: { + start: { column: 3, line: 11 }, + end: { column: 6, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [237, 239], + loc: { + start: { column: 6, line: 11 }, + end: { column: 8, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [239, 240], + loc: { + start: { column: 8, line: 11 }, + end: { column: 9, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [240, 241], + loc: { + start: { column: 9, line: 11 }, + end: { column: 10, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [241, 242], + loc: { + start: { column: 10, line: 11 }, + end: { column: 11, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [242, 243], + loc: { + start: { column: 11, line: 11 }, + end: { column: 12, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [243, 244], + loc: { + start: { column: 12, line: 11 }, + end: { column: 13, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [244, 245], + loc: { + start: { column: 13, line: 11 }, + end: { column: 14, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [248, 251], + loc: { + start: { column: 2, line: 12 }, + end: { column: 5, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [251, 253], + loc: { + start: { column: 5, line: 12 }, + end: { column: 7, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [253, 254], + loc: { + start: { column: 7, line: 12 }, + end: { column: 8, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [254, 255], + loc: { + start: { column: 8, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [255, 257], + loc: { + start: { column: 9, line: 12 }, + end: { column: 11, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [257, 258], + loc: { + start: { column: 11, line: 12 }, + end: { column: 12, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [258, 259], + loc: { + start: { column: 12, line: 12 }, + end: { column: 13, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [259, 260], + loc: { + start: { column: 13, line: 12 }, + end: { column: 14, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [264, 265], + loc: { + start: { column: 2, line: 14 }, + end: { column: 3, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [265, 268], + loc: { + start: { column: 3, line: 14 }, + end: { column: 6, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [268, 270], + loc: { + start: { column: 6, line: 14 }, + end: { column: 8, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [270, 271], + loc: { + start: { column: 8, line: 14 }, + end: { column: 9, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [271, 272], + loc: { + start: { column: 9, line: 14 }, + end: { column: 10, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [272, 273], + loc: { + start: { column: 10, line: 14 }, + end: { column: 11, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [273, 274], + loc: { + start: { column: 11, line: 14 }, + end: { column: 12, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [274, 277], + loc: { + start: { column: 12, line: 14 }, + end: { column: 15, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [277, 278], + loc: { + start: { column: 15, line: 14 }, + end: { column: 16, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [279, 280], + loc: { + start: { column: 0, line: 15 }, + end: { column: 1, line: 15 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..0227f0b9ac02 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-call-with-parens AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..bd88ee6daadd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-call-with-parens AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/fixture.ts new file mode 100644 index 000000000000..b66e80618833 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/fixture.ts @@ -0,0 +1,15 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function processOptionalCall(one?: any) { + one?.fn(); + one?.two.fn(); + one.two?.fn(); + one.two?.three.fn(); + one.two?.three?.fn(); + + one?.(); + one?.()(); + one?.()?.(); + + one?.().two; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..87b6812a00bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,705 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-call TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [117, 120], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "fn", + + range: [122, 124], + loc: { + start: { column: 7, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [117, 124], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + optional: false, + + range: [117, 126], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + + range: [117, 126], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + + range: [117, 127], + loc: { + start: { column: 2, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [130, 133], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [135, 138], + loc: { + start: { column: 7, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + + range: [130, 138], + loc: { + start: { column: 2, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "fn", + + range: [139, 141], + loc: { + start: { column: 11, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [130, 141], + loc: { + start: { column: 2, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + optional: false, + + range: [130, 143], + loc: { + start: { column: 2, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [130, 143], + loc: { + start: { column: 2, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [130, 144], + loc: { + start: { column: 2, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [147, 150], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [151, 154], + loc: { + start: { column: 6, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + + range: [147, 154], + loc: { + start: { column: 2, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "fn", + + range: [156, 158], + loc: { + start: { column: 11, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + + range: [147, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + optional: false, + + range: [147, 160], + loc: { + start: { column: 2, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [147, 160], + loc: { + start: { column: 2, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [147, 161], + loc: { + start: { column: 2, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [164, 167], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [168, 171], + loc: { + start: { column: 6, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + + range: [164, 171], + loc: { + start: { column: 2, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "three", + + range: [173, 178], + loc: { + start: { column: 11, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + + range: [164, 178], + loc: { + start: { column: 2, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "fn", + + range: [179, 181], + loc: { + start: { column: 17, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + + range: [164, 181], + loc: { + start: { column: 2, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + optional: false, + + range: [164, 183], + loc: { + start: { column: 2, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + + range: [164, 183], + loc: { + start: { column: 2, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + + range: [164, 184], + loc: { + start: { column: 2, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [187, 190], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [191, 194], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + + range: [187, 194], + loc: { + start: { column: 2, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "three", + + range: [196, 201], + loc: { + start: { column: 11, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + + range: [187, 201], + loc: { + start: { column: 2, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "fn", + + range: [203, 205], + loc: { + start: { column: 18, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + + range: [187, 205], + loc: { + start: { column: 2, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + optional: false, + + range: [187, 207], + loc: { + start: { column: 2, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [187, 207], + loc: { + start: { column: 2, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [187, 208], + loc: { + start: { column: 2, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "one", + + range: [212, 215], + loc: { + start: { column: 2, line: 10 }, + end: { column: 5, line: 10 }, + }, + }, + optional: true, + + range: [212, 219], + loc: { + start: { column: 2, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + + range: [212, 219], + loc: { + start: { column: 2, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + + range: [212, 220], + loc: { + start: { column: 2, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "one", + + range: [223, 226], + loc: { + start: { column: 2, line: 11 }, + end: { column: 5, line: 11 }, + }, + }, + optional: true, + + range: [223, 230], + loc: { + start: { column: 2, line: 11 }, + end: { column: 9, line: 11 }, + }, + }, + optional: false, + + range: [223, 232], + loc: { + start: { column: 2, line: 11 }, + end: { column: 11, line: 11 }, + }, + }, + + range: [223, 232], + loc: { + start: { column: 2, line: 11 }, + end: { column: 11, line: 11 }, + }, + }, + + range: [223, 233], + loc: { + start: { column: 2, line: 11 }, + end: { column: 12, line: 11 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "one", + + range: [236, 239], + loc: { + start: { column: 2, line: 12 }, + end: { column: 5, line: 12 }, + }, + }, + optional: true, + + range: [236, 243], + loc: { + start: { column: 2, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + optional: true, + + range: [236, 247], + loc: { + start: { column: 2, line: 12 }, + end: { column: 13, line: 12 }, + }, + }, + + range: [236, 247], + loc: { + start: { column: 2, line: 12 }, + end: { column: 13, line: 12 }, + }, + }, + + range: [236, 248], + loc: { + start: { column: 2, line: 12 }, + end: { column: 14, line: 12 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "one", + + range: [252, 255], + loc: { + start: { column: 2, line: 14 }, + end: { column: 5, line: 14 }, + }, + }, + optional: true, + + range: [252, 259], + loc: { + start: { column: 2, line: 14 }, + end: { column: 9, line: 14 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [260, 263], + loc: { + start: { column: 10, line: 14 }, + end: { column: 13, line: 14 }, + }, + }, + + range: [252, 263], + loc: { + start: { column: 2, line: 14 }, + end: { column: 13, line: 14 }, + }, + }, + + range: [252, 263], + loc: { + start: { column: 2, line: 14 }, + end: { column: 13, line: 14 }, + }, + }, + + range: [252, 264], + loc: { + start: { column: 2, line: 14 }, + end: { column: 14, line: 14 }, + }, + }, + ], + + range: [113, 266], + loc: { + start: { column: 40, line: 3 }, + end: { column: 1, line: 15 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "processOptionalCall", + + range: [82, 101], + loc: { + start: { column: 9, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "one", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [108, 111], + loc: { + start: { column: 35, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [106, 111], + loc: { + start: { column: 33, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [102, 111], + loc: { + start: { column: 29, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + ], + + range: [73, 266], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 15 }, + }, + }, + ], + sourceType: "script", + + range: [73, 267], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 16 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..a6166185578b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,796 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-call TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "processOptionalCall", + + range: [82, 101], + loc: { + start: { column: 9, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [102, 105], + loc: { + start: { column: 29, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [108, 111], + loc: { + start: { column: 35, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [113, 114], + loc: { + start: { column: 40, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [117, 120], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [120, 122], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [122, 124], + loc: { + start: { column: 7, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [124, 125], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [125, 126], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [126, 127], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [130, 133], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [133, 135], + loc: { + start: { column: 5, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [135, 138], + loc: { + start: { column: 7, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [138, 139], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [139, 141], + loc: { + start: { column: 11, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [141, 142], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [142, 143], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [143, 144], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [147, 150], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [150, 151], + loc: { + start: { column: 5, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [151, 154], + loc: { + start: { column: 6, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [154, 156], + loc: { + start: { column: 9, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [156, 158], + loc: { + start: { column: 11, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [158, 159], + loc: { + start: { column: 13, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [159, 160], + loc: { + start: { column: 14, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [160, 161], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [164, 167], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [167, 168], + loc: { + start: { column: 5, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [168, 171], + loc: { + start: { column: 6, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [171, 173], + loc: { + start: { column: 9, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [173, 178], + loc: { + start: { column: 11, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [178, 179], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [179, 181], + loc: { + start: { column: 17, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [181, 182], + loc: { + start: { column: 19, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [182, 183], + loc: { + start: { column: 20, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [183, 184], + loc: { + start: { column: 21, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [187, 190], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [190, 191], + loc: { + start: { column: 5, line: 8 }, + end: { column: 6, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [191, 194], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [194, 196], + loc: { + start: { column: 9, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [196, 201], + loc: { + start: { column: 11, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [201, 203], + loc: { + start: { column: 16, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [203, 205], + loc: { + start: { column: 18, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [205, 206], + loc: { + start: { column: 20, line: 8 }, + end: { column: 21, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [206, 207], + loc: { + start: { column: 21, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [207, 208], + loc: { + start: { column: 22, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [212, 215], + loc: { + start: { column: 2, line: 10 }, + end: { column: 5, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [215, 217], + loc: { + start: { column: 5, line: 10 }, + end: { column: 7, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [217, 218], + loc: { + start: { column: 7, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [218, 219], + loc: { + start: { column: 8, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [219, 220], + loc: { + start: { column: 9, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [223, 226], + loc: { + start: { column: 2, line: 11 }, + end: { column: 5, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [226, 228], + loc: { + start: { column: 5, line: 11 }, + end: { column: 7, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [228, 229], + loc: { + start: { column: 7, line: 11 }, + end: { column: 8, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [229, 230], + loc: { + start: { column: 8, line: 11 }, + end: { column: 9, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [230, 231], + loc: { + start: { column: 9, line: 11 }, + end: { column: 10, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [231, 232], + loc: { + start: { column: 10, line: 11 }, + end: { column: 11, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [232, 233], + loc: { + start: { column: 11, line: 11 }, + end: { column: 12, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [236, 239], + loc: { + start: { column: 2, line: 12 }, + end: { column: 5, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [239, 241], + loc: { + start: { column: 5, line: 12 }, + end: { column: 7, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [241, 242], + loc: { + start: { column: 7, line: 12 }, + end: { column: 8, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [242, 243], + loc: { + start: { column: 8, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [243, 245], + loc: { + start: { column: 9, line: 12 }, + end: { column: 11, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [245, 246], + loc: { + start: { column: 11, line: 12 }, + end: { column: 12, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [246, 247], + loc: { + start: { column: 12, line: 12 }, + end: { column: 13, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [247, 248], + loc: { + start: { column: 13, line: 12 }, + end: { column: 14, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [252, 255], + loc: { + start: { column: 2, line: 14 }, + end: { column: 5, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [255, 257], + loc: { + start: { column: 5, line: 14 }, + end: { column: 7, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [257, 258], + loc: { + start: { column: 7, line: 14 }, + end: { column: 8, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [258, 259], + loc: { + start: { column: 8, line: 14 }, + end: { column: 9, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [259, 260], + loc: { + start: { column: 9, line: 14 }, + end: { column: 10, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [260, 263], + loc: { + start: { column: 10, line: 14 }, + end: { column: 13, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [263, 264], + loc: { + start: { column: 13, line: 14 }, + end: { column: 14, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [265, 266], + loc: { + start: { column: 0, line: 15 }, + end: { column: 1, line: 15 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..3a333f4accce --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/3-Babel-AST.shot @@ -0,0 +1,705 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-call Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [117, 120], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "fn", + + range: [122, 124], + loc: { + start: { column: 7, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [117, 124], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + optional: false, + + range: [117, 126], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + + range: [117, 126], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + + range: [117, 127], + loc: { + start: { column: 2, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [130, 133], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [135, 138], + loc: { + start: { column: 7, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + + range: [130, 138], + loc: { + start: { column: 2, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "fn", + + range: [139, 141], + loc: { + start: { column: 11, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [130, 141], + loc: { + start: { column: 2, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + optional: false, + + range: [130, 143], + loc: { + start: { column: 2, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [130, 143], + loc: { + start: { column: 2, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [130, 144], + loc: { + start: { column: 2, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [147, 150], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [151, 154], + loc: { + start: { column: 6, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + + range: [147, 154], + loc: { + start: { column: 2, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "fn", + + range: [156, 158], + loc: { + start: { column: 11, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + + range: [147, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + optional: false, + + range: [147, 160], + loc: { + start: { column: 2, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [147, 160], + loc: { + start: { column: 2, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [147, 161], + loc: { + start: { column: 2, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [164, 167], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [168, 171], + loc: { + start: { column: 6, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + + range: [164, 171], + loc: { + start: { column: 2, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "three", + + range: [173, 178], + loc: { + start: { column: 11, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + + range: [164, 178], + loc: { + start: { column: 2, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "fn", + + range: [179, 181], + loc: { + start: { column: 17, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + + range: [164, 181], + loc: { + start: { column: 2, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + optional: false, + + range: [164, 183], + loc: { + start: { column: 2, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + + range: [164, 183], + loc: { + start: { column: 2, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + + range: [164, 184], + loc: { + start: { column: 2, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [187, 190], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [191, 194], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + + range: [187, 194], + loc: { + start: { column: 2, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "three", + + range: [196, 201], + loc: { + start: { column: 11, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + + range: [187, 201], + loc: { + start: { column: 2, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "fn", + + range: [203, 205], + loc: { + start: { column: 18, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + + range: [187, 205], + loc: { + start: { column: 2, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + optional: false, + + range: [187, 207], + loc: { + start: { column: 2, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [187, 207], + loc: { + start: { column: 2, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [187, 208], + loc: { + start: { column: 2, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "one", + + range: [212, 215], + loc: { + start: { column: 2, line: 10 }, + end: { column: 5, line: 10 }, + }, + }, + optional: true, + + range: [212, 219], + loc: { + start: { column: 2, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + + range: [212, 219], + loc: { + start: { column: 2, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + + range: [212, 220], + loc: { + start: { column: 2, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "one", + + range: [223, 226], + loc: { + start: { column: 2, line: 11 }, + end: { column: 5, line: 11 }, + }, + }, + optional: true, + + range: [223, 230], + loc: { + start: { column: 2, line: 11 }, + end: { column: 9, line: 11 }, + }, + }, + optional: false, + + range: [223, 232], + loc: { + start: { column: 2, line: 11 }, + end: { column: 11, line: 11 }, + }, + }, + + range: [223, 232], + loc: { + start: { column: 2, line: 11 }, + end: { column: 11, line: 11 }, + }, + }, + + range: [223, 233], + loc: { + start: { column: 2, line: 11 }, + end: { column: 12, line: 11 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "one", + + range: [236, 239], + loc: { + start: { column: 2, line: 12 }, + end: { column: 5, line: 12 }, + }, + }, + optional: true, + + range: [236, 243], + loc: { + start: { column: 2, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + optional: true, + + range: [236, 247], + loc: { + start: { column: 2, line: 12 }, + end: { column: 13, line: 12 }, + }, + }, + + range: [236, 247], + loc: { + start: { column: 2, line: 12 }, + end: { column: 13, line: 12 }, + }, + }, + + range: [236, 248], + loc: { + start: { column: 2, line: 12 }, + end: { column: 14, line: 12 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "one", + + range: [252, 255], + loc: { + start: { column: 2, line: 14 }, + end: { column: 5, line: 14 }, + }, + }, + optional: true, + + range: [252, 259], + loc: { + start: { column: 2, line: 14 }, + end: { column: 9, line: 14 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [260, 263], + loc: { + start: { column: 10, line: 14 }, + end: { column: 13, line: 14 }, + }, + }, + + range: [252, 263], + loc: { + start: { column: 2, line: 14 }, + end: { column: 13, line: 14 }, + }, + }, + + range: [252, 263], + loc: { + start: { column: 2, line: 14 }, + end: { column: 13, line: 14 }, + }, + }, + + range: [252, 264], + loc: { + start: { column: 2, line: 14 }, + end: { column: 14, line: 14 }, + }, + }, + ], + + range: [113, 266], + loc: { + start: { column: 40, line: 3 }, + end: { column: 1, line: 15 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "processOptionalCall", + + range: [82, 101], + loc: { + start: { column: 9, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "one", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [108, 111], + loc: { + start: { column: 35, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [106, 111], + loc: { + start: { column: 33, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [102, 111], + loc: { + start: { column: 29, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + ], + + range: [73, 266], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 15 }, + }, + }, + ], + sourceType: "script", + + range: [73, 267], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 16 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..0d13f439c057 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,796 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-call Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "processOptionalCall", + + range: [82, 101], + loc: { + start: { column: 9, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [102, 105], + loc: { + start: { column: 29, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [108, 111], + loc: { + start: { column: 35, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [113, 114], + loc: { + start: { column: 40, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [117, 120], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [120, 122], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [122, 124], + loc: { + start: { column: 7, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [124, 125], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [125, 126], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [126, 127], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [130, 133], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [133, 135], + loc: { + start: { column: 5, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [135, 138], + loc: { + start: { column: 7, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [138, 139], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [139, 141], + loc: { + start: { column: 11, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [141, 142], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [142, 143], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [143, 144], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [147, 150], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [150, 151], + loc: { + start: { column: 5, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [151, 154], + loc: { + start: { column: 6, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [154, 156], + loc: { + start: { column: 9, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [156, 158], + loc: { + start: { column: 11, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [158, 159], + loc: { + start: { column: 13, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [159, 160], + loc: { + start: { column: 14, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [160, 161], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [164, 167], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [167, 168], + loc: { + start: { column: 5, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [168, 171], + loc: { + start: { column: 6, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [171, 173], + loc: { + start: { column: 9, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [173, 178], + loc: { + start: { column: 11, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [178, 179], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [179, 181], + loc: { + start: { column: 17, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [181, 182], + loc: { + start: { column: 19, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [182, 183], + loc: { + start: { column: 20, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [183, 184], + loc: { + start: { column: 21, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [187, 190], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [190, 191], + loc: { + start: { column: 5, line: 8 }, + end: { column: 6, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [191, 194], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [194, 196], + loc: { + start: { column: 9, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [196, 201], + loc: { + start: { column: 11, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [201, 203], + loc: { + start: { column: 16, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [203, 205], + loc: { + start: { column: 18, line: 8 }, + end: { column: 20, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [205, 206], + loc: { + start: { column: 20, line: 8 }, + end: { column: 21, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [206, 207], + loc: { + start: { column: 21, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [207, 208], + loc: { + start: { column: 22, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [212, 215], + loc: { + start: { column: 2, line: 10 }, + end: { column: 5, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [215, 217], + loc: { + start: { column: 5, line: 10 }, + end: { column: 7, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [217, 218], + loc: { + start: { column: 7, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [218, 219], + loc: { + start: { column: 8, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [219, 220], + loc: { + start: { column: 9, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [223, 226], + loc: { + start: { column: 2, line: 11 }, + end: { column: 5, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [226, 228], + loc: { + start: { column: 5, line: 11 }, + end: { column: 7, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [228, 229], + loc: { + start: { column: 7, line: 11 }, + end: { column: 8, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [229, 230], + loc: { + start: { column: 8, line: 11 }, + end: { column: 9, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [230, 231], + loc: { + start: { column: 9, line: 11 }, + end: { column: 10, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [231, 232], + loc: { + start: { column: 10, line: 11 }, + end: { column: 11, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [232, 233], + loc: { + start: { column: 11, line: 11 }, + end: { column: 12, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [236, 239], + loc: { + start: { column: 2, line: 12 }, + end: { column: 5, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [239, 241], + loc: { + start: { column: 5, line: 12 }, + end: { column: 7, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [241, 242], + loc: { + start: { column: 7, line: 12 }, + end: { column: 8, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [242, 243], + loc: { + start: { column: 8, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [243, 245], + loc: { + start: { column: 9, line: 12 }, + end: { column: 11, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [245, 246], + loc: { + start: { column: 11, line: 12 }, + end: { column: 12, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [246, 247], + loc: { + start: { column: 12, line: 12 }, + end: { column: 13, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [247, 248], + loc: { + start: { column: 13, line: 12 }, + end: { column: 14, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [252, 255], + loc: { + start: { column: 2, line: 14 }, + end: { column: 5, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [255, 257], + loc: { + start: { column: 5, line: 14 }, + end: { column: 7, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [257, 258], + loc: { + start: { column: 7, line: 14 }, + end: { column: 8, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [258, 259], + loc: { + start: { column: 8, line: 14 }, + end: { column: 9, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [259, 260], + loc: { + start: { column: 9, line: 14 }, + end: { column: 10, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [260, 263], + loc: { + start: { column: 10, line: 14 }, + end: { column: 13, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [263, 264], + loc: { + start: { column: 13, line: 14 }, + end: { column: 14, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [265, 266], + loc: { + start: { column: 0, line: 15 }, + end: { column: 1, line: 15 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..46ac1db8b246 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-call AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..8ecb39c73969 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-call AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/fixture.ts new file mode 100644 index 000000000000..59f08fbc77bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/fixture.ts @@ -0,0 +1,10 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function processOptional(one?: any) { + one?.['two']!.three; + (one?.['two'])!.three; + (one?.['two'])!.three; + one?.two!['three']; + (one?.two)!['three']; + (one?.two)!['three']; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..0bf80db96652 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,560 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-element-access-with-non-null-assertion TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [113, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "'two'", + value: "two", + + range: [119, 124], + loc: { + start: { column: 8, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [113, 125], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + + range: [113, 126], + loc: { + start: { column: 2, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "three", + + range: [127, 132], + loc: { + start: { column: 16, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [113, 132], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [113, 132], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [113, 133], + loc: { + start: { column: 2, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [137, 140], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "'two'", + value: "two", + + range: [143, 148], + loc: { + start: { column: 9, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + + range: [137, 149], + loc: { + start: { column: 3, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [137, 149], + loc: { + start: { column: 3, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [136, 151], + loc: { + start: { column: 2, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "three", + + range: [152, 157], + loc: { + start: { column: 18, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + + range: [136, 157], + loc: { + start: { column: 2, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + + range: [136, 158], + loc: { + start: { column: 2, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [162, 165], + loc: { + start: { column: 3, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "'two'", + value: "two", + + range: [168, 173], + loc: { + start: { column: 9, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + + range: [162, 174], + loc: { + start: { column: 3, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [162, 174], + loc: { + start: { column: 3, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [161, 176], + loc: { + start: { column: 2, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "three", + + range: [177, 182], + loc: { + start: { column: 18, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + + range: [161, 182], + loc: { + start: { column: 2, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + + range: [161, 183], + loc: { + start: { column: 2, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [186, 189], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [191, 194], + loc: { + start: { column: 7, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + + range: [186, 194], + loc: { + start: { column: 2, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + + range: [186, 195], + loc: { + start: { column: 2, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "'three'", + value: "three", + + range: [196, 203], + loc: { + start: { column: 12, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + + range: [186, 204], + loc: { + start: { column: 2, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + + range: [186, 204], + loc: { + start: { column: 2, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + + range: [186, 205], + loc: { + start: { column: 2, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [209, 212], + loc: { + start: { column: 3, line: 8 }, + end: { column: 6, line: 8 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [214, 217], + loc: { + start: { column: 8, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + + range: [209, 217], + loc: { + start: { column: 3, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + + range: [209, 217], + loc: { + start: { column: 3, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + + range: [208, 219], + loc: { + start: { column: 2, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "'three'", + value: "three", + + range: [220, 227], + loc: { + start: { column: 14, line: 8 }, + end: { column: 21, line: 8 }, + }, + }, + + range: [208, 228], + loc: { + start: { column: 2, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [208, 229], + loc: { + start: { column: 2, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [233, 236], + loc: { + start: { column: 3, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [238, 241], + loc: { + start: { column: 8, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + + range: [233, 241], + loc: { + start: { column: 3, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + + range: [233, 241], + loc: { + start: { column: 3, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + + range: [232, 243], + loc: { + start: { column: 2, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "'three'", + value: "three", + + range: [244, 251], + loc: { + start: { column: 14, line: 9 }, + end: { column: 21, line: 9 }, + }, + }, + + range: [232, 252], + loc: { + start: { column: 2, line: 9 }, + end: { column: 22, line: 9 }, + }, + }, + + range: [232, 253], + loc: { + start: { column: 2, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + ], + + range: [109, 255], + loc: { + start: { column: 36, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "processOptional", + + range: [82, 97], + loc: { + start: { column: 9, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "one", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [102, 107], + loc: { + start: { column: 29, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [98, 107], + loc: { + start: { column: 25, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + + range: [73, 255], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 256], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..0f5da703e774 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,696 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-element-access-with-non-null-assertion TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "processOptional", + + range: [82, 97], + loc: { + start: { column: 9, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [113, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [116, 118], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [118, 119], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + String { + type: "String", + value: "'two'", + + range: [119, 124], + loc: { + start: { column: 8, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [124, 125], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [125, 126], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [126, 127], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [127, 132], + loc: { + start: { column: 16, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [132, 133], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [136, 137], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [137, 140], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [140, 142], + loc: { + start: { column: 6, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [142, 143], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + String { + type: "String", + value: "'two'", + + range: [143, 148], + loc: { + start: { column: 9, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [148, 149], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [149, 150], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [150, 151], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [151, 152], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [152, 157], + loc: { + start: { column: 18, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [157, 158], + loc: { + start: { column: 23, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [161, 162], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [162, 165], + loc: { + start: { column: 3, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [165, 167], + loc: { + start: { column: 6, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [167, 168], + loc: { + start: { column: 8, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + String { + type: "String", + value: "'two'", + + range: [168, 173], + loc: { + start: { column: 9, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [173, 174], + loc: { + start: { column: 14, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [174, 175], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [175, 176], + loc: { + start: { column: 16, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [176, 177], + loc: { + start: { column: 17, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [177, 182], + loc: { + start: { column: 18, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [182, 183], + loc: { + start: { column: 23, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [186, 189], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [189, 191], + loc: { + start: { column: 5, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [191, 194], + loc: { + start: { column: 7, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [194, 195], + loc: { + start: { column: 10, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [195, 196], + loc: { + start: { column: 11, line: 7 }, + end: { column: 12, line: 7 }, + }, + }, + String { + type: "String", + value: "'three'", + + range: [196, 203], + loc: { + start: { column: 12, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [203, 204], + loc: { + start: { column: 19, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [204, 205], + loc: { + start: { column: 20, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [208, 209], + loc: { + start: { column: 2, line: 8 }, + end: { column: 3, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [209, 212], + loc: { + start: { column: 3, line: 8 }, + end: { column: 6, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [212, 214], + loc: { + start: { column: 6, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [214, 217], + loc: { + start: { column: 8, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [217, 218], + loc: { + start: { column: 11, line: 8 }, + end: { column: 12, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [218, 219], + loc: { + start: { column: 12, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [219, 220], + loc: { + start: { column: 13, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + String { + type: "String", + value: "'three'", + + range: [220, 227], + loc: { + start: { column: 14, line: 8 }, + end: { column: 21, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [227, 228], + loc: { + start: { column: 21, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [228, 229], + loc: { + start: { column: 22, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [232, 233], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [233, 236], + loc: { + start: { column: 3, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [236, 238], + loc: { + start: { column: 6, line: 9 }, + end: { column: 8, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [238, 241], + loc: { + start: { column: 8, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [241, 242], + loc: { + start: { column: 11, line: 9 }, + end: { column: 12, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [242, 243], + loc: { + start: { column: 12, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [243, 244], + loc: { + start: { column: 13, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + String { + type: "String", + value: "'three'", + + range: [244, 251], + loc: { + start: { column: 14, line: 9 }, + end: { column: 21, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [251, 252], + loc: { + start: { column: 21, line: 9 }, + end: { column: 22, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [252, 253], + loc: { + start: { column: 22, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [254, 255], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..e528bbb2c6f6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/3-Babel-AST.shot @@ -0,0 +1,560 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-element-access-with-non-null-assertion Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [113, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "'two'", + value: "two", + + range: [119, 124], + loc: { + start: { column: 8, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [113, 125], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + + range: [113, 126], + loc: { + start: { column: 2, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "three", + + range: [127, 132], + loc: { + start: { column: 16, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [113, 132], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [113, 132], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [113, 133], + loc: { + start: { column: 2, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [137, 140], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "'two'", + value: "two", + + range: [143, 148], + loc: { + start: { column: 9, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + + range: [137, 149], + loc: { + start: { column: 3, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [137, 149], + loc: { + start: { column: 3, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [136, 151], + loc: { + start: { column: 2, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "three", + + range: [152, 157], + loc: { + start: { column: 18, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + + range: [136, 157], + loc: { + start: { column: 2, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + + range: [136, 158], + loc: { + start: { column: 2, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [162, 165], + loc: { + start: { column: 3, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "'two'", + value: "two", + + range: [168, 173], + loc: { + start: { column: 9, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + + range: [162, 174], + loc: { + start: { column: 3, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [162, 174], + loc: { + start: { column: 3, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + + range: [161, 176], + loc: { + start: { column: 2, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "three", + + range: [177, 182], + loc: { + start: { column: 18, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + + range: [161, 182], + loc: { + start: { column: 2, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + + range: [161, 183], + loc: { + start: { column: 2, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [186, 189], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [191, 194], + loc: { + start: { column: 7, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + + range: [186, 194], + loc: { + start: { column: 2, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + + range: [186, 195], + loc: { + start: { column: 2, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "'three'", + value: "three", + + range: [196, 203], + loc: { + start: { column: 12, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + + range: [186, 204], + loc: { + start: { column: 2, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + + range: [186, 204], + loc: { + start: { column: 2, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + + range: [186, 205], + loc: { + start: { column: 2, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [209, 212], + loc: { + start: { column: 3, line: 8 }, + end: { column: 6, line: 8 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [214, 217], + loc: { + start: { column: 8, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + + range: [209, 217], + loc: { + start: { column: 3, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + + range: [209, 217], + loc: { + start: { column: 3, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + + range: [208, 219], + loc: { + start: { column: 2, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "'three'", + value: "three", + + range: [220, 227], + loc: { + start: { column: 14, line: 8 }, + end: { column: 21, line: 8 }, + }, + }, + + range: [208, 228], + loc: { + start: { column: 2, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [208, 229], + loc: { + start: { column: 2, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [233, 236], + loc: { + start: { column: 3, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [238, 241], + loc: { + start: { column: 8, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + + range: [233, 241], + loc: { + start: { column: 3, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + + range: [233, 241], + loc: { + start: { column: 3, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + + range: [232, 243], + loc: { + start: { column: 2, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "'three'", + value: "three", + + range: [244, 251], + loc: { + start: { column: 14, line: 9 }, + end: { column: 21, line: 9 }, + }, + }, + + range: [232, 252], + loc: { + start: { column: 2, line: 9 }, + end: { column: 22, line: 9 }, + }, + }, + + range: [232, 253], + loc: { + start: { column: 2, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + ], + + range: [109, 255], + loc: { + start: { column: 36, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "processOptional", + + range: [82, 97], + loc: { + start: { column: 9, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "one", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [102, 107], + loc: { + start: { column: 29, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [98, 107], + loc: { + start: { column: 25, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + + range: [73, 255], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 256], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..36a5170e452e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,696 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-element-access-with-non-null-assertion Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "processOptional", + + range: [82, 97], + loc: { + start: { column: 9, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [113, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [116, 118], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [118, 119], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + String { + type: "String", + value: "'two'", + + range: [119, 124], + loc: { + start: { column: 8, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [124, 125], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [125, 126], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [126, 127], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [127, 132], + loc: { + start: { column: 16, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [132, 133], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [136, 137], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [137, 140], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [140, 142], + loc: { + start: { column: 6, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [142, 143], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + String { + type: "String", + value: "'two'", + + range: [143, 148], + loc: { + start: { column: 9, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [148, 149], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [149, 150], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [150, 151], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [151, 152], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [152, 157], + loc: { + start: { column: 18, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [157, 158], + loc: { + start: { column: 23, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [161, 162], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [162, 165], + loc: { + start: { column: 3, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [165, 167], + loc: { + start: { column: 6, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [167, 168], + loc: { + start: { column: 8, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + String { + type: "String", + value: "'two'", + + range: [168, 173], + loc: { + start: { column: 9, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [173, 174], + loc: { + start: { column: 14, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [174, 175], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [175, 176], + loc: { + start: { column: 16, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [176, 177], + loc: { + start: { column: 17, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [177, 182], + loc: { + start: { column: 18, line: 6 }, + end: { column: 23, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [182, 183], + loc: { + start: { column: 23, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [186, 189], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [189, 191], + loc: { + start: { column: 5, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [191, 194], + loc: { + start: { column: 7, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [194, 195], + loc: { + start: { column: 10, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [195, 196], + loc: { + start: { column: 11, line: 7 }, + end: { column: 12, line: 7 }, + }, + }, + String { + type: "String", + value: "'three'", + + range: [196, 203], + loc: { + start: { column: 12, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [203, 204], + loc: { + start: { column: 19, line: 7 }, + end: { column: 20, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [204, 205], + loc: { + start: { column: 20, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [208, 209], + loc: { + start: { column: 2, line: 8 }, + end: { column: 3, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [209, 212], + loc: { + start: { column: 3, line: 8 }, + end: { column: 6, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [212, 214], + loc: { + start: { column: 6, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [214, 217], + loc: { + start: { column: 8, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [217, 218], + loc: { + start: { column: 11, line: 8 }, + end: { column: 12, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [218, 219], + loc: { + start: { column: 12, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [219, 220], + loc: { + start: { column: 13, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + String { + type: "String", + value: "'three'", + + range: [220, 227], + loc: { + start: { column: 14, line: 8 }, + end: { column: 21, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [227, 228], + loc: { + start: { column: 21, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [228, 229], + loc: { + start: { column: 22, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [232, 233], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [233, 236], + loc: { + start: { column: 3, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [236, 238], + loc: { + start: { column: 6, line: 9 }, + end: { column: 8, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [238, 241], + loc: { + start: { column: 8, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [241, 242], + loc: { + start: { column: 11, line: 9 }, + end: { column: 12, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [242, 243], + loc: { + start: { column: 12, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [243, 244], + loc: { + start: { column: 13, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + String { + type: "String", + value: "'three'", + + range: [244, 251], + loc: { + start: { column: 14, line: 9 }, + end: { column: 21, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [251, 252], + loc: { + start: { column: 21, line: 9 }, + end: { column: 22, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [252, 253], + loc: { + start: { column: 22, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [254, 255], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..dd256689be6a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-element-access-with-non-null-assertion AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..f1ebfb4e8dcf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-element-access-with-non-null-assertion AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/fixture.ts new file mode 100644 index 000000000000..e7e4d71de01b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/fixture.ts @@ -0,0 +1,10 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function processOptionalElementParens(one?: any) { + one?.[2]; + (one?.[2])[3]; + one[2]?.[3]; + (one[2]?.[3])[4]; + one[2]?.[3]?.[4]; + (one[2]?.[3]?.[4])[5]; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..4f4d118456f0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,578 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-element-access-with-parens TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [126, 129], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [132, 133], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [126, 134], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [126, 134], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [126, 135], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [139, 142], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [145, 146], + loc: { + start: { column: 9, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + + range: [139, 147], + loc: { + start: { column: 3, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [139, 147], + loc: { + start: { column: 3, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [149, 150], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + + range: [138, 151], + loc: { + start: { column: 2, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [138, 152], + loc: { + start: { column: 2, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [155, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [159, 160], + loc: { + start: { column: 6, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + + range: [155, 161], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [164, 165], + loc: { + start: { column: 11, line: 6 }, + end: { column: 12, line: 6 }, + }, + }, + + range: [155, 166], + loc: { + start: { column: 2, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + + range: [155, 166], + loc: { + start: { column: 2, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + + range: [155, 167], + loc: { + start: { column: 2, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [171, 174], + loc: { + start: { column: 3, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [175, 176], + loc: { + start: { column: 7, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + + range: [171, 177], + loc: { + start: { column: 3, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [180, 181], + loc: { + start: { column: 12, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + + range: [171, 182], + loc: { + start: { column: 3, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + + range: [171, 182], + loc: { + start: { column: 3, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "4", + value: 4, + + range: [184, 185], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + + range: [170, 186], + loc: { + start: { column: 2, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + + range: [170, 187], + loc: { + start: { column: 2, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [190, 193], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [194, 195], + loc: { + start: { column: 6, line: 8 }, + end: { column: 7, line: 8 }, + }, + }, + + range: [190, 196], + loc: { + start: { column: 2, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [199, 200], + loc: { + start: { column: 11, line: 8 }, + end: { column: 12, line: 8 }, + }, + }, + + range: [190, 201], + loc: { + start: { column: 2, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "4", + value: 4, + + range: [204, 205], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + + range: [190, 206], + loc: { + start: { column: 2, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + + range: [190, 206], + loc: { + start: { column: 2, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + + range: [190, 207], + loc: { + start: { column: 2, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [211, 214], + loc: { + start: { column: 3, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [215, 216], + loc: { + start: { column: 7, line: 9 }, + end: { column: 8, line: 9 }, + }, + }, + + range: [211, 217], + loc: { + start: { column: 3, line: 9 }, + end: { column: 9, line: 9 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [220, 221], + loc: { + start: { column: 12, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + + range: [211, 222], + loc: { + start: { column: 3, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "4", + value: 4, + + range: [225, 226], + loc: { + start: { column: 17, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + + range: [211, 227], + loc: { + start: { column: 3, line: 9 }, + end: { column: 19, line: 9 }, + }, + }, + + range: [211, 227], + loc: { + start: { column: 3, line: 9 }, + end: { column: 19, line: 9 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "5", + value: 5, + + range: [229, 230], + loc: { + start: { column: 21, line: 9 }, + end: { column: 22, line: 9 }, + }, + }, + + range: [210, 231], + loc: { + start: { column: 2, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + + range: [210, 232], + loc: { + start: { column: 2, line: 9 }, + end: { column: 24, line: 9 }, + }, + }, + ], + + range: [122, 234], + loc: { + start: { column: 49, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "processOptionalElementParens", + + range: [82, 110], + loc: { + start: { column: 9, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "one", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [117, 120], + loc: { + start: { column: 44, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + + range: [115, 120], + loc: { + start: { column: 42, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + + range: [111, 120], + loc: { + start: { column: 38, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + ], + + range: [73, 234], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 235], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..414db5233e82 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,816 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-element-access-with-parens TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "processOptionalElementParens", + + range: [82, 110], + loc: { + start: { column: 9, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [111, 114], + loc: { + start: { column: 38, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [117, 120], + loc: { + start: { column: 44, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [120, 121], + loc: { + start: { column: 47, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [122, 123], + loc: { + start: { column: 49, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [126, 129], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [129, 131], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [131, 132], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [132, 133], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [133, 134], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [134, 135], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [138, 139], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [139, 142], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [142, 144], + loc: { + start: { column: 6, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [144, 145], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [145, 146], + loc: { + start: { column: 9, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [146, 147], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [147, 148], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [148, 149], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [149, 150], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [150, 151], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [151, 152], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [155, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [158, 159], + loc: { + start: { column: 5, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [159, 160], + loc: { + start: { column: 6, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [160, 161], + loc: { + start: { column: 7, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [161, 163], + loc: { + start: { column: 8, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [163, 164], + loc: { + start: { column: 10, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [164, 165], + loc: { + start: { column: 11, line: 6 }, + end: { column: 12, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [165, 166], + loc: { + start: { column: 12, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [166, 167], + loc: { + start: { column: 13, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [170, 171], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [171, 174], + loc: { + start: { column: 3, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [174, 175], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [175, 176], + loc: { + start: { column: 7, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [176, 177], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [177, 179], + loc: { + start: { column: 9, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [179, 180], + loc: { + start: { column: 11, line: 7 }, + end: { column: 12, line: 7 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [180, 181], + loc: { + start: { column: 12, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [181, 182], + loc: { + start: { column: 13, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [182, 183], + loc: { + start: { column: 14, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [183, 184], + loc: { + start: { column: 15, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + Numeric { + type: "Numeric", + value: "4", + + range: [184, 185], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [185, 186], + loc: { + start: { column: 17, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [186, 187], + loc: { + start: { column: 18, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [190, 193], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [193, 194], + loc: { + start: { column: 5, line: 8 }, + end: { column: 6, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [194, 195], + loc: { + start: { column: 6, line: 8 }, + end: { column: 7, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [195, 196], + loc: { + start: { column: 7, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [196, 198], + loc: { + start: { column: 8, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [198, 199], + loc: { + start: { column: 10, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [199, 200], + loc: { + start: { column: 11, line: 8 }, + end: { column: 12, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [200, 201], + loc: { + start: { column: 12, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [201, 203], + loc: { + start: { column: 13, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [203, 204], + loc: { + start: { column: 15, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "4", + + range: [204, 205], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [205, 206], + loc: { + start: { column: 17, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [206, 207], + loc: { + start: { column: 18, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [210, 211], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [211, 214], + loc: { + start: { column: 3, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [214, 215], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [215, 216], + loc: { + start: { column: 7, line: 9 }, + end: { column: 8, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [216, 217], + loc: { + start: { column: 8, line: 9 }, + end: { column: 9, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [217, 219], + loc: { + start: { column: 9, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [219, 220], + loc: { + start: { column: 11, line: 9 }, + end: { column: 12, line: 9 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [220, 221], + loc: { + start: { column: 12, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [221, 222], + loc: { + start: { column: 13, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [222, 224], + loc: { + start: { column: 14, line: 9 }, + end: { column: 16, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [224, 225], + loc: { + start: { column: 16, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + Numeric { + type: "Numeric", + value: "4", + + range: [225, 226], + loc: { + start: { column: 17, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [226, 227], + loc: { + start: { column: 18, line: 9 }, + end: { column: 19, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [227, 228], + loc: { + start: { column: 19, line: 9 }, + end: { column: 20, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [228, 229], + loc: { + start: { column: 20, line: 9 }, + end: { column: 21, line: 9 }, + }, + }, + Numeric { + type: "Numeric", + value: "5", + + range: [229, 230], + loc: { + start: { column: 21, line: 9 }, + end: { column: 22, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [230, 231], + loc: { + start: { column: 22, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [231, 232], + loc: { + start: { column: 23, line: 9 }, + end: { column: 24, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [233, 234], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..e3e00f2374cf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/3-Babel-AST.shot @@ -0,0 +1,578 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-element-access-with-parens Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [126, 129], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [132, 133], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [126, 134], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [126, 134], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [126, 135], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [139, 142], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [145, 146], + loc: { + start: { column: 9, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + + range: [139, 147], + loc: { + start: { column: 3, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [139, 147], + loc: { + start: { column: 3, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [149, 150], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + + range: [138, 151], + loc: { + start: { column: 2, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [138, 152], + loc: { + start: { column: 2, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [155, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [159, 160], + loc: { + start: { column: 6, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + + range: [155, 161], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [164, 165], + loc: { + start: { column: 11, line: 6 }, + end: { column: 12, line: 6 }, + }, + }, + + range: [155, 166], + loc: { + start: { column: 2, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + + range: [155, 166], + loc: { + start: { column: 2, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + + range: [155, 167], + loc: { + start: { column: 2, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [171, 174], + loc: { + start: { column: 3, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [175, 176], + loc: { + start: { column: 7, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + + range: [171, 177], + loc: { + start: { column: 3, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [180, 181], + loc: { + start: { column: 12, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + + range: [171, 182], + loc: { + start: { column: 3, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + + range: [171, 182], + loc: { + start: { column: 3, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "4", + value: 4, + + range: [184, 185], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + + range: [170, 186], + loc: { + start: { column: 2, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + + range: [170, 187], + loc: { + start: { column: 2, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [190, 193], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [194, 195], + loc: { + start: { column: 6, line: 8 }, + end: { column: 7, line: 8 }, + }, + }, + + range: [190, 196], + loc: { + start: { column: 2, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [199, 200], + loc: { + start: { column: 11, line: 8 }, + end: { column: 12, line: 8 }, + }, + }, + + range: [190, 201], + loc: { + start: { column: 2, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "4", + value: 4, + + range: [204, 205], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + + range: [190, 206], + loc: { + start: { column: 2, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + + range: [190, 206], + loc: { + start: { column: 2, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + + range: [190, 207], + loc: { + start: { column: 2, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [211, 214], + loc: { + start: { column: 3, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [215, 216], + loc: { + start: { column: 7, line: 9 }, + end: { column: 8, line: 9 }, + }, + }, + + range: [211, 217], + loc: { + start: { column: 3, line: 9 }, + end: { column: 9, line: 9 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [220, 221], + loc: { + start: { column: 12, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + + range: [211, 222], + loc: { + start: { column: 3, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "4", + value: 4, + + range: [225, 226], + loc: { + start: { column: 17, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + + range: [211, 227], + loc: { + start: { column: 3, line: 9 }, + end: { column: 19, line: 9 }, + }, + }, + + range: [211, 227], + loc: { + start: { column: 3, line: 9 }, + end: { column: 19, line: 9 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "5", + value: 5, + + range: [229, 230], + loc: { + start: { column: 21, line: 9 }, + end: { column: 22, line: 9 }, + }, + }, + + range: [210, 231], + loc: { + start: { column: 2, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + + range: [210, 232], + loc: { + start: { column: 2, line: 9 }, + end: { column: 24, line: 9 }, + }, + }, + ], + + range: [122, 234], + loc: { + start: { column: 49, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "processOptionalElementParens", + + range: [82, 110], + loc: { + start: { column: 9, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "one", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [117, 120], + loc: { + start: { column: 44, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + + range: [115, 120], + loc: { + start: { column: 42, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + + range: [111, 120], + loc: { + start: { column: 38, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + ], + + range: [73, 234], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 235], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..ee0cddf55af1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,816 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-element-access-with-parens Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "processOptionalElementParens", + + range: [82, 110], + loc: { + start: { column: 9, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [111, 114], + loc: { + start: { column: 38, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [117, 120], + loc: { + start: { column: 44, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [120, 121], + loc: { + start: { column: 47, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [122, 123], + loc: { + start: { column: 49, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [126, 129], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [129, 131], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [131, 132], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [132, 133], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [133, 134], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [134, 135], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [138, 139], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [139, 142], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [142, 144], + loc: { + start: { column: 6, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [144, 145], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [145, 146], + loc: { + start: { column: 9, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [146, 147], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [147, 148], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [148, 149], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [149, 150], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [150, 151], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [151, 152], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [155, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [158, 159], + loc: { + start: { column: 5, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [159, 160], + loc: { + start: { column: 6, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [160, 161], + loc: { + start: { column: 7, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [161, 163], + loc: { + start: { column: 8, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [163, 164], + loc: { + start: { column: 10, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [164, 165], + loc: { + start: { column: 11, line: 6 }, + end: { column: 12, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [165, 166], + loc: { + start: { column: 12, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [166, 167], + loc: { + start: { column: 13, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [170, 171], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [171, 174], + loc: { + start: { column: 3, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [174, 175], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [175, 176], + loc: { + start: { column: 7, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [176, 177], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [177, 179], + loc: { + start: { column: 9, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [179, 180], + loc: { + start: { column: 11, line: 7 }, + end: { column: 12, line: 7 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [180, 181], + loc: { + start: { column: 12, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [181, 182], + loc: { + start: { column: 13, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [182, 183], + loc: { + start: { column: 14, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [183, 184], + loc: { + start: { column: 15, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + Numeric { + type: "Numeric", + value: "4", + + range: [184, 185], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [185, 186], + loc: { + start: { column: 17, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [186, 187], + loc: { + start: { column: 18, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [190, 193], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [193, 194], + loc: { + start: { column: 5, line: 8 }, + end: { column: 6, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [194, 195], + loc: { + start: { column: 6, line: 8 }, + end: { column: 7, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [195, 196], + loc: { + start: { column: 7, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [196, 198], + loc: { + start: { column: 8, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [198, 199], + loc: { + start: { column: 10, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [199, 200], + loc: { + start: { column: 11, line: 8 }, + end: { column: 12, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [200, 201], + loc: { + start: { column: 12, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [201, 203], + loc: { + start: { column: 13, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [203, 204], + loc: { + start: { column: 15, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "4", + + range: [204, 205], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [205, 206], + loc: { + start: { column: 17, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [206, 207], + loc: { + start: { column: 18, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [210, 211], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [211, 214], + loc: { + start: { column: 3, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [214, 215], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [215, 216], + loc: { + start: { column: 7, line: 9 }, + end: { column: 8, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [216, 217], + loc: { + start: { column: 8, line: 9 }, + end: { column: 9, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [217, 219], + loc: { + start: { column: 9, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [219, 220], + loc: { + start: { column: 11, line: 9 }, + end: { column: 12, line: 9 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [220, 221], + loc: { + start: { column: 12, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [221, 222], + loc: { + start: { column: 13, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [222, 224], + loc: { + start: { column: 14, line: 9 }, + end: { column: 16, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [224, 225], + loc: { + start: { column: 16, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + Numeric { + type: "Numeric", + value: "4", + + range: [225, 226], + loc: { + start: { column: 17, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [226, 227], + loc: { + start: { column: 18, line: 9 }, + end: { column: 19, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [227, 228], + loc: { + start: { column: 19, line: 9 }, + end: { column: 20, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [228, 229], + loc: { + start: { column: 20, line: 9 }, + end: { column: 21, line: 9 }, + }, + }, + Numeric { + type: "Numeric", + value: "5", + + range: [229, 230], + loc: { + start: { column: 21, line: 9 }, + end: { column: 22, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [230, 231], + loc: { + start: { column: 22, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [231, 232], + loc: { + start: { column: 23, line: 9 }, + end: { column: 24, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [233, 234], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..1e8a8d850749 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-element-access-with-parens AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..912a878cd1dd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-element-access-with-parens AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/fixture.ts new file mode 100644 index 000000000000..2840008e3cd6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/fixture.ts @@ -0,0 +1,10 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function processOptionalElement(one?: any) { + one?.[2]; + one?.[2][3]; + one[2]?.[3]; + one[2]?.[3]; + one[2]?.[3][4]; + one[2]?.[3]?.[4]; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..aac8b3313473 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,534 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-element-access TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [120, 123], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [126, 127], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [120, 128], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [120, 128], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [120, 129], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [132, 135], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [138, 139], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + + range: [132, 140], + loc: { + start: { column: 2, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [141, 142], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + + range: [132, 143], + loc: { + start: { column: 2, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [132, 143], + loc: { + start: { column: 2, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [132, 144], + loc: { + start: { column: 2, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [147, 150], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [151, 152], + loc: { + start: { column: 6, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + + range: [147, 153], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [156, 157], + loc: { + start: { column: 11, line: 6 }, + end: { column: 12, line: 6 }, + }, + }, + + range: [147, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + + range: [147, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + + range: [147, 159], + loc: { + start: { column: 2, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [162, 165], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [166, 167], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + + range: [162, 168], + loc: { + start: { column: 2, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [171, 172], + loc: { + start: { column: 11, line: 7 }, + end: { column: 12, line: 7 }, + }, + }, + + range: [162, 173], + loc: { + start: { column: 2, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + + range: [162, 173], + loc: { + start: { column: 2, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + + range: [162, 174], + loc: { + start: { column: 2, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [177, 180], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [181, 182], + loc: { + start: { column: 6, line: 8 }, + end: { column: 7, line: 8 }, + }, + }, + + range: [177, 183], + loc: { + start: { column: 2, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [186, 187], + loc: { + start: { column: 11, line: 8 }, + end: { column: 12, line: 8 }, + }, + }, + + range: [177, 188], + loc: { + start: { column: 2, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "4", + value: 4, + + range: [189, 190], + loc: { + start: { column: 14, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + + range: [177, 191], + loc: { + start: { column: 2, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + + range: [177, 191], + loc: { + start: { column: 2, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + + range: [177, 192], + loc: { + start: { column: 2, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [195, 198], + loc: { + start: { column: 2, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [199, 200], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + + range: [195, 201], + loc: { + start: { column: 2, line: 9 }, + end: { column: 8, line: 9 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [204, 205], + loc: { + start: { column: 11, line: 9 }, + end: { column: 12, line: 9 }, + }, + }, + + range: [195, 206], + loc: { + start: { column: 2, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "4", + value: 4, + + range: [209, 210], + loc: { + start: { column: 16, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + + range: [195, 211], + loc: { + start: { column: 2, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + + range: [195, 211], + loc: { + start: { column: 2, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + + range: [195, 212], + loc: { + start: { column: 2, line: 9 }, + end: { column: 19, line: 9 }, + }, + }, + ], + + range: [116, 214], + loc: { + start: { column: 43, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "processOptionalElement", + + range: [82, 104], + loc: { + start: { column: 9, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "one", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [111, 114], + loc: { + start: { column: 38, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + + range: [109, 114], + loc: { + start: { column: 36, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + + range: [105, 114], + loc: { + start: { column: 32, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + ], + + range: [73, 214], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 215], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..5b6e10e1b6be --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,686 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-element-access TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "processOptionalElement", + + range: [82, 104], + loc: { + start: { column: 9, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [105, 108], + loc: { + start: { column: 32, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [111, 114], + loc: { + start: { column: 38, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [120, 123], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [123, 125], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [125, 126], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [126, 127], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [127, 128], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [128, 129], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [132, 135], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [135, 137], + loc: { + start: { column: 5, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [137, 138], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [138, 139], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [139, 140], + loc: { + start: { column: 9, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [140, 141], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [141, 142], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [142, 143], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [143, 144], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [147, 150], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [150, 151], + loc: { + start: { column: 5, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [151, 152], + loc: { + start: { column: 6, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [152, 153], + loc: { + start: { column: 7, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [153, 155], + loc: { + start: { column: 8, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [155, 156], + loc: { + start: { column: 10, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [156, 157], + loc: { + start: { column: 11, line: 6 }, + end: { column: 12, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [157, 158], + loc: { + start: { column: 12, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [158, 159], + loc: { + start: { column: 13, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [162, 165], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [165, 166], + loc: { + start: { column: 5, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [166, 167], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [167, 168], + loc: { + start: { column: 7, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [168, 170], + loc: { + start: { column: 8, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [170, 171], + loc: { + start: { column: 10, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [171, 172], + loc: { + start: { column: 11, line: 7 }, + end: { column: 12, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [172, 173], + loc: { + start: { column: 12, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [173, 174], + loc: { + start: { column: 13, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [177, 180], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [180, 181], + loc: { + start: { column: 5, line: 8 }, + end: { column: 6, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [181, 182], + loc: { + start: { column: 6, line: 8 }, + end: { column: 7, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [182, 183], + loc: { + start: { column: 7, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [183, 185], + loc: { + start: { column: 8, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [185, 186], + loc: { + start: { column: 10, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [186, 187], + loc: { + start: { column: 11, line: 8 }, + end: { column: 12, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [187, 188], + loc: { + start: { column: 12, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [188, 189], + loc: { + start: { column: 13, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "4", + + range: [189, 190], + loc: { + start: { column: 14, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [190, 191], + loc: { + start: { column: 15, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [191, 192], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [195, 198], + loc: { + start: { column: 2, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [198, 199], + loc: { + start: { column: 5, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [199, 200], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [200, 201], + loc: { + start: { column: 7, line: 9 }, + end: { column: 8, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [201, 203], + loc: { + start: { column: 8, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [203, 204], + loc: { + start: { column: 10, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [204, 205], + loc: { + start: { column: 11, line: 9 }, + end: { column: 12, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [205, 206], + loc: { + start: { column: 12, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [206, 208], + loc: { + start: { column: 13, line: 9 }, + end: { column: 15, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [208, 209], + loc: { + start: { column: 15, line: 9 }, + end: { column: 16, line: 9 }, + }, + }, + Numeric { + type: "Numeric", + value: "4", + + range: [209, 210], + loc: { + start: { column: 16, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [210, 211], + loc: { + start: { column: 17, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [211, 212], + loc: { + start: { column: 18, line: 9 }, + end: { column: 19, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [213, 214], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..6e6efb2622de --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/3-Babel-AST.shot @@ -0,0 +1,534 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-element-access Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [120, 123], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [126, 127], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + + range: [120, 128], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [120, 128], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [120, 129], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [132, 135], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [138, 139], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + + range: [132, 140], + loc: { + start: { column: 2, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [141, 142], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + + range: [132, 143], + loc: { + start: { column: 2, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [132, 143], + loc: { + start: { column: 2, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [132, 144], + loc: { + start: { column: 2, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [147, 150], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [151, 152], + loc: { + start: { column: 6, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + + range: [147, 153], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [156, 157], + loc: { + start: { column: 11, line: 6 }, + end: { column: 12, line: 6 }, + }, + }, + + range: [147, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + + range: [147, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + + range: [147, 159], + loc: { + start: { column: 2, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [162, 165], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [166, 167], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + + range: [162, 168], + loc: { + start: { column: 2, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [171, 172], + loc: { + start: { column: 11, line: 7 }, + end: { column: 12, line: 7 }, + }, + }, + + range: [162, 173], + loc: { + start: { column: 2, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + + range: [162, 173], + loc: { + start: { column: 2, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + + range: [162, 174], + loc: { + start: { column: 2, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [177, 180], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [181, 182], + loc: { + start: { column: 6, line: 8 }, + end: { column: 7, line: 8 }, + }, + }, + + range: [177, 183], + loc: { + start: { column: 2, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [186, 187], + loc: { + start: { column: 11, line: 8 }, + end: { column: 12, line: 8 }, + }, + }, + + range: [177, 188], + loc: { + start: { column: 2, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "4", + value: 4, + + range: [189, 190], + loc: { + start: { column: 14, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + + range: [177, 191], + loc: { + start: { column: 2, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + + range: [177, 191], + loc: { + start: { column: 2, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + + range: [177, 192], + loc: { + start: { column: 2, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "one", + + range: [195, 198], + loc: { + start: { column: 2, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [199, 200], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + + range: [195, 201], + loc: { + start: { column: 2, line: 9 }, + end: { column: 8, line: 9 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [204, 205], + loc: { + start: { column: 11, line: 9 }, + end: { column: 12, line: 9 }, + }, + }, + + range: [195, 206], + loc: { + start: { column: 2, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + optional: true, + property: Literal { + type: "Literal", + raw: "4", + value: 4, + + range: [209, 210], + loc: { + start: { column: 16, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + + range: [195, 211], + loc: { + start: { column: 2, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + + range: [195, 211], + loc: { + start: { column: 2, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + + range: [195, 212], + loc: { + start: { column: 2, line: 9 }, + end: { column: 19, line: 9 }, + }, + }, + ], + + range: [116, 214], + loc: { + start: { column: 43, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "processOptionalElement", + + range: [82, 104], + loc: { + start: { column: 9, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "one", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [111, 114], + loc: { + start: { column: 38, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + + range: [109, 114], + loc: { + start: { column: 36, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + + range: [105, 114], + loc: { + start: { column: 32, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + ], + + range: [73, 214], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 215], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..0ab5ab722c74 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,686 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-element-access Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "processOptionalElement", + + range: [82, 104], + loc: { + start: { column: 9, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [105, 108], + loc: { + start: { column: 32, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [111, 114], + loc: { + start: { column: 38, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [120, 123], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [123, 125], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [125, 126], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [126, 127], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [127, 128], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [128, 129], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [132, 135], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [135, 137], + loc: { + start: { column: 5, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [137, 138], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [138, 139], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [139, 140], + loc: { + start: { column: 9, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [140, 141], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [141, 142], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [142, 143], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [143, 144], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [147, 150], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [150, 151], + loc: { + start: { column: 5, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [151, 152], + loc: { + start: { column: 6, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [152, 153], + loc: { + start: { column: 7, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [153, 155], + loc: { + start: { column: 8, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [155, 156], + loc: { + start: { column: 10, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [156, 157], + loc: { + start: { column: 11, line: 6 }, + end: { column: 12, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [157, 158], + loc: { + start: { column: 12, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [158, 159], + loc: { + start: { column: 13, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [162, 165], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [165, 166], + loc: { + start: { column: 5, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [166, 167], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [167, 168], + loc: { + start: { column: 7, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [168, 170], + loc: { + start: { column: 8, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [170, 171], + loc: { + start: { column: 10, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [171, 172], + loc: { + start: { column: 11, line: 7 }, + end: { column: 12, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [172, 173], + loc: { + start: { column: 12, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [173, 174], + loc: { + start: { column: 13, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [177, 180], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [180, 181], + loc: { + start: { column: 5, line: 8 }, + end: { column: 6, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [181, 182], + loc: { + start: { column: 6, line: 8 }, + end: { column: 7, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [182, 183], + loc: { + start: { column: 7, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [183, 185], + loc: { + start: { column: 8, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [185, 186], + loc: { + start: { column: 10, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [186, 187], + loc: { + start: { column: 11, line: 8 }, + end: { column: 12, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [187, 188], + loc: { + start: { column: 12, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [188, 189], + loc: { + start: { column: 13, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "4", + + range: [189, 190], + loc: { + start: { column: 14, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [190, 191], + loc: { + start: { column: 15, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [191, 192], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [195, 198], + loc: { + start: { column: 2, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [198, 199], + loc: { + start: { column: 5, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [199, 200], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [200, 201], + loc: { + start: { column: 7, line: 9 }, + end: { column: 8, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [201, 203], + loc: { + start: { column: 8, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [203, 204], + loc: { + start: { column: 10, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [204, 205], + loc: { + start: { column: 11, line: 9 }, + end: { column: 12, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [205, 206], + loc: { + start: { column: 12, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [206, 208], + loc: { + start: { column: 13, line: 9 }, + end: { column: 15, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [208, 209], + loc: { + start: { column: 15, line: 9 }, + end: { column: 16, line: 9 }, + }, + }, + Numeric { + type: "Numeric", + value: "4", + + range: [209, 210], + loc: { + start: { column: 16, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [210, 211], + loc: { + start: { column: 17, line: 9 }, + end: { column: 18, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [211, 212], + loc: { + start: { column: 18, line: 9 }, + end: { column: 19, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [213, 214], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..dc5647c5cbe5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-element-access AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..9d4c9e5c8b33 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-element-access AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/fixture.ts new file mode 100644 index 000000000000..09f5dca28d56 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/fixture.ts @@ -0,0 +1,7 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function processOptional(one?: any) { + one?.two!.three; + (one?.two)!.three; + (one?.two)!.three; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..a06cd536542c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,317 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-with-non-null-assertion TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [113, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [118, 121], + loc: { + start: { column: 7, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [113, 121], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [113, 122], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "three", + + range: [123, 128], + loc: { + start: { column: 12, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + + range: [113, 128], + loc: { + start: { column: 2, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + + range: [113, 128], + loc: { + start: { column: 2, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + + range: [113, 129], + loc: { + start: { column: 2, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [133, 136], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [138, 141], + loc: { + start: { column: 8, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [133, 141], + loc: { + start: { column: 3, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [133, 141], + loc: { + start: { column: 3, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [132, 143], + loc: { + start: { column: 2, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "three", + + range: [144, 149], + loc: { + start: { column: 14, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + + range: [132, 149], + loc: { + start: { column: 2, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + + range: [132, 150], + loc: { + start: { column: 2, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [154, 157], + loc: { + start: { column: 3, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [159, 162], + loc: { + start: { column: 8, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + + range: [154, 162], + loc: { + start: { column: 3, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + + range: [154, 162], + loc: { + start: { column: 3, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + + range: [153, 164], + loc: { + start: { column: 2, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "three", + + range: [165, 170], + loc: { + start: { column: 14, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + + range: [153, 170], + loc: { + start: { column: 2, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + + range: [153, 171], + loc: { + start: { column: 2, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + ], + + range: [109, 173], + loc: { + start: { column: 36, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "processOptional", + + range: [82, 97], + loc: { + start: { column: 9, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "one", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [102, 107], + loc: { + start: { column: 29, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [98, 107], + loc: { + start: { column: 25, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + + range: [73, 173], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 174], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..8d0d278ef581 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,356 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-with-non-null-assertion TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "processOptional", + + range: [82, 97], + loc: { + start: { column: 9, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [113, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [116, 118], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [118, 121], + loc: { + start: { column: 7, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [121, 122], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [122, 123], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [123, 128], + loc: { + start: { column: 12, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [128, 129], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [132, 133], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [133, 136], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [136, 138], + loc: { + start: { column: 6, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [138, 141], + loc: { + start: { column: 8, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [141, 142], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [142, 143], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [143, 144], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [144, 149], + loc: { + start: { column: 14, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [149, 150], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [153, 154], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [154, 157], + loc: { + start: { column: 3, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [157, 159], + loc: { + start: { column: 6, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [159, 162], + loc: { + start: { column: 8, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [162, 163], + loc: { + start: { column: 11, line: 6 }, + end: { column: 12, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [163, 164], + loc: { + start: { column: 12, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [164, 165], + loc: { + start: { column: 13, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [165, 170], + loc: { + start: { column: 14, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [170, 171], + loc: { + start: { column: 19, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [172, 173], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..bad46f1f86c6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/3-Babel-AST.shot @@ -0,0 +1,317 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-with-non-null-assertion Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [113, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [118, 121], + loc: { + start: { column: 7, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [113, 121], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [113, 122], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "three", + + range: [123, 128], + loc: { + start: { column: 12, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + + range: [113, 128], + loc: { + start: { column: 2, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + + range: [113, 128], + loc: { + start: { column: 2, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + + range: [113, 129], + loc: { + start: { column: 2, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [133, 136], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [138, 141], + loc: { + start: { column: 8, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [133, 141], + loc: { + start: { column: 3, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [133, 141], + loc: { + start: { column: 3, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [132, 143], + loc: { + start: { column: 2, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "three", + + range: [144, 149], + loc: { + start: { column: 14, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + + range: [132, 149], + loc: { + start: { column: 2, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + + range: [132, 150], + loc: { + start: { column: 2, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: TSNonNullExpression { + type: "TSNonNullExpression", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [154, 157], + loc: { + start: { column: 3, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [159, 162], + loc: { + start: { column: 8, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + + range: [154, 162], + loc: { + start: { column: 3, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + + range: [154, 162], + loc: { + start: { column: 3, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + + range: [153, 164], + loc: { + start: { column: 2, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "three", + + range: [165, 170], + loc: { + start: { column: 14, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + + range: [153, 170], + loc: { + start: { column: 2, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + + range: [153, 171], + loc: { + start: { column: 2, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + ], + + range: [109, 173], + loc: { + start: { column: 36, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "processOptional", + + range: [82, 97], + loc: { + start: { column: 9, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "one", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [102, 107], + loc: { + start: { column: 29, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [98, 107], + loc: { + start: { column: 25, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + + range: [73, 173], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 174], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..f9a87fea35dd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,356 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-with-non-null-assertion Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "processOptional", + + range: [82, 97], + loc: { + start: { column: 9, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [113, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [116, 118], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [118, 121], + loc: { + start: { column: 7, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [121, 122], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [122, 123], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [123, 128], + loc: { + start: { column: 12, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [128, 129], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [132, 133], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [133, 136], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [136, 138], + loc: { + start: { column: 6, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [138, 141], + loc: { + start: { column: 8, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [141, 142], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [142, 143], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [143, 144], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [144, 149], + loc: { + start: { column: 14, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [149, 150], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [153, 154], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [154, 157], + loc: { + start: { column: 3, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [157, 159], + loc: { + start: { column: 6, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [159, 162], + loc: { + start: { column: 8, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [162, 163], + loc: { + start: { column: 11, line: 6 }, + end: { column: 12, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "!", + + range: [163, 164], + loc: { + start: { column: 12, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [164, 165], + loc: { + start: { column: 13, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [165, 170], + loc: { + start: { column: 14, line: 6 }, + end: { column: 19, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [170, 171], + loc: { + start: { column: 19, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [172, 173], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..633b2b7bf601 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-with-non-null-assertion AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..b26f89db6951 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-with-non-null-assertion AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/fixture.ts new file mode 100644 index 000000000000..68587a849b99 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/fixture.ts @@ -0,0 +1,10 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function processOptionalParens(one?: any) { + one?.two; + (one?.two).three; + one.two?.three; + (one.two?.three).four; + one.two?.three?.four; + (one.two?.three?.four).five; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..bb096f73fc4d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,563 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-with-parens TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [119, 122], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [124, 127], + loc: { + start: { column: 7, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [119, 127], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [119, 127], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [119, 128], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [132, 135], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [137, 140], + loc: { + start: { column: 8, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [132, 140], + loc: { + start: { column: 3, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [132, 140], + loc: { + start: { column: 3, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "three", + + range: [142, 147], + loc: { + start: { column: 13, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + + range: [131, 147], + loc: { + start: { column: 2, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + + range: [131, 148], + loc: { + start: { column: 2, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [151, 154], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [155, 158], + loc: { + start: { column: 6, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + + range: [151, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "three", + + range: [160, 165], + loc: { + start: { column: 11, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + + range: [151, 165], + loc: { + start: { column: 2, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + + range: [151, 165], + loc: { + start: { column: 2, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + + range: [151, 166], + loc: { + start: { column: 2, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [170, 173], + loc: { + start: { column: 3, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [174, 177], + loc: { + start: { column: 7, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + + range: [170, 177], + loc: { + start: { column: 3, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "three", + + range: [179, 184], + loc: { + start: { column: 12, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + + range: [170, 184], + loc: { + start: { column: 3, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + + range: [170, 184], + loc: { + start: { column: 3, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "four", + + range: [186, 190], + loc: { + start: { column: 19, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + + range: [169, 190], + loc: { + start: { column: 2, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + + range: [169, 191], + loc: { + start: { column: 2, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [194, 197], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [198, 201], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + + range: [194, 201], + loc: { + start: { column: 2, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "three", + + range: [203, 208], + loc: { + start: { column: 11, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + + range: [194, 208], + loc: { + start: { column: 2, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "four", + + range: [210, 214], + loc: { + start: { column: 18, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [194, 214], + loc: { + start: { column: 2, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [194, 214], + loc: { + start: { column: 2, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [194, 215], + loc: { + start: { column: 2, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [219, 222], + loc: { + start: { column: 3, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [223, 226], + loc: { + start: { column: 7, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + + range: [219, 226], + loc: { + start: { column: 3, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "three", + + range: [228, 233], + loc: { + start: { column: 12, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + + range: [219, 233], + loc: { + start: { column: 3, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "four", + + range: [235, 239], + loc: { + start: { column: 19, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + + range: [219, 239], + loc: { + start: { column: 3, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + + range: [219, 239], + loc: { + start: { column: 3, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "five", + + range: [241, 245], + loc: { + start: { column: 25, line: 9 }, + end: { column: 29, line: 9 }, + }, + }, + + range: [218, 245], + loc: { + start: { column: 2, line: 9 }, + end: { column: 29, line: 9 }, + }, + }, + + range: [218, 246], + loc: { + start: { column: 2, line: 9 }, + end: { column: 30, line: 9 }, + }, + }, + ], + + range: [115, 248], + loc: { + start: { column: 42, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "processOptionalParens", + + range: [82, 103], + loc: { + start: { column: 9, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "one", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [110, 113], + loc: { + start: { column: 37, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + + range: [108, 113], + loc: { + start: { column: 35, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + + range: [104, 113], + loc: { + start: { column: 31, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + ], + + range: [73, 248], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 249], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..1eb248be623b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,586 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-with-parens TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "processOptionalParens", + + range: [82, 103], + loc: { + start: { column: 9, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [110, 113], + loc: { + start: { column: 37, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [113, 114], + loc: { + start: { column: 40, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [119, 122], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [122, 124], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [124, 127], + loc: { + start: { column: 7, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [127, 128], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [131, 132], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [132, 135], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [135, 137], + loc: { + start: { column: 6, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [137, 140], + loc: { + start: { column: 8, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [140, 141], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [141, 142], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [142, 147], + loc: { + start: { column: 13, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [147, 148], + loc: { + start: { column: 18, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [151, 154], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [154, 155], + loc: { + start: { column: 5, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [155, 158], + loc: { + start: { column: 6, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [158, 160], + loc: { + start: { column: 9, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [160, 165], + loc: { + start: { column: 11, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [165, 166], + loc: { + start: { column: 16, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [169, 170], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [170, 173], + loc: { + start: { column: 3, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [173, 174], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [174, 177], + loc: { + start: { column: 7, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [177, 179], + loc: { + start: { column: 10, line: 7 }, + end: { column: 12, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [179, 184], + loc: { + start: { column: 12, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [184, 185], + loc: { + start: { column: 17, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [185, 186], + loc: { + start: { column: 18, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "four", + + range: [186, 190], + loc: { + start: { column: 19, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [190, 191], + loc: { + start: { column: 23, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [194, 197], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [197, 198], + loc: { + start: { column: 5, line: 8 }, + end: { column: 6, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [198, 201], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [201, 203], + loc: { + start: { column: 9, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [203, 208], + loc: { + start: { column: 11, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [208, 210], + loc: { + start: { column: 16, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "four", + + range: [210, 214], + loc: { + start: { column: 18, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [214, 215], + loc: { + start: { column: 22, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [218, 219], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [219, 222], + loc: { + start: { column: 3, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [222, 223], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [223, 226], + loc: { + start: { column: 7, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [226, 228], + loc: { + start: { column: 10, line: 9 }, + end: { column: 12, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [228, 233], + loc: { + start: { column: 12, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [233, 235], + loc: { + start: { column: 17, line: 9 }, + end: { column: 19, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "four", + + range: [235, 239], + loc: { + start: { column: 19, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [239, 240], + loc: { + start: { column: 23, line: 9 }, + end: { column: 24, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [240, 241], + loc: { + start: { column: 24, line: 9 }, + end: { column: 25, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "five", + + range: [241, 245], + loc: { + start: { column: 25, line: 9 }, + end: { column: 29, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [245, 246], + loc: { + start: { column: 29, line: 9 }, + end: { column: 30, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [247, 248], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..e6234595770b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/3-Babel-AST.shot @@ -0,0 +1,563 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-with-parens Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [119, 122], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [124, 127], + loc: { + start: { column: 7, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [119, 127], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [119, 127], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [119, 128], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [132, 135], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [137, 140], + loc: { + start: { column: 8, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [132, 140], + loc: { + start: { column: 3, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [132, 140], + loc: { + start: { column: 3, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "three", + + range: [142, 147], + loc: { + start: { column: 13, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + + range: [131, 147], + loc: { + start: { column: 2, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + + range: [131, 148], + loc: { + start: { column: 2, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [151, 154], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [155, 158], + loc: { + start: { column: 6, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + + range: [151, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "three", + + range: [160, 165], + loc: { + start: { column: 11, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + + range: [151, 165], + loc: { + start: { column: 2, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + + range: [151, 165], + loc: { + start: { column: 2, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + + range: [151, 166], + loc: { + start: { column: 2, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [170, 173], + loc: { + start: { column: 3, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [174, 177], + loc: { + start: { column: 7, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + + range: [170, 177], + loc: { + start: { column: 3, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "three", + + range: [179, 184], + loc: { + start: { column: 12, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + + range: [170, 184], + loc: { + start: { column: 3, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + + range: [170, 184], + loc: { + start: { column: 3, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "four", + + range: [186, 190], + loc: { + start: { column: 19, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + + range: [169, 190], + loc: { + start: { column: 2, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + + range: [169, 191], + loc: { + start: { column: 2, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [194, 197], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [198, 201], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + + range: [194, 201], + loc: { + start: { column: 2, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "three", + + range: [203, 208], + loc: { + start: { column: 11, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + + range: [194, 208], + loc: { + start: { column: 2, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "four", + + range: [210, 214], + loc: { + start: { column: 18, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [194, 214], + loc: { + start: { column: 2, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [194, 214], + loc: { + start: { column: 2, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [194, 215], + loc: { + start: { column: 2, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [219, 222], + loc: { + start: { column: 3, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [223, 226], + loc: { + start: { column: 7, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + + range: [219, 226], + loc: { + start: { column: 3, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "three", + + range: [228, 233], + loc: { + start: { column: 12, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + + range: [219, 233], + loc: { + start: { column: 3, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "four", + + range: [235, 239], + loc: { + start: { column: 19, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + + range: [219, 239], + loc: { + start: { column: 3, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + + range: [219, 239], + loc: { + start: { column: 3, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "five", + + range: [241, 245], + loc: { + start: { column: 25, line: 9 }, + end: { column: 29, line: 9 }, + }, + }, + + range: [218, 245], + loc: { + start: { column: 2, line: 9 }, + end: { column: 29, line: 9 }, + }, + }, + + range: [218, 246], + loc: { + start: { column: 2, line: 9 }, + end: { column: 30, line: 9 }, + }, + }, + ], + + range: [115, 248], + loc: { + start: { column: 42, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "processOptionalParens", + + range: [82, 103], + loc: { + start: { column: 9, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "one", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [110, 113], + loc: { + start: { column: 37, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + + range: [108, 113], + loc: { + start: { column: 35, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + + range: [104, 113], + loc: { + start: { column: 31, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + ], + + range: [73, 248], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 249], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..03f7e69223a9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,586 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-with-parens Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "processOptionalParens", + + range: [82, 103], + loc: { + start: { column: 9, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [110, 113], + loc: { + start: { column: 37, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [113, 114], + loc: { + start: { column: 40, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [119, 122], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [122, 124], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [124, 127], + loc: { + start: { column: 7, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [127, 128], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [131, 132], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [132, 135], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [135, 137], + loc: { + start: { column: 6, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [137, 140], + loc: { + start: { column: 8, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [140, 141], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [141, 142], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [142, 147], + loc: { + start: { column: 13, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [147, 148], + loc: { + start: { column: 18, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [151, 154], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [154, 155], + loc: { + start: { column: 5, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [155, 158], + loc: { + start: { column: 6, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [158, 160], + loc: { + start: { column: 9, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [160, 165], + loc: { + start: { column: 11, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [165, 166], + loc: { + start: { column: 16, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [169, 170], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [170, 173], + loc: { + start: { column: 3, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [173, 174], + loc: { + start: { column: 6, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [174, 177], + loc: { + start: { column: 7, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [177, 179], + loc: { + start: { column: 10, line: 7 }, + end: { column: 12, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [179, 184], + loc: { + start: { column: 12, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [184, 185], + loc: { + start: { column: 17, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [185, 186], + loc: { + start: { column: 18, line: 7 }, + end: { column: 19, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "four", + + range: [186, 190], + loc: { + start: { column: 19, line: 7 }, + end: { column: 23, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [190, 191], + loc: { + start: { column: 23, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [194, 197], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [197, 198], + loc: { + start: { column: 5, line: 8 }, + end: { column: 6, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [198, 201], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [201, 203], + loc: { + start: { column: 9, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [203, 208], + loc: { + start: { column: 11, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [208, 210], + loc: { + start: { column: 16, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "four", + + range: [210, 214], + loc: { + start: { column: 18, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [214, 215], + loc: { + start: { column: 22, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [218, 219], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [219, 222], + loc: { + start: { column: 3, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [222, 223], + loc: { + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [223, 226], + loc: { + start: { column: 7, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [226, 228], + loc: { + start: { column: 10, line: 9 }, + end: { column: 12, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [228, 233], + loc: { + start: { column: 12, line: 9 }, + end: { column: 17, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [233, 235], + loc: { + start: { column: 17, line: 9 }, + end: { column: 19, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "four", + + range: [235, 239], + loc: { + start: { column: 19, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [239, 240], + loc: { + start: { column: 23, line: 9 }, + end: { column: 24, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [240, 241], + loc: { + start: { column: 24, line: 9 }, + end: { column: 25, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "five", + + range: [241, 245], + loc: { + start: { column: 25, line: 9 }, + end: { column: 29, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [245, 246], + loc: { + start: { column: 29, line: 9 }, + end: { column: 30, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [247, 248], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..1b2f2b793759 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-with-parens AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..6458930e0462 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain-with-parens AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/fixture.ts new file mode 100644 index 000000000000..dd8032308f2d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/fixture.ts @@ -0,0 +1,9 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function processOptional(one?: any) { + one?.two; + one?.two.three; + one.two?.three; + one.two?.three.four; + one.two?.three?.four; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..613e9dc1559b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,451 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [113, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [118, 121], + loc: { + start: { column: 7, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [113, 121], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [113, 121], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [113, 122], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [125, 128], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [130, 133], + loc: { + start: { column: 7, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + + range: [125, 133], + loc: { + start: { column: 2, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "three", + + range: [134, 139], + loc: { + start: { column: 11, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + + range: [125, 139], + loc: { + start: { column: 2, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + + range: [125, 139], + loc: { + start: { column: 2, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + + range: [125, 140], + loc: { + start: { column: 2, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [143, 146], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [147, 150], + loc: { + start: { column: 6, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + + range: [143, 150], + loc: { + start: { column: 2, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "three", + + range: [152, 157], + loc: { + start: { column: 11, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + + range: [143, 157], + loc: { + start: { column: 2, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + + range: [143, 157], + loc: { + start: { column: 2, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + + range: [143, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [161, 164], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [165, 168], + loc: { + start: { column: 6, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + + range: [161, 168], + loc: { + start: { column: 2, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "three", + + range: [170, 175], + loc: { + start: { column: 11, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + + range: [161, 175], + loc: { + start: { column: 2, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "four", + + range: [176, 180], + loc: { + start: { column: 17, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + + range: [161, 180], + loc: { + start: { column: 2, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + + range: [161, 180], + loc: { + start: { column: 2, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + + range: [161, 181], + loc: { + start: { column: 2, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [184, 187], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [188, 191], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + + range: [184, 191], + loc: { + start: { column: 2, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "three", + + range: [193, 198], + loc: { + start: { column: 11, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + + range: [184, 198], + loc: { + start: { column: 2, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "four", + + range: [200, 204], + loc: { + start: { column: 18, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [184, 204], + loc: { + start: { column: 2, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [184, 204], + loc: { + start: { column: 2, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [184, 205], + loc: { + start: { column: 2, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + ], + + range: [109, 207], + loc: { + start: { column: 36, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "processOptional", + + range: [82, 97], + loc: { + start: { column: 9, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "one", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [102, 107], + loc: { + start: { column: 29, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [98, 107], + loc: { + start: { column: 25, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + + range: [73, 207], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + ], + sourceType: "script", + + range: [73, 208], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 10 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..c71a12dbf612 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,426 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "processOptional", + + range: [82, 97], + loc: { + start: { column: 9, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [113, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [116, 118], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [118, 121], + loc: { + start: { column: 7, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [121, 122], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [125, 128], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [128, 130], + loc: { + start: { column: 5, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [130, 133], + loc: { + start: { column: 7, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [133, 134], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [134, 139], + loc: { + start: { column: 11, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [139, 140], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [143, 146], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [146, 147], + loc: { + start: { column: 5, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [147, 150], + loc: { + start: { column: 6, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [150, 152], + loc: { + start: { column: 9, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [152, 157], + loc: { + start: { column: 11, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [157, 158], + loc: { + start: { column: 16, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [161, 164], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [164, 165], + loc: { + start: { column: 5, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [165, 168], + loc: { + start: { column: 6, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [168, 170], + loc: { + start: { column: 9, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [170, 175], + loc: { + start: { column: 11, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [175, 176], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "four", + + range: [176, 180], + loc: { + start: { column: 17, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [180, 181], + loc: { + start: { column: 21, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [184, 187], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [187, 188], + loc: { + start: { column: 5, line: 8 }, + end: { column: 6, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [188, 191], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [191, 193], + loc: { + start: { column: 9, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [193, 198], + loc: { + start: { column: 11, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [198, 200], + loc: { + start: { column: 16, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "four", + + range: [200, 204], + loc: { + start: { column: 18, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [204, 205], + loc: { + start: { column: 22, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [206, 207], + loc: { + start: { column: 0, line: 9 }, + end: { column: 1, line: 9 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..65791fc1c951 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/3-Babel-AST.shot @@ -0,0 +1,451 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [113, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [118, 121], + loc: { + start: { column: 7, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [113, 121], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [113, 121], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [113, 122], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [125, 128], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "two", + + range: [130, 133], + loc: { + start: { column: 7, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + + range: [125, 133], + loc: { + start: { column: 2, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "three", + + range: [134, 139], + loc: { + start: { column: 11, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + + range: [125, 139], + loc: { + start: { column: 2, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + + range: [125, 139], + loc: { + start: { column: 2, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + + range: [125, 140], + loc: { + start: { column: 2, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [143, 146], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [147, 150], + loc: { + start: { column: 6, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + + range: [143, 150], + loc: { + start: { column: 2, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "three", + + range: [152, 157], + loc: { + start: { column: 11, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + + range: [143, 157], + loc: { + start: { column: 2, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + + range: [143, 157], + loc: { + start: { column: 2, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + + range: [143, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [161, 164], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [165, 168], + loc: { + start: { column: 6, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + + range: [161, 168], + loc: { + start: { column: 2, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "three", + + range: [170, 175], + loc: { + start: { column: 11, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + + range: [161, 175], + loc: { + start: { column: 2, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "four", + + range: [176, 180], + loc: { + start: { column: 17, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + + range: [161, 180], + loc: { + start: { column: 2, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + + range: [161, 180], + loc: { + start: { column: 2, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + + range: [161, 181], + loc: { + start: { column: 2, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "one", + + range: [184, 187], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "two", + + range: [188, 191], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + + range: [184, 191], + loc: { + start: { column: 2, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "three", + + range: [193, 198], + loc: { + start: { column: 11, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + + range: [184, 198], + loc: { + start: { column: 2, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "four", + + range: [200, 204], + loc: { + start: { column: 18, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [184, 204], + loc: { + start: { column: 2, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [184, 204], + loc: { + start: { column: 2, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + + range: [184, 205], + loc: { + start: { column: 2, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + ], + + range: [109, 207], + loc: { + start: { column: 36, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "processOptional", + + range: [82, 97], + loc: { + start: { column: 9, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "one", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [102, 107], + loc: { + start: { column: 29, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [98, 107], + loc: { + start: { column: 25, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + + range: [73, 207], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 9 }, + }, + }, + ], + sourceType: "script", + + range: [73, 208], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 10 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..cd8a2c88b557 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,426 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "processOptional", + + range: [82, 97], + loc: { + start: { column: 9, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [113, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [116, 118], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [118, 121], + loc: { + start: { column: 7, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [121, 122], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [125, 128], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [128, 130], + loc: { + start: { column: 5, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [130, 133], + loc: { + start: { column: 7, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [133, 134], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [134, 139], + loc: { + start: { column: 11, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [139, 140], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [143, 146], + loc: { + start: { column: 2, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [146, 147], + loc: { + start: { column: 5, line: 6 }, + end: { column: 6, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [147, 150], + loc: { + start: { column: 6, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [150, 152], + loc: { + start: { column: 9, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [152, 157], + loc: { + start: { column: 11, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [157, 158], + loc: { + start: { column: 16, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [161, 164], + loc: { + start: { column: 2, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [164, 165], + loc: { + start: { column: 5, line: 7 }, + end: { column: 6, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [165, 168], + loc: { + start: { column: 6, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [168, 170], + loc: { + start: { column: 9, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [170, 175], + loc: { + start: { column: 11, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [175, 176], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "four", + + range: [176, 180], + loc: { + start: { column: 17, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [180, 181], + loc: { + start: { column: 21, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "one", + + range: [184, 187], + loc: { + start: { column: 2, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [187, 188], + loc: { + start: { column: 5, line: 8 }, + end: { column: 6, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "two", + + range: [188, 191], + loc: { + start: { column: 6, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [191, 193], + loc: { + start: { column: 9, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "three", + + range: [193, 198], + loc: { + start: { column: 11, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [198, 200], + loc: { + start: { column: 16, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "four", + + range: [200, 204], + loc: { + start: { column: 18, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [204, 205], + loc: { + start: { column: 22, line: 8 }, + end: { column: 23, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [206, 207], + loc: { + start: { column: 0, line: 9 }, + end: { column: 1, line: 9 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..92619481bec0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..9f7ce5a3968b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics optional-chain AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/fixture.ts new file mode 100644 index 000000000000..9a6c42e0ef4e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/fixture.ts @@ -0,0 +1,4 @@ +// TODO: This fixture might be too large, and if so should be split up. + +// this should not be classed as a directive +('use strict'); diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..2a96da6a571e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,36 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics parenthesized-use-strict TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: Literal { + type: "Literal", + raw: "'use strict'", + value: "use strict", + + range: [119, 131], + loc: { + start: { column: 1, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [118, 133], + loc: { + start: { column: 0, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [118, 134], + loc: { + start: { column: 0, line: 4 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..2aace075ca7a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics parenthesized-use-strict TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [118, 119], + loc: { + start: { column: 0, line: 4 }, + end: { column: 1, line: 4 }, + }, + }, + String { + type: "String", + value: "'use strict'", + + range: [119, 131], + loc: { + start: { column: 1, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [131, 132], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [132, 133], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..6155a1ddfff1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/3-Babel-AST.shot @@ -0,0 +1,36 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics parenthesized-use-strict Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: Literal { + type: "Literal", + raw: "'use strict'", + value: "use strict", + + range: [119, 131], + loc: { + start: { column: 1, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [118, 133], + loc: { + start: { column: 0, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [118, 134], + loc: { + start: { column: 0, line: 4 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..f71352d11d37 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics parenthesized-use-strict Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [118, 119], + loc: { + start: { column: 0, line: 4 }, + end: { column: 1, line: 4 }, + }, + }, + String { + type: "String", + value: "'use strict'", + + range: [119, 131], + loc: { + start: { column: 1, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [131, 132], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [132, 133], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..e34063e5f5df --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics parenthesized-use-strict AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..efa28bf4e86f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/parenthesized-use-strict/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics parenthesized-use-strict AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/fixture.ts new file mode 100644 index 000000000000..da8ccc6e4795 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/fixture.ts @@ -0,0 +1,8 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + #prop1; + method(arg) { + return #prop1 in arg; + } +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..d7babfef7b39 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,169 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics private-fields-in-in TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + key: PrivateIdentifier { + type: "PrivateIdentifier", + name: "prop1", + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + override: false, + static: false, + value: null, + + range: [87, 94], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "method", + + range: [97, 103], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: BinaryExpression { + type: "BinaryExpression", + left: PrivateIdentifier { + type: "PrivateIdentifier", + name: "prop1", + + range: [122, 128], + loc: { + start: { column: 11, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + operator: "in", + right: Identifier { + type: "Identifier", + name: "arg", + + range: [132, 135], + loc: { + start: { column: 21, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [122, 135], + loc: { + start: { column: 11, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [115, 136], + loc: { + start: { column: 4, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + ], + + range: [109, 140], + loc: { + start: { column: 14, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "arg", + + range: [104, 107], + loc: { + start: { column: 9, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + ], + + range: [103, 140], + loc: { + start: { column: 8, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + + range: [97, 140], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + ], + + range: [83, 142], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 142], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], + sourceType: "script", + + range: [73, 143], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..2a9e1c1a0e5e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics private-fields-in-in TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "#prop1", + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [93, 94], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "method", + + range: [97, 103], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [103, 104], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "arg", + + range: [104, 107], + loc: { + start: { column: 9, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [107, 108], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [109, 110], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [115, 121], + loc: { + start: { column: 4, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "#prop1", + + range: [122, 128], + loc: { + start: { column: 11, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [129, 131], + loc: { + start: { column: 18, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "arg", + + range: [132, 135], + loc: { + start: { column: 21, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [135, 136], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [139, 140], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [141, 142], + loc: { + start: { column: 0, line: 8 }, + end: { column: 1, line: 8 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..67ea78fcbfd0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/3-Babel-AST.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics private-fields-in-in Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + key: PrivateIdentifier { + type: "PrivateIdentifier", + name: "prop1", + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + static: false, + value: null, + + range: [87, 94], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "method", + + range: [97, 103], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: BinaryExpression { + type: "BinaryExpression", + left: PrivateIdentifier { + type: "PrivateIdentifier", + name: "prop1", + + range: [122, 128], + loc: { + start: { column: 11, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + operator: "in", + right: Identifier { + type: "Identifier", + name: "arg", + + range: [132, 135], + loc: { + start: { column: 21, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [122, 135], + loc: { + start: { column: 11, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [115, 136], + loc: { + start: { column: 4, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + ], + + range: [109, 140], + loc: { + start: { column: 14, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "arg", + + range: [104, 107], + loc: { + start: { column: 9, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + ], + + range: [103, 140], + loc: { + start: { column: 8, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + + range: [97, 140], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + ], + + range: [83, 142], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 142], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], + sourceType: "script", + + range: [73, 143], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..1e0dbf537381 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics private-fields-in-in Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + PrivateIdentifier { + type: "PrivateIdentifier", + value: "prop1", + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [93, 94], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "method", + + range: [97, 103], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [103, 104], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "arg", + + range: [104, 107], + loc: { + start: { column: 9, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [107, 108], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [109, 110], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [115, 121], + loc: { + start: { column: 4, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + PrivateIdentifier { + type: "PrivateIdentifier", + value: "prop1", + + range: [122, 128], + loc: { + start: { column: 11, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [129, 131], + loc: { + start: { column: 18, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "arg", + + range: [132, 135], + loc: { + start: { column: 21, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [135, 136], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [139, 140], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [141, 142], + loc: { + start: { column: 0, line: 8 }, + end: { column: 1, line: 8 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..5d3082bbb161 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,173 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics private-fields-in-in AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + key: PrivateIdentifier { + type: 'PrivateIdentifier', + name: 'prop1', + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, +- override: false, + static: false, + value: null, + + range: [87, 94], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'method', + + range: [97, 103], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: BinaryExpression { + type: 'BinaryExpression', + left: PrivateIdentifier { + type: 'PrivateIdentifier', + name: 'prop1', + + range: [122, 128], + loc: { + start: { column: 11, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + operator: 'in', + right: Identifier { + type: 'Identifier', + name: 'arg', + + range: [132, 135], + loc: { + start: { column: 21, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [122, 135], + loc: { + start: { column: 11, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + + range: [115, 136], + loc: { + start: { column: 4, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + ], + + range: [109, 140], + loc: { + start: { column: 14, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: 'Identifier', + name: 'arg', + + range: [104, 107], + loc: { + start: { column: 9, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + ], + + range: [103, 140], + loc: { + start: { column: 8, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + + range: [97, 140], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + ], + + range: [83, 142], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 142], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 143], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..adc8a5401583 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,186 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics private-fields-in-in AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, +- Identifier { +- type: 'Identifier', +- value: '#prop1', ++ PrivateIdentifier { ++ type: 'PrivateIdentifier', ++ value: 'prop1', + + range: [87, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [93, 94], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'method', + + range: [97, 103], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [103, 104], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'arg', + + range: [104, 107], + loc: { + start: { column: 9, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [107, 108], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [109, 110], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'return', + + range: [115, 121], + loc: { + start: { column: 4, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, +- Identifier { +- type: 'Identifier', +- value: '#prop1', ++ PrivateIdentifier { ++ type: 'PrivateIdentifier', ++ value: 'prop1', + + range: [122, 128], + loc: { + start: { column: 11, line: 6 }, + end: { column: 17, line: 6 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'in', + + range: [129, 131], + loc: { + start: { column: 18, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'arg', + + range: [132, 135], + loc: { + start: { column: 21, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [135, 136], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [139, 140], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [141, 142], + loc: { + start: { column: 0, line: 8 }, + end: { column: 1, line: 8 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/fixture.ts new file mode 100644 index 000000000000..2f2ed0188a57 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/fixture.ts @@ -0,0 +1,11 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function foo(arr: ReadonlyArray) { + arr.slice(); // okay + arr.push('hello!'); // error! +} + +function foo(arr: readonly string[]) { + arr.slice(); // okay + arr.push('hello!'); // error! +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..813090394049 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,419 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics readonly-arrays TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "arr", + + range: [118, 121], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "slice", + + range: [122, 127], + loc: { + start: { column: 6, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + + range: [118, 127], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + optional: false, + + range: [118, 129], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [118, 130], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Literal { + type: "Literal", + raw: "'hello!'", + value: "hello!", + + range: [150, 158], + loc: { + start: { column: 11, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + ], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "arr", + + range: [141, 144], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "push", + + range: [145, 149], + loc: { + start: { column: 6, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + + range: [141, 149], + loc: { + start: { column: 2, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + optional: false, + + range: [141, 159], + loc: { + start: { column: 2, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + + range: [141, 160], + loc: { + start: { column: 2, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + ], + + range: [114, 172], + loc: { + start: { column: 41, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "arr", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "ReadonlyArray", + + range: [91, 104], + loc: { + start: { column: 18, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + ], + + range: [104, 112], + loc: { + start: { column: 31, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + + range: [91, 112], + loc: { + start: { column: 18, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + + range: [89, 112], + loc: { + start: { column: 16, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + + range: [86, 112], + loc: { + start: { column: 13, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + ], + + range: [73, 172], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "arr", + + range: [215, 218], + loc: { + start: { column: 2, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "slice", + + range: [219, 224], + loc: { + start: { column: 6, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + + range: [215, 224], + loc: { + start: { column: 2, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + optional: false, + + range: [215, 226], + loc: { + start: { column: 2, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + + range: [215, 227], + loc: { + start: { column: 2, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Literal { + type: "Literal", + raw: "'hello!'", + value: "hello!", + + range: [247, 255], + loc: { + start: { column: 11, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + ], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "arr", + + range: [238, 241], + loc: { + start: { column: 2, line: 10 }, + end: { column: 5, line: 10 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "push", + + range: [242, 246], + loc: { + start: { column: 6, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + + range: [238, 246], + loc: { + start: { column: 2, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + optional: false, + + range: [238, 256], + loc: { + start: { column: 2, line: 10 }, + end: { column: 20, line: 10 }, + }, + }, + + range: [238, 257], + loc: { + start: { column: 2, line: 10 }, + end: { column: 21, line: 10 }, + }, + }, + ], + + range: [211, 269], + loc: { + start: { column: 37, line: 8 }, + end: { column: 1, line: 11 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [183, 186], + loc: { + start: { column: 9, line: 8 }, + end: { column: 12, line: 8 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "arr", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeOperator { + type: "TSTypeOperator", + operator: "readonly", + typeAnnotation: TSArrayType { + type: "TSArrayType", + elementType: TSStringKeyword { + type: "TSStringKeyword", + + range: [201, 207], + loc: { + start: { column: 27, line: 8 }, + end: { column: 33, line: 8 }, + }, + }, + + range: [201, 209], + loc: { + start: { column: 27, line: 8 }, + end: { column: 35, line: 8 }, + }, + }, + + range: [192, 209], + loc: { + start: { column: 18, line: 8 }, + end: { column: 35, line: 8 }, + }, + }, + + range: [190, 209], + loc: { + start: { column: 16, line: 8 }, + end: { column: 35, line: 8 }, + }, + }, + + range: [187, 209], + loc: { + start: { column: 13, line: 8 }, + end: { column: 35, line: 8 }, + }, + }, + ], + + range: [174, 269], + loc: { + start: { column: 0, line: 8 }, + end: { column: 1, line: 11 }, + }, + }, + ], + sourceType: "script", + + range: [73, 270], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 12 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..e08d29ea838b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,506 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics readonly-arrays TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "arr", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "ReadonlyArray", + + range: [91, 104], + loc: { + start: { column: 18, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "arr", + + range: [118, 121], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [121, 122], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "slice", + + range: [122, 127], + loc: { + start: { column: 6, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [127, 128], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [128, 129], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [129, 130], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "arr", + + range: [141, 144], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [144, 145], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "push", + + range: [145, 149], + loc: { + start: { column: 6, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [149, 150], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + String { + type: "String", + value: "'hello!'", + + range: [150, 158], + loc: { + start: { column: 11, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [158, 159], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [159, 160], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [171, 172], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [174, 182], + loc: { + start: { column: 0, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [183, 186], + loc: { + start: { column: 9, line: 8 }, + end: { column: 12, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [186, 187], + loc: { + start: { column: 12, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "arr", + + range: [187, 190], + loc: { + start: { column: 13, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [190, 191], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [192, 200], + loc: { + start: { column: 18, line: 8 }, + end: { column: 26, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [201, 207], + loc: { + start: { column: 27, line: 8 }, + end: { column: 33, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [207, 208], + loc: { + start: { column: 33, line: 8 }, + end: { column: 34, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [208, 209], + loc: { + start: { column: 34, line: 8 }, + end: { column: 35, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [209, 210], + loc: { + start: { column: 35, line: 8 }, + end: { column: 36, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [211, 212], + loc: { + start: { column: 37, line: 8 }, + end: { column: 38, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "arr", + + range: [215, 218], + loc: { + start: { column: 2, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [218, 219], + loc: { + start: { column: 5, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "slice", + + range: [219, 224], + loc: { + start: { column: 6, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [224, 225], + loc: { + start: { column: 11, line: 9 }, + end: { column: 12, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [225, 226], + loc: { + start: { column: 12, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [226, 227], + loc: { + start: { column: 13, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "arr", + + range: [238, 241], + loc: { + start: { column: 2, line: 10 }, + end: { column: 5, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [241, 242], + loc: { + start: { column: 5, line: 10 }, + end: { column: 6, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "push", + + range: [242, 246], + loc: { + start: { column: 6, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [246, 247], + loc: { + start: { column: 10, line: 10 }, + end: { column: 11, line: 10 }, + }, + }, + String { + type: "String", + value: "'hello!'", + + range: [247, 255], + loc: { + start: { column: 11, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [255, 256], + loc: { + start: { column: 19, line: 10 }, + end: { column: 20, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [256, 257], + loc: { + start: { column: 20, line: 10 }, + end: { column: 21, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [268, 269], + loc: { + start: { column: 0, line: 11 }, + end: { column: 1, line: 11 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..efa2e6c28179 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/3-Babel-AST.shot @@ -0,0 +1,419 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics readonly-arrays Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "arr", + + range: [118, 121], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "slice", + + range: [122, 127], + loc: { + start: { column: 6, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + + range: [118, 127], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + optional: false, + + range: [118, 129], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [118, 130], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Literal { + type: "Literal", + raw: "'hello!'", + value: "hello!", + + range: [150, 158], + loc: { + start: { column: 11, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + ], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "arr", + + range: [141, 144], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "push", + + range: [145, 149], + loc: { + start: { column: 6, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + + range: [141, 149], + loc: { + start: { column: 2, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + optional: false, + + range: [141, 159], + loc: { + start: { column: 2, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + + range: [141, 160], + loc: { + start: { column: 2, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + ], + + range: [114, 172], + loc: { + start: { column: 41, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "arr", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "ReadonlyArray", + + range: [91, 104], + loc: { + start: { column: 18, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + ], + + range: [104, 112], + loc: { + start: { column: 31, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + + range: [91, 112], + loc: { + start: { column: 18, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + + range: [89, 112], + loc: { + start: { column: 16, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + + range: [86, 112], + loc: { + start: { column: 13, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + ], + + range: [73, 172], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "arr", + + range: [215, 218], + loc: { + start: { column: 2, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "slice", + + range: [219, 224], + loc: { + start: { column: 6, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + + range: [215, 224], + loc: { + start: { column: 2, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + optional: false, + + range: [215, 226], + loc: { + start: { column: 2, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + + range: [215, 227], + loc: { + start: { column: 2, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Literal { + type: "Literal", + raw: "'hello!'", + value: "hello!", + + range: [247, 255], + loc: { + start: { column: 11, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + ], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "arr", + + range: [238, 241], + loc: { + start: { column: 2, line: 10 }, + end: { column: 5, line: 10 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "push", + + range: [242, 246], + loc: { + start: { column: 6, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + + range: [238, 246], + loc: { + start: { column: 2, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + optional: false, + + range: [238, 256], + loc: { + start: { column: 2, line: 10 }, + end: { column: 20, line: 10 }, + }, + }, + + range: [238, 257], + loc: { + start: { column: 2, line: 10 }, + end: { column: 21, line: 10 }, + }, + }, + ], + + range: [211, 269], + loc: { + start: { column: 37, line: 8 }, + end: { column: 1, line: 11 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [183, 186], + loc: { + start: { column: 9, line: 8 }, + end: { column: 12, line: 8 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "arr", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeOperator { + type: "TSTypeOperator", + operator: "readonly", + typeAnnotation: TSArrayType { + type: "TSArrayType", + elementType: TSStringKeyword { + type: "TSStringKeyword", + + range: [201, 207], + loc: { + start: { column: 27, line: 8 }, + end: { column: 33, line: 8 }, + }, + }, + + range: [201, 209], + loc: { + start: { column: 27, line: 8 }, + end: { column: 35, line: 8 }, + }, + }, + + range: [192, 209], + loc: { + start: { column: 18, line: 8 }, + end: { column: 35, line: 8 }, + }, + }, + + range: [190, 209], + loc: { + start: { column: 16, line: 8 }, + end: { column: 35, line: 8 }, + }, + }, + + range: [187, 209], + loc: { + start: { column: 13, line: 8 }, + end: { column: 35, line: 8 }, + }, + }, + ], + + range: [174, 269], + loc: { + start: { column: 0, line: 8 }, + end: { column: 1, line: 11 }, + }, + }, + ], + sourceType: "script", + + range: [73, 270], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 12 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..253110e85cfa --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,506 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics readonly-arrays Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "arr", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "ReadonlyArray", + + range: [91, 104], + loc: { + start: { column: 18, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "arr", + + range: [118, 121], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [121, 122], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "slice", + + range: [122, 127], + loc: { + start: { column: 6, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [127, 128], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [128, 129], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [129, 130], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "arr", + + range: [141, 144], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [144, 145], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "push", + + range: [145, 149], + loc: { + start: { column: 6, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [149, 150], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + String { + type: "String", + value: "'hello!'", + + range: [150, 158], + loc: { + start: { column: 11, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [158, 159], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [159, 160], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [171, 172], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [174, 182], + loc: { + start: { column: 0, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [183, 186], + loc: { + start: { column: 9, line: 8 }, + end: { column: 12, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [186, 187], + loc: { + start: { column: 12, line: 8 }, + end: { column: 13, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "arr", + + range: [187, 190], + loc: { + start: { column: 13, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [190, 191], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [192, 200], + loc: { + start: { column: 18, line: 8 }, + end: { column: 26, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [201, 207], + loc: { + start: { column: 27, line: 8 }, + end: { column: 33, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [207, 208], + loc: { + start: { column: 33, line: 8 }, + end: { column: 34, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [208, 209], + loc: { + start: { column: 34, line: 8 }, + end: { column: 35, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [209, 210], + loc: { + start: { column: 35, line: 8 }, + end: { column: 36, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [211, 212], + loc: { + start: { column: 37, line: 8 }, + end: { column: 38, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "arr", + + range: [215, 218], + loc: { + start: { column: 2, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [218, 219], + loc: { + start: { column: 5, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "slice", + + range: [219, 224], + loc: { + start: { column: 6, line: 9 }, + end: { column: 11, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [224, 225], + loc: { + start: { column: 11, line: 9 }, + end: { column: 12, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [225, 226], + loc: { + start: { column: 12, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [226, 227], + loc: { + start: { column: 13, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "arr", + + range: [238, 241], + loc: { + start: { column: 2, line: 10 }, + end: { column: 5, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [241, 242], + loc: { + start: { column: 5, line: 10 }, + end: { column: 6, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "push", + + range: [242, 246], + loc: { + start: { column: 6, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [246, 247], + loc: { + start: { column: 10, line: 10 }, + end: { column: 11, line: 10 }, + }, + }, + String { + type: "String", + value: "'hello!'", + + range: [247, 255], + loc: { + start: { column: 11, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [255, 256], + loc: { + start: { column: 19, line: 10 }, + end: { column: 20, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [256, 257], + loc: { + start: { column: 20, line: 10 }, + end: { column: 21, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [268, 269], + loc: { + start: { column: 0, line: 11 }, + end: { column: 1, line: 11 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..8dceef593436 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics readonly-arrays AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..c083909ff710 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics readonly-arrays AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/fixture.ts new file mode 100644 index 000000000000..3904de2177c5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function foo(pair: readonly [string, string]) { + console.log(pair[0]); // okay + pair[1] = 'hello!'; // error +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..5635686479b9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,255 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics readonly-tuples TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "pair", + + range: [135, 139], + loc: { + start: { column: 14, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "0", + value: 0, + + range: [140, 141], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [135, 142], + loc: { + start: { column: 14, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + ], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "console", + + range: [123, 130], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "log", + + range: [131, 134], + loc: { + start: { column: 10, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [123, 134], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + optional: false, + + range: [123, 143], + loc: { + start: { column: 2, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [123, 144], + loc: { + start: { column: 2, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "pair", + + range: [155, 159], + loc: { + start: { column: 2, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [160, 161], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + + range: [155, 162], + loc: { + start: { column: 2, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + operator: "=", + right: Literal { + type: "Literal", + raw: "'hello!'", + value: "hello!", + + range: [165, 173], + loc: { + start: { column: 12, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + + range: [155, 173], + loc: { + start: { column: 2, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + + range: [155, 174], + loc: { + start: { column: 2, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + ], + + range: [119, 185], + loc: { + start: { column: 46, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "pair", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeOperator { + type: "TSTypeOperator", + operator: "readonly", + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [102, 108], + loc: { + start: { column: 29, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + TSStringKeyword { + type: "TSStringKeyword", + + range: [110, 116], + loc: { + start: { column: 37, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + ], + + range: [101, 117], + loc: { + start: { column: 28, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [92, 117], + loc: { + start: { column: 19, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [90, 117], + loc: { + start: { column: 17, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [86, 117], + loc: { + start: { column: 13, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + ], + + range: [73, 185], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 186], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..3e8972497ad6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,316 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics readonly-tuples TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "pair", + + range: [86, 90], + loc: { + start: { column: 13, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [92, 100], + loc: { + start: { column: 19, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [102, 108], + loc: { + start: { column: 29, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [110, 116], + loc: { + start: { column: 37, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "console", + + range: [123, 130], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [130, 131], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "log", + + range: [131, 134], + loc: { + start: { column: 10, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [134, 135], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "pair", + + range: [135, 139], + loc: { + start: { column: 14, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [139, 140], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "0", + + range: [140, 141], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [141, 142], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [142, 143], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [143, 144], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "pair", + + range: [155, 159], + loc: { + start: { column: 2, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [159, 160], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [160, 161], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [161, 162], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [163, 164], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + String { + type: "String", + value: "'hello!'", + + range: [165, 173], + loc: { + start: { column: 12, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [173, 174], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [184, 185], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..dd2736244609 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/3-Babel-AST.shot @@ -0,0 +1,255 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics readonly-tuples Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "pair", + + range: [135, 139], + loc: { + start: { column: 14, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "0", + value: 0, + + range: [140, 141], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [135, 142], + loc: { + start: { column: 14, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + ], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "console", + + range: [123, 130], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "log", + + range: [131, 134], + loc: { + start: { column: 10, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [123, 134], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + optional: false, + + range: [123, 143], + loc: { + start: { column: 2, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [123, 144], + loc: { + start: { column: 2, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: MemberExpression { + type: "MemberExpression", + computed: true, + object: Identifier { + type: "Identifier", + name: "pair", + + range: [155, 159], + loc: { + start: { column: 2, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + optional: false, + property: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [160, 161], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + + range: [155, 162], + loc: { + start: { column: 2, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + operator: "=", + right: Literal { + type: "Literal", + raw: "'hello!'", + value: "hello!", + + range: [165, 173], + loc: { + start: { column: 12, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + + range: [155, 173], + loc: { + start: { column: 2, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + + range: [155, 174], + loc: { + start: { column: 2, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + ], + + range: [119, 185], + loc: { + start: { column: 46, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "pair", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeOperator { + type: "TSTypeOperator", + operator: "readonly", + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [102, 108], + loc: { + start: { column: 29, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + TSStringKeyword { + type: "TSStringKeyword", + + range: [110, 116], + loc: { + start: { column: 37, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + ], + + range: [101, 117], + loc: { + start: { column: 28, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [92, 117], + loc: { + start: { column: 19, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [90, 117], + loc: { + start: { column: 17, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [86, 117], + loc: { + start: { column: 13, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + ], + + range: [73, 185], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 186], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..746e9a2b62d6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,316 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics readonly-tuples Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "pair", + + range: [86, 90], + loc: { + start: { column: 13, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [92, 100], + loc: { + start: { column: 19, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [102, 108], + loc: { + start: { column: 29, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [110, 116], + loc: { + start: { column: 37, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "console", + + range: [123, 130], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [130, 131], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "log", + + range: [131, 134], + loc: { + start: { column: 10, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [134, 135], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "pair", + + range: [135, 139], + loc: { + start: { column: 14, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [139, 140], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Numeric { + type: "Numeric", + value: "0", + + range: [140, 141], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [141, 142], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [142, 143], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [143, 144], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "pair", + + range: [155, 159], + loc: { + start: { column: 2, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [159, 160], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [160, 161], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [161, 162], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [163, 164], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + String { + type: "String", + value: "'hello!'", + + range: [165, 173], + loc: { + start: { column: 12, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [173, 174], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [184, 185], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..19033edfa0d6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics readonly-tuples AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..89cd877665d5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics readonly-tuples AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/fixture.ts new file mode 100644 index 000000000000..d9d7591e0103 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +a ||= b; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..eb4f0c1cbdb3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,55 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics short-circuiting-assignment-and-and TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: Identifier { + type: "Identifier", + name: "a", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + operator: "||=", + right: Identifier { + type: "Identifier", + name: "b", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..f6e8991d7939 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics short-circuiting-assignment-and-and TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "a", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "||=", + + range: [75, 78], + loc: { + start: { column: 2, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..89556c77bf10 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/3-Babel-AST.shot @@ -0,0 +1,55 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics short-circuiting-assignment-and-and Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: Identifier { + type: "Identifier", + name: "a", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + operator: "||=", + right: Identifier { + type: "Identifier", + name: "b", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..1986e288c37e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics short-circuiting-assignment-and-and Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "a", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "||=", + + range: [75, 78], + loc: { + start: { column: 2, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..75095e768945 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics short-circuiting-assignment-and-and AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..c3ed249d1de7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics short-circuiting-assignment-and-and AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/fixture.ts new file mode 100644 index 000000000000..326add2260a7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +a &&= b; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..c0e966557fde --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,55 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics short-circuiting-assignment-or-or TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: Identifier { + type: "Identifier", + name: "a", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + operator: "&&=", + right: Identifier { + type: "Identifier", + name: "b", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..b3c94972f6ea --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics short-circuiting-assignment-or-or TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "a", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&&=", + + range: [75, 78], + loc: { + start: { column: 2, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..43f9150b7d57 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/3-Babel-AST.shot @@ -0,0 +1,55 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics short-circuiting-assignment-or-or Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: Identifier { + type: "Identifier", + name: "a", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + operator: "&&=", + right: Identifier { + type: "Identifier", + name: "b", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..8e26dab593b3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics short-circuiting-assignment-or-or Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "a", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&&=", + + range: [75, 78], + loc: { + start: { column: 2, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..99034f0c6828 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics short-circuiting-assignment-or-or AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..cee79d308bdf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics short-circuiting-assignment-or-or AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/fixture.ts new file mode 100644 index 000000000000..c57fc18dd8d6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +a ??= b; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..e007edefd48c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,55 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics short-circuiting-assignment-question-question TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: Identifier { + type: "Identifier", + name: "a", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + operator: "??=", + right: Identifier { + type: "Identifier", + name: "b", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..272475b5e97b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics short-circuiting-assignment-question-question TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "a", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "??=", + + range: [75, 78], + loc: { + start: { column: 2, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..d9505ab6ce22 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/3-Babel-AST.shot @@ -0,0 +1,55 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics short-circuiting-assignment-question-question Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: Identifier { + type: "Identifier", + name: "a", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + operator: "??=", + right: Identifier { + type: "Identifier", + name: "b", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..01745dcfd04b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics short-circuiting-assignment-question-question Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "a", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "??=", + + range: [75, 78], + loc: { + start: { column: 2, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..225b4642d6d4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics short-circuiting-assignment-question-question AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..5518c0b446fb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics short-circuiting-assignment-question-question AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/fixture.ts new file mode 100644 index 000000000000..fb1fffc8c9e8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function test(abc: Map) {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..3047970439eb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,117 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics symbol-type-param TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [113, 115], + loc: { + start: { column: 40, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "test", + + range: [82, 86], + loc: { + start: { column: 9, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "abc", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Map", + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSSymbolKeyword { + type: "TSSymbolKeyword", + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + TSStringKeyword { + type: "TSStringKeyword", + + range: [104, 110], + loc: { + start: { column: 31, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + ], + + range: [95, 111], + loc: { + start: { column: 22, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [92, 111], + loc: { + start: { column: 19, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [90, 111], + loc: { + start: { column: 17, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [87, 111], + loc: { + start: { column: 14, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + ], + + range: [73, 115], + loc: { + start: { column: 0, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 116], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..485a5e615184 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics symbol-type-param TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "test", + + range: [82, 86], + loc: { + start: { column: 9, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "abc", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Map", + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "symbol", + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [104, 110], + loc: { + start: { column: 31, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [113, 114], + loc: { + start: { column: 40, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..4871671855da --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/3-Babel-AST.shot @@ -0,0 +1,117 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics symbol-type-param Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [113, 115], + loc: { + start: { column: 40, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "test", + + range: [82, 86], + loc: { + start: { column: 9, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "abc", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Map", + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSSymbolKeyword { + type: "TSSymbolKeyword", + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + TSStringKeyword { + type: "TSStringKeyword", + + range: [104, 110], + loc: { + start: { column: 31, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + ], + + range: [95, 111], + loc: { + start: { column: 22, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [92, 111], + loc: { + start: { column: 19, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [90, 111], + loc: { + start: { column: 17, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [87, 111], + loc: { + start: { column: 14, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + ], + + range: [73, 115], + loc: { + start: { column: 0, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 116], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..e27091364a07 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics symbol-type-param Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "test", + + range: [82, 86], + loc: { + start: { column: 9, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "abc", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Map", + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "symbol", + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [104, 110], + loc: { + start: { column: 31, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [113, 114], + loc: { + start: { column: 40, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..e99b60c13e31 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics symbol-type-param AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..8b5bbc76be71 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics symbol-type-param AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/fixture.ts new file mode 100644 index 000000000000..3cc92b25122c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export type TestCallback = (a: number) => void; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..22c878c0653e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,105 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export-function-type TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "TestCallback", + + range: [85, 97], + loc: { + start: { column: 12, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + params: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [104, 110], + loc: { + start: { column: 31, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + + range: [102, 110], + loc: { + start: { column: 29, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + + range: [101, 110], + loc: { + start: { column: 28, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [115, 119], + loc: { + start: { column: 42, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [112, 119], + loc: { + start: { column: 39, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [100, 119], + loc: { + start: { column: 27, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [80, 120], + loc: { + start: { column: 7, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + exportKind: "type", + source: null, + specifiers: Array [], + + range: [73, 120], + loc: { + start: { column: 0, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..2ed7f9099252 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export-function-type TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "TestCallback", + + range: [85, 97], + loc: { + start: { column: 12, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [104, 110], + loc: { + start: { column: 31, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [112, 114], + loc: { + start: { column: 39, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [115, 119], + loc: { + start: { column: 42, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..cf4bd8d5f0e7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/3-Babel-AST.shot @@ -0,0 +1,105 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export-function-type Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "TestCallback", + + range: [85, 97], + loc: { + start: { column: 12, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + parameters: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [104, 110], + loc: { + start: { column: 31, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + + range: [102, 110], + loc: { + start: { column: 29, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + + range: [101, 110], + loc: { + start: { column: 28, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [115, 119], + loc: { + start: { column: 42, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [112, 119], + loc: { + start: { column: 39, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [100, 119], + loc: { + start: { column: 27, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [80, 120], + loc: { + start: { column: 7, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + exportKind: "type", + source: null, + specifiers: Array [], + + range: [73, 120], + loc: { + start: { column: 0, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..3748f9c29c9c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export-function-type Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "TestCallback", + + range: [85, 97], + loc: { + start: { column: 12, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [104, 110], + loc: { + start: { column: 31, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [112, 114], + loc: { + start: { column: 39, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [115, 119], + loc: { + start: { column: 42, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..80b2ec22efdf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,112 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export-function-type AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'TestCallback', + + range: [85, 97], + loc: { + start: { column: 12, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + typeAnnotation: TSFunctionType { + type: 'TSFunctionType', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'a', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [104, 110], + loc: { + start: { column: 31, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + + range: [102, 110], + loc: { + start: { column: 29, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + + range: [101, 110], + loc: { + start: { column: 28, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSVoidKeyword { + type: 'TSVoidKeyword', + + range: [115, 119], + loc: { + start: { column: 42, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [112, 119], + loc: { + start: { column: 39, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [100, 119], + loc: { + start: { column: 27, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [80, 120], + loc: { + start: { column: 7, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + exportKind: 'type', + source: null, + specifiers: Array [], + + range: [73, 120], + loc: { + start: { column: 0, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..b413a0648f32 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export-function-type AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/fixture.ts new file mode 100644 index 000000000000..33e2a41a9464 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export type TestClassProps = { + count: number; +}; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..748786cc25e4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,97 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export-object-type TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "TestClassProps", + + range: [85, 99], + loc: { + start: { column: 12, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "count", + + range: [106, 111], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [113, 119], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [111, 119], + loc: { + start: { column: 7, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [106, 120], + loc: { + start: { column: 2, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + ], + + range: [102, 122], + loc: { + start: { column: 29, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + + range: [80, 123], + loc: { + start: { column: 7, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + exportKind: "type", + source: null, + specifiers: Array [], + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + sourceType: "module", + + range: [73, 124], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..eada6d4fea15 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export-object-type TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "TestClassProps", + + range: [85, 99], + loc: { + start: { column: 12, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "count", + + range: [106, 111], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [111, 112], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [113, 119], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [119, 120], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [121, 122], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [122, 123], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..17474aaaa5c7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/3-Babel-AST.shot @@ -0,0 +1,97 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export-object-type Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "TestClassProps", + + range: [85, 99], + loc: { + start: { column: 12, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "count", + + range: [106, 111], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [113, 119], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [111, 119], + loc: { + start: { column: 7, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [106, 120], + loc: { + start: { column: 2, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + ], + + range: [102, 122], + loc: { + start: { column: 29, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + + range: [80, 123], + loc: { + start: { column: 7, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + exportKind: "type", + source: null, + specifiers: Array [], + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 124], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..efa58e26dd9a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export-object-type Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "TestClassProps", + + range: [85, 99], + loc: { + start: { column: 12, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "count", + + range: [106, 111], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [111, 112], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [113, 119], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [119, 120], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [121, 122], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [122, 123], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..c5fc765d0c2f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,102 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export-object-type AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'TestClassProps', + + range: [85, 99], + loc: { + start: { column: 12, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: 'TSTypeLiteral', + members: Array [ + TSPropertySignature { + type: 'TSPropertySignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'count', + + range: [106, 111], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [113, 119], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [111, 119], + loc: { + start: { column: 7, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [106, 120], + loc: { + start: { column: 2, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + ], + + range: [102, 122], + loc: { + start: { column: 29, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + + range: [80, 123], + loc: { + start: { column: 7, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + exportKind: 'type', + source: null, + specifiers: Array [], + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [73, 124], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..f15badc3beec --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export-object-type AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/fixture.ts new file mode 100644 index 000000000000..fa371f2f4264 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export type TestAlias = string | number; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..1e784b69eaab --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,77 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "TestAlias", + + range: [85, 94], + loc: { + start: { column: 12, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [97, 103], + loc: { + start: { column: 24, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [106, 112], + loc: { + start: { column: 33, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + ], + + range: [97, 112], + loc: { + start: { column: 24, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + + range: [80, 113], + loc: { + start: { column: 7, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + exportKind: "type", + source: null, + specifiers: Array [], + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 114], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..61db5358f3b0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "TestAlias", + + range: [85, 94], + loc: { + start: { column: 12, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [97, 103], + loc: { + start: { column: 24, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [106, 112], + loc: { + start: { column: 33, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..98560d81113b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/3-Babel-AST.shot @@ -0,0 +1,77 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "TestAlias", + + range: [85, 94], + loc: { + start: { column: 12, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [97, 103], + loc: { + start: { column: 24, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [106, 112], + loc: { + start: { column: 33, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + ], + + range: [97, 112], + loc: { + start: { column: 24, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + + range: [80, 113], + loc: { + start: { column: 7, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + exportKind: "type", + source: null, + specifiers: Array [], + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 114], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..25a65b4e78cd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "TestAlias", + + range: [85, 94], + loc: { + start: { column: 12, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [97, 103], + loc: { + start: { column: 24, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [106, 112], + loc: { + start: { column: 33, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..c9403c51801f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,82 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'TestAlias', + + range: [85, 94], + loc: { + start: { column: 12, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + typeAnnotation: TSUnionType { + type: 'TSUnionType', + types: Array [ + TSStringKeyword { + type: 'TSStringKeyword', + + range: [97, 103], + loc: { + start: { column: 24, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [106, 112], + loc: { + start: { column: 33, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + ], + + range: [97, 112], + loc: { + start: { column: 24, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + + range: [80, 113], + loc: { + start: { column: 7, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + exportKind: 'type', + source: null, + specifiers: Array [], + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [73, 114], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..f9d101b6c0ea --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/fixture.ts new file mode 100644 index 000000000000..12d554709873 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Result = Success | Failure; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..795cf38b0f51 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-with-constrained-type-parameter TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Result", + + range: [78, 84], + loc: { + start: { column: 5, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Success", + + range: [101, 108], + loc: { + start: { column: 28, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + ], + + range: [108, 111], + loc: { + start: { column: 35, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [101, 111], + loc: { + start: { column: 28, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Failure", + + range: [114, 121], + loc: { + start: { column: 41, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + + range: [114, 121], + loc: { + start: { column: 41, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + ], + + range: [101, 121], + loc: { + start: { column: 28, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + constraint: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [], + + range: [95, 97], + loc: { + start: { column: 22, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + out: false, + + range: [85, 97], + loc: { + start: { column: 12, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + + range: [84, 98], + loc: { + start: { column: 11, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 49, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..4cba7521eb04 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-with-constrained-type-parameter TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Result", + + range: [78, 84], + loc: { + start: { column: 5, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [87, 94], + loc: { + start: { column: 14, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Success", + + range: [101, 108], + loc: { + start: { column: 28, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Failure", + + range: [114, 121], + loc: { + start: { column: 41, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [121, 122], + loc: { + start: { column: 48, line: 3 }, + end: { column: 49, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..fc70f27dc928 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/3-Babel-AST.shot @@ -0,0 +1,145 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-with-constrained-type-parameter Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Result", + + range: [78, 84], + loc: { + start: { column: 5, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Success", + + range: [101, 108], + loc: { + start: { column: 28, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + ], + + range: [108, 111], + loc: { + start: { column: 35, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [101, 111], + loc: { + start: { column: 28, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Failure", + + range: [114, 121], + loc: { + start: { column: 41, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + + range: [114, 121], + loc: { + start: { column: 41, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + ], + + range: [101, 121], + loc: { + start: { column: 28, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + constraint: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [], + + range: [95, 97], + loc: { + start: { column: 22, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + name: "T", + + range: [85, 97], + loc: { + start: { column: 12, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + + range: [84, 98], + loc: { + start: { column: 11, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 49, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..a6d0d2061ec2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-with-constrained-type-parameter Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Result", + + range: [78, 84], + loc: { + start: { column: 5, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [87, 94], + loc: { + start: { column: 14, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Success", + + range: [101, 108], + loc: { + start: { column: 28, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Failure", + + range: [114, 121], + loc: { + start: { column: 41, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [121, 122], + loc: { + start: { column: 48, line: 3 }, + end: { column: 49, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..dc8fc8c015ac --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,161 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-with-constrained-type-parameter AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'Result', + + range: [78, 84], + loc: { + start: { column: 5, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + typeAnnotation: TSUnionType { + type: 'TSUnionType', + types: Array [ + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'Success', + + range: [101, 108], + loc: { + start: { column: 28, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + ], + + range: [108, 111], + loc: { + start: { column: 35, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [101, 111], + loc: { + start: { column: 28, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'Failure', + + range: [114, 121], + loc: { + start: { column: 41, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + + range: [114, 121], + loc: { + start: { column: 41, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + ], + + range: [101, 121], + loc: { + start: { column: 28, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSTypeLiteral { + type: 'TSTypeLiteral', + members: Array [], + + range: [95, 97], + loc: { + start: { column: 22, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [85, 86], +- loc: { +- start: { column: 12, line: 3 }, +- end: { column: 13, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [85, 97], + loc: { + start: { column: 12, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + + range: [84, 98], + loc: { + start: { column: 11, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 49, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..ce507306981b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-with-constrained-type-parameter AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/fixture.ts new file mode 100644 index 000000000000..df157246d3e3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Result = Success | Failure; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..0a8917e84b8d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Result", + + range: [78, 84], + loc: { + start: { column: 5, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Success", + + range: [90, 97], + loc: { + start: { column: 17, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + + range: [97, 100], + loc: { + start: { column: 24, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [90, 100], + loc: { + start: { column: 17, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Failure", + + range: [103, 110], + loc: { + start: { column: 30, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + + range: [103, 110], + loc: { + start: { column: 30, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + ], + + range: [90, 110], + loc: { + start: { column: 17, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + out: false, + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + ], + + range: [84, 87], + loc: { + start: { column: 11, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [73, 111], + loc: { + start: { column: 0, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..23669ec18d7e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Result", + + range: [78, 84], + loc: { + start: { column: 5, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Success", + + range: [90, 97], + loc: { + start: { column: 17, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Failure", + + range: [103, 110], + loc: { + start: { column: 30, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..cb7002419354 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/3-Babel-AST.shot @@ -0,0 +1,135 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Result", + + range: [78, 84], + loc: { + start: { column: 5, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Success", + + range: [90, 97], + loc: { + start: { column: 17, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + + range: [97, 100], + loc: { + start: { column: 24, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [90, 100], + loc: { + start: { column: 17, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Failure", + + range: [103, 110], + loc: { + start: { column: 30, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + + range: [103, 110], + loc: { + start: { column: 30, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + ], + + range: [90, 110], + loc: { + start: { column: 17, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + ], + + range: [84, 87], + loc: { + start: { column: 11, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [73, 111], + loc: { + start: { column: 0, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..57e122c71c64 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Result", + + range: [78, 84], + loc: { + start: { column: 5, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Success", + + range: [90, 97], + loc: { + start: { column: 17, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Failure", + + range: [103, 110], + loc: { + start: { column: 30, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..37f3b64b54e1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,151 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'Result', + + range: [78, 84], + loc: { + start: { column: 5, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + typeAnnotation: TSUnionType { + type: 'TSUnionType', + types: Array [ + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'Success', + + range: [90, 97], + loc: { + start: { column: 17, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + + range: [97, 100], + loc: { + start: { column: 24, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [90, 100], + loc: { + start: { column: 17, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'Failure', + + range: [103, 110], + loc: { + start: { column: 30, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + + range: [103, 110], + loc: { + start: { column: 30, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + ], + + range: [90, 110], + loc: { + start: { column: 17, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [85, 86], +- loc: { +- start: { column: 12, line: 3 }, +- end: { column: 13, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + ], + + range: [84, 87], + loc: { + start: { column: 11, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [73, 111], + loc: { + start: { column: 0, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..91dbe91f6c4c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-declaration AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/fixture.ts new file mode 100644 index 000000000000..28486c4a18cb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type foo = { bar: string; baz }; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..4db74606bd41 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,104 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-object-without-annotation TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [91, 97], + loc: { + start: { column: 18, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [89, 97], + loc: { + start: { column: 16, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [86, 98], + loc: { + start: { column: 13, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + + range: [84, 104], + loc: { + start: { column: 11, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..5db3039c0cc1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-object-without-annotation TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [91, 97], + loc: { + start: { column: 18, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..5a0ed2139334 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/3-Babel-AST.shot @@ -0,0 +1,104 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-object-without-annotation Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [91, 97], + loc: { + start: { column: 18, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [89, 97], + loc: { + start: { column: 16, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [86, 98], + loc: { + start: { column: 13, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "baz", + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + + range: [84, 104], + loc: { + start: { column: 11, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..ed31551b027e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-object-without-annotation Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [91, 97], + loc: { + start: { column: 18, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..f7ab811dca3e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-object-without-annotation AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..245823aa4cd9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-alias-object-without-annotation AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/fixture.ts new file mode 100644 index 000000000000..44f212c67f05 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +const assertString = (x: any): asserts x => { + return; +}; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..15cdfc47fb7b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,141 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-arrow-function TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "assertString", + + range: [79, 91], + loc: { + start: { column: 6, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + init: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: null, + + range: [121, 128], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + ], + + range: [117, 130], + loc: { + start: { column: 44, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [96, 101], + loc: { + start: { column: 23, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: true, + parameterName: Identifier { + type: "Identifier", + name: "x", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + typeAnnotation: null, + + range: [104, 113], + loc: { + start: { column: 31, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + + range: [102, 113], + loc: { + start: { column: 29, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + + range: [94, 130], + loc: { + start: { column: 21, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + + range: [79, 130], + loc: { + start: { column: 6, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + kind: "const", + + range: [73, 131], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 132], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..c702a1cb1039 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-arrow-function TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "const", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "assertString", + + range: [79, 91], + loc: { + start: { column: 6, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [104, 111], + loc: { + start: { column: 31, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [114, 116], + loc: { + start: { column: 41, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [121, 127], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [127, 128], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [129, 130], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [130, 131], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..9a750d3f8be4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/3-Babel-AST.shot @@ -0,0 +1,141 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-arrow-function Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "assertString", + + range: [79, 91], + loc: { + start: { column: 6, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + init: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: null, + + range: [121, 128], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + ], + + range: [117, 130], + loc: { + start: { column: 44, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [96, 101], + loc: { + start: { column: 23, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: true, + parameterName: Identifier { + type: "Identifier", + name: "x", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + typeAnnotation: null, + + range: [104, 113], + loc: { + start: { column: 31, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + + range: [102, 113], + loc: { + start: { column: 29, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + + range: [94, 130], + loc: { + start: { column: 21, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + + range: [79, 130], + loc: { + start: { column: 6, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + kind: "const", + + range: [73, 131], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 132], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..2896be461888 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-arrow-function Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "const", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "assertString", + + range: [79, 91], + loc: { + start: { column: 6, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [104, 111], + loc: { + start: { column: 31, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [114, 116], + loc: { + start: { column: 41, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [121, 127], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [127, 128], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [129, 130], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [130, 131], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..db812258aefc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-arrow-function AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..7fc5870adb9b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-arrow-function AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/fixture.ts new file mode 100644 index 000000000000..8fbc95646f22 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function assertsString(x: any): asserts x { + return; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..20567f67bba4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,119 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-function TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: null, + + range: [119, 126], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + ], + + range: [115, 128], + loc: { + start: { column: 42, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "assertsString", + + range: [82, 95], + loc: { + start: { column: 9, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [97, 102], + loc: { + start: { column: 24, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: true, + parameterName: Identifier { + type: "Identifier", + name: "x", + + range: [113, 114], + loc: { + start: { column: 40, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + typeAnnotation: null, + + range: [105, 114], + loc: { + start: { column: 32, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + + range: [103, 114], + loc: { + start: { column: 30, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + + range: [73, 128], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 129], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..359e8351cfcd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-function TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "assertsString", + + range: [82, 95], + loc: { + start: { column: 9, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [105, 112], + loc: { + start: { column: 32, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [113, 114], + loc: { + start: { column: 40, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [119, 125], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [125, 126], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [127, 128], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..7d4752c4b1df --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/3-Babel-AST.shot @@ -0,0 +1,119 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-function Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: null, + + range: [119, 126], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + ], + + range: [115, 128], + loc: { + start: { column: 42, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "assertsString", + + range: [82, 95], + loc: { + start: { column: 9, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [97, 102], + loc: { + start: { column: 24, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: true, + parameterName: Identifier { + type: "Identifier", + name: "x", + + range: [113, 114], + loc: { + start: { column: 40, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + typeAnnotation: null, + + range: [105, 114], + loc: { + start: { column: 32, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + + range: [103, 114], + loc: { + start: { column: 30, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + + range: [73, 128], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 129], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..85b85c43dfe6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-function Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "assertsString", + + range: [82, 95], + loc: { + start: { column: 9, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [99, 102], + loc: { + start: { column: 26, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [105, 112], + loc: { + start: { column: 32, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [113, 114], + loc: { + start: { column: 40, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [119, 125], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [125, 126], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [127, 128], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..ba5f295254cf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-function AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..2c2c2f0c3f22 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-function AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/fixture.ts new file mode 100644 index 000000000000..f601e8fb9acf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface AssertFoo { + isString(node: any): asserts node; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..e9eda1815c30 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,127 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-interface TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "isString", + + range: [97, 105], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + kind: "method", + params: Array [ + Identifier { + type: "Identifier", + name: "node", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [112, 115], + loc: { + start: { column: 17, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [110, 115], + loc: { + start: { column: 15, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [106, 115], + loc: { + start: { column: 11, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: true, + parameterName: Identifier { + type: "Identifier", + name: "node", + + range: [126, 130], + loc: { + start: { column: 31, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + typeAnnotation: null, + + range: [118, 130], + loc: { + start: { column: 23, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + + range: [116, 130], + loc: { + start: { column: 21, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + + range: [97, 131], + loc: { + start: { column: 2, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + ], + + range: [93, 133], + loc: { + start: { column: 20, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "AssertFoo", + + range: [83, 92], + loc: { + start: { column: 10, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [73, 133], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 134], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..a0c1771bf2f1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-interface TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "AssertFoo", + + range: [83, 92], + loc: { + start: { column: 10, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "isString", + + range: [97, 105], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [105, 106], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "node", + + range: [106, 110], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [110, 111], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [112, 115], + loc: { + start: { column: 17, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [115, 116], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [116, 117], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [118, 125], + loc: { + start: { column: 23, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "node", + + range: [126, 130], + loc: { + start: { column: 31, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [130, 131], + loc: { + start: { column: 35, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [132, 133], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..3ed9d7b015d2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/3-Babel-AST.shot @@ -0,0 +1,127 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-interface Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "isString", + + range: [97, 105], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + kind: "method", + parameters: Array [ + Identifier { + type: "Identifier", + name: "node", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [112, 115], + loc: { + start: { column: 17, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [110, 115], + loc: { + start: { column: 15, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [106, 115], + loc: { + start: { column: 11, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: true, + parameterName: Identifier { + type: "Identifier", + name: "node", + + range: [126, 130], + loc: { + start: { column: 31, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + typeAnnotation: null, + + range: [118, 130], + loc: { + start: { column: 23, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + + range: [116, 130], + loc: { + start: { column: 21, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + + range: [97, 131], + loc: { + start: { column: 2, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + ], + + range: [93, 133], + loc: { + start: { column: 20, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "AssertFoo", + + range: [83, 92], + loc: { + start: { column: 10, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [73, 133], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 134], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..bf2cbb76afe6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-interface Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "AssertFoo", + + range: [83, 92], + loc: { + start: { column: 10, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "isString", + + range: [97, 105], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [105, 106], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "node", + + range: [106, 110], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [110, 111], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [112, 115], + loc: { + start: { column: 17, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [115, 116], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [116, 117], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [118, 125], + loc: { + start: { column: 23, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "node", + + range: [126, 130], + loc: { + start: { column: 31, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [130, 131], + loc: { + start: { column: 35, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [132, 133], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..3b65ab51b591 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,133 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-interface AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [ + TSMethodSignature { + type: 'TSMethodSignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'isString', + + range: [97, 105], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + kind: 'method', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'node', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSAnyKeyword { + type: 'TSAnyKeyword', + + range: [112, 115], + loc: { + start: { column: 17, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [110, 115], + loc: { + start: { column: 15, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [106, 115], + loc: { + start: { column: 11, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypePredicate { + type: 'TSTypePredicate', + asserts: true, + parameterName: Identifier { + type: 'Identifier', + name: 'node', + + range: [126, 130], + loc: { + start: { column: 31, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + typeAnnotation: null, + + range: [118, 130], + loc: { + start: { column: 23, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + + range: [116, 130], + loc: { + start: { column: 21, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + + range: [97, 131], + loc: { + start: { column: 2, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + ], + + range: [93, 133], + loc: { + start: { column: 20, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'AssertFoo', + + range: [83, 92], + loc: { + start: { column: 10, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [73, 133], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 134], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..c6c1195f0307 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,152 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-interface AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'AssertFoo', + + range: [83, 92], + loc: { + start: { column: 10, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'isString', + + range: [97, 105], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [105, 106], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'node', + + range: [106, 110], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [110, 111], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'any', + + range: [112, 115], + loc: { + start: { column: 17, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [115, 116], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [116, 117], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'asserts', + + range: [118, 125], + loc: { + start: { column: 23, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'node', + + range: [126, 130], + loc: { + start: { column: 31, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [130, 131], + loc: { + start: { column: 35, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [132, 133], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/fixture.ts new file mode 100644 index 000000000000..347e18aa68b2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/fixture.ts @@ -0,0 +1,10 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class AssertsFoo { + isBar(): asserts this { + return; + } + isBaz = (): asserts this => { + return; + }; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..1e3f0fff5285 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,221 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-method TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "isBar", + + range: [94, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: null, + + range: [122, 129], + loc: { + start: { column: 4, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + ], + + range: [116, 133], + loc: { + start: { column: 24, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: true, + parameterName: TSThisType { + type: "TSThisType", + + range: [111, 115], + loc: { + start: { column: 19, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + typeAnnotation: null, + + range: [103, 115], + loc: { + start: { column: 11, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [101, 115], + loc: { + start: { column: 9, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [99, 133], + loc: { + start: { column: 7, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [94, 133], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "isBaz", + + range: [136, 141], + loc: { + start: { column: 2, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + override: false, + static: false, + value: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: null, + + range: [170, 177], + loc: { + start: { column: 4, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + ], + + range: [164, 181], + loc: { + start: { column: 30, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: true, + parameterName: TSThisType { + type: "TSThisType", + + range: [156, 160], + loc: { + start: { column: 22, line: 7 }, + end: { column: 26, line: 7 }, + }, + }, + typeAnnotation: null, + + range: [148, 160], + loc: { + start: { column: 14, line: 7 }, + end: { column: 26, line: 7 }, + }, + }, + + range: [146, 160], + loc: { + start: { column: 12, line: 7 }, + end: { column: 26, line: 7 }, + }, + }, + + range: [144, 181], + loc: { + start: { column: 10, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + + range: [136, 182], + loc: { + start: { column: 2, line: 7 }, + end: { column: 4, line: 9 }, + }, + }, + ], + + range: [90, 184], + loc: { + start: { column: 17, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "AssertsFoo", + + range: [79, 89], + loc: { + start: { column: 6, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + superClass: null, + + range: [73, 184], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 185], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..fe9877a88dba --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,276 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-method TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "AssertsFoo", + + range: [79, 89], + loc: { + start: { column: 6, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "isBar", + + range: [94, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [99, 100], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [100, 101], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [101, 102], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [103, 110], + loc: { + start: { column: 11, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [111, 115], + loc: { + start: { column: 19, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [116, 117], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [122, 128], + loc: { + start: { column: 4, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [128, 129], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [132, 133], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "isBaz", + + range: [136, 141], + loc: { + start: { column: 2, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [142, 143], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [144, 145], + loc: { + start: { column: 10, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [145, 146], + loc: { + start: { column: 11, line: 7 }, + end: { column: 12, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [146, 147], + loc: { + start: { column: 12, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [148, 155], + loc: { + start: { column: 14, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [156, 160], + loc: { + start: { column: 22, line: 7 }, + end: { column: 26, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [161, 163], + loc: { + start: { column: 27, line: 7 }, + end: { column: 29, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [164, 165], + loc: { + start: { column: 30, line: 7 }, + end: { column: 31, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [170, 176], + loc: { + start: { column: 4, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [176, 177], + loc: { + start: { column: 10, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [180, 181], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [181, 182], + loc: { + start: { column: 3, line: 9 }, + end: { column: 4, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [183, 184], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..41f1d16a8d4c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/3-Babel-AST.shot @@ -0,0 +1,218 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-method Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "isBar", + + range: [94, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: null, + + range: [122, 129], + loc: { + start: { column: 4, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + ], + + range: [116, 133], + loc: { + start: { column: 24, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: true, + parameterName: TSThisType { + type: "TSThisType", + + range: [111, 115], + loc: { + start: { column: 19, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + typeAnnotation: null, + + range: [103, 115], + loc: { + start: { column: 11, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [101, 115], + loc: { + start: { column: 9, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [99, 133], + loc: { + start: { column: 7, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [94, 133], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "isBaz", + + range: [136, 141], + loc: { + start: { column: 2, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + static: false, + value: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: null, + + range: [170, 177], + loc: { + start: { column: 4, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + ], + + range: [164, 181], + loc: { + start: { column: 30, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: true, + parameterName: TSThisType { + type: "TSThisType", + + range: [156, 160], + loc: { + start: { column: 22, line: 7 }, + end: { column: 26, line: 7 }, + }, + }, + typeAnnotation: null, + + range: [148, 160], + loc: { + start: { column: 14, line: 7 }, + end: { column: 26, line: 7 }, + }, + }, + + range: [146, 160], + loc: { + start: { column: 12, line: 7 }, + end: { column: 26, line: 7 }, + }, + }, + + range: [144, 181], + loc: { + start: { column: 10, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + + range: [136, 182], + loc: { + start: { column: 2, line: 7 }, + end: { column: 4, line: 9 }, + }, + }, + ], + + range: [90, 184], + loc: { + start: { column: 17, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "AssertsFoo", + + range: [79, 89], + loc: { + start: { column: 6, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + superClass: null, + + range: [73, 184], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 185], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..dd17465477c6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,276 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-method Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "AssertsFoo", + + range: [79, 89], + loc: { + start: { column: 6, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "isBar", + + range: [94, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [99, 100], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [100, 101], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [101, 102], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [103, 110], + loc: { + start: { column: 11, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [111, 115], + loc: { + start: { column: 19, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [116, 117], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [122, 128], + loc: { + start: { column: 4, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [128, 129], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [132, 133], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "isBaz", + + range: [136, 141], + loc: { + start: { column: 2, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [142, 143], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [144, 145], + loc: { + start: { column: 10, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [145, 146], + loc: { + start: { column: 11, line: 7 }, + end: { column: 12, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [146, 147], + loc: { + start: { column: 12, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [148, 155], + loc: { + start: { column: 14, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [156, 160], + loc: { + start: { column: 22, line: 7 }, + end: { column: 26, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [161, 163], + loc: { + start: { column: 27, line: 7 }, + end: { column: 29, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [164, 165], + loc: { + start: { column: 30, line: 7 }, + end: { column: 31, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [170, 176], + loc: { + start: { column: 4, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [176, 177], + loc: { + start: { column: 10, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [180, 181], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [181, 182], + loc: { + start: { column: 3, line: 9 }, + end: { column: 4, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [183, 184], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..198bf8d2a0ae --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,225 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-method AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'isBar', + + range: [94, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: null, + + range: [122, 129], + loc: { + start: { column: 4, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + ], + + range: [116, 133], + loc: { + start: { column: 24, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypePredicate { + type: 'TSTypePredicate', + asserts: true, + parameterName: TSThisType { + type: 'TSThisType', + + range: [111, 115], + loc: { + start: { column: 19, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + typeAnnotation: null, + + range: [103, 115], + loc: { + start: { column: 11, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [101, 115], + loc: { + start: { column: 9, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [99, 133], + loc: { + start: { column: 7, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [94, 133], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'isBaz', + + range: [136, 141], + loc: { + start: { column: 2, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, +- override: false, + static: false, + value: ArrowFunctionExpression { + type: 'ArrowFunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: null, + + range: [170, 177], + loc: { + start: { column: 4, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + ], + + range: [164, 181], + loc: { + start: { column: 30, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypePredicate { + type: 'TSTypePredicate', + asserts: true, + parameterName: TSThisType { + type: 'TSThisType', + + range: [156, 160], + loc: { + start: { column: 22, line: 7 }, + end: { column: 26, line: 7 }, + }, + }, + typeAnnotation: null, + + range: [148, 160], + loc: { + start: { column: 14, line: 7 }, + end: { column: 26, line: 7 }, + }, + }, + + range: [146, 160], + loc: { + start: { column: 12, line: 7 }, + end: { column: 26, line: 7 }, + }, + }, + + range: [144, 181], + loc: { + start: { column: 10, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + + range: [136, 182], + loc: { + start: { column: 2, line: 7 }, + end: { column: 4, line: 9 }, + }, + }, + ], + + range: [90, 184], + loc: { + start: { column: 17, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'AssertsFoo', + + range: [79, 89], + loc: { + start: { column: 6, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + superClass: null, + + range: [73, 184], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 185], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..aa14fa6302a9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-in-method AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/fixture.ts new file mode 100644 index 000000000000..bf01a75ae5f6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +const assertString = (x: any): asserts x is string => { + return; +}; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..75bb5e4c3ed5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,158 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-arrow-function TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "assertString", + + range: [79, 91], + loc: { + start: { column: 6, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + init: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: null, + + range: [131, 138], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + ], + + range: [127, 140], + loc: { + start: { column: 54, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [96, 101], + loc: { + start: { column: 23, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: true, + parameterName: Identifier { + type: "Identifier", + name: "x", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [117, 123], + loc: { + start: { column: 44, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + + range: [117, 123], + loc: { + start: { column: 44, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + + range: [104, 123], + loc: { + start: { column: 31, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + + range: [102, 123], + loc: { + start: { column: 29, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + + range: [94, 140], + loc: { + start: { column: 21, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + + range: [79, 140], + loc: { + start: { column: 6, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + kind: "const", + + range: [73, 141], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 142], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..54536cb2f091 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,196 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-arrow-function TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "const", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "assertString", + + range: [79, 91], + loc: { + start: { column: 6, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [104, 111], + loc: { + start: { column: 31, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [114, 116], + loc: { + start: { column: 41, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [117, 123], + loc: { + start: { column: 44, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [124, 126], + loc: { + start: { column: 51, line: 3 }, + end: { column: 53, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [127, 128], + loc: { + start: { column: 54, line: 3 }, + end: { column: 55, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [131, 137], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [137, 138], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [139, 140], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [140, 141], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..65772b3dcdc9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/3-Babel-AST.shot @@ -0,0 +1,158 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-arrow-function Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "assertString", + + range: [79, 91], + loc: { + start: { column: 6, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + init: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: null, + + range: [131, 138], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + ], + + range: [127, 140], + loc: { + start: { column: 54, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [96, 101], + loc: { + start: { column: 23, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: true, + parameterName: Identifier { + type: "Identifier", + name: "x", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [117, 123], + loc: { + start: { column: 44, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + + range: [117, 123], + loc: { + start: { column: 44, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + + range: [104, 123], + loc: { + start: { column: 31, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + + range: [102, 123], + loc: { + start: { column: 29, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + + range: [94, 140], + loc: { + start: { column: 21, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + + range: [79, 140], + loc: { + start: { column: 6, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + kind: "const", + + range: [73, 141], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 142], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..7795a2d7043f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,196 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-arrow-function Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "const", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "assertString", + + range: [79, 91], + loc: { + start: { column: 6, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [104, 111], + loc: { + start: { column: 31, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [114, 116], + loc: { + start: { column: 41, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [117, 123], + loc: { + start: { column: 44, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [124, 126], + loc: { + start: { column: 51, line: 3 }, + end: { column: 53, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [127, 128], + loc: { + start: { column: 54, line: 3 }, + end: { column: 55, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [131, 137], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [137, 138], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [139, 140], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [140, 141], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..c32f552cc736 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-arrow-function AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..4b36bf9ce563 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-arrow-function AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/fixture.ts new file mode 100644 index 000000000000..991c97d77e95 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function assertsStringGuard(x: any): asserts x is string { + return; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..8bbe9504a338 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-function TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: null, + + range: [134, 141], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + ], + + range: [130, 143], + loc: { + start: { column: 57, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "assertsStringGuard", + + range: [82, 100], + loc: { + start: { column: 9, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [102, 107], + loc: { + start: { column: 29, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [101, 107], + loc: { + start: { column: 28, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: true, + parameterName: Identifier { + type: "Identifier", + name: "x", + + range: [118, 119], + loc: { + start: { column: 45, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [123, 129], + loc: { + start: { column: 50, line: 3 }, + end: { column: 56, line: 3 }, + }, + }, + + range: [123, 129], + loc: { + start: { column: 50, line: 3 }, + end: { column: 56, line: 3 }, + }, + }, + + range: [110, 129], + loc: { + start: { column: 37, line: 3 }, + end: { column: 56, line: 3 }, + }, + }, + + range: [108, 129], + loc: { + start: { column: 35, line: 3 }, + end: { column: 56, line: 3 }, + }, + }, + + range: [73, 143], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 144], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..c51686cd7398 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-function TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "assertsStringGuard", + + range: [82, 100], + loc: { + start: { column: 9, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [110, 117], + loc: { + start: { column: 37, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [118, 119], + loc: { + start: { column: 45, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [120, 122], + loc: { + start: { column: 47, line: 3 }, + end: { column: 49, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [123, 129], + loc: { + start: { column: 50, line: 3 }, + end: { column: 56, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [130, 131], + loc: { + start: { column: 57, line: 3 }, + end: { column: 58, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [134, 140], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [140, 141], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [142, 143], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..649fdaa53020 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/3-Babel-AST.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-function Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: null, + + range: [134, 141], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + ], + + range: [130, 143], + loc: { + start: { column: 57, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "assertsStringGuard", + + range: [82, 100], + loc: { + start: { column: 9, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [102, 107], + loc: { + start: { column: 29, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [101, 107], + loc: { + start: { column: 28, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: true, + parameterName: Identifier { + type: "Identifier", + name: "x", + + range: [118, 119], + loc: { + start: { column: 45, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [123, 129], + loc: { + start: { column: 50, line: 3 }, + end: { column: 56, line: 3 }, + }, + }, + + range: [123, 129], + loc: { + start: { column: 50, line: 3 }, + end: { column: 56, line: 3 }, + }, + }, + + range: [110, 129], + loc: { + start: { column: 37, line: 3 }, + end: { column: 56, line: 3 }, + }, + }, + + range: [108, 129], + loc: { + start: { column: 35, line: 3 }, + end: { column: 56, line: 3 }, + }, + }, + + range: [73, 143], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 144], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..eff997f48bf8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-function Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "assertsStringGuard", + + range: [82, 100], + loc: { + start: { column: 9, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [104, 107], + loc: { + start: { column: 31, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [110, 117], + loc: { + start: { column: 37, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [118, 119], + loc: { + start: { column: 45, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [120, 122], + loc: { + start: { column: 47, line: 3 }, + end: { column: 49, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [123, 129], + loc: { + start: { column: 50, line: 3 }, + end: { column: 56, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [130, 131], + loc: { + start: { column: 57, line: 3 }, + end: { column: 58, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [134, 140], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [140, 141], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [142, 143], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..f26ffee877f4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-function AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..4b6b17ce1a2d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-function AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/fixture.ts new file mode 100644 index 000000000000..230d26236cbc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface AssertFoo { + isString(node: any): asserts node is string; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..091fa336e78c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,144 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-interface TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "isString", + + range: [97, 105], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + kind: "method", + params: Array [ + Identifier { + type: "Identifier", + name: "node", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [112, 115], + loc: { + start: { column: 17, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [110, 115], + loc: { + start: { column: 15, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [106, 115], + loc: { + start: { column: 11, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: true, + parameterName: Identifier { + type: "Identifier", + name: "node", + + range: [126, 130], + loc: { + start: { column: 31, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [134, 140], + loc: { + start: { column: 39, line: 4 }, + end: { column: 45, line: 4 }, + }, + }, + + range: [134, 140], + loc: { + start: { column: 39, line: 4 }, + end: { column: 45, line: 4 }, + }, + }, + + range: [118, 140], + loc: { + start: { column: 23, line: 4 }, + end: { column: 45, line: 4 }, + }, + }, + + range: [116, 140], + loc: { + start: { column: 21, line: 4 }, + end: { column: 45, line: 4 }, + }, + }, + + range: [97, 141], + loc: { + start: { column: 2, line: 4 }, + end: { column: 46, line: 4 }, + }, + }, + ], + + range: [93, 143], + loc: { + start: { column: 20, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "AssertFoo", + + range: [83, 92], + loc: { + start: { column: 10, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [73, 143], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 144], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..d867088a0b4e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-interface TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "AssertFoo", + + range: [83, 92], + loc: { + start: { column: 10, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "isString", + + range: [97, 105], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [105, 106], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "node", + + range: [106, 110], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [110, 111], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [112, 115], + loc: { + start: { column: 17, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [115, 116], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [116, 117], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [118, 125], + loc: { + start: { column: 23, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "node", + + range: [126, 130], + loc: { + start: { column: 31, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [131, 133], + loc: { + start: { column: 36, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [134, 140], + loc: { + start: { column: 39, line: 4 }, + end: { column: 45, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [140, 141], + loc: { + start: { column: 45, line: 4 }, + end: { column: 46, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [142, 143], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..21b04022e101 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/3-Babel-AST.shot @@ -0,0 +1,144 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-interface Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "isString", + + range: [97, 105], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + kind: "method", + parameters: Array [ + Identifier { + type: "Identifier", + name: "node", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [112, 115], + loc: { + start: { column: 17, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [110, 115], + loc: { + start: { column: 15, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [106, 115], + loc: { + start: { column: 11, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: true, + parameterName: Identifier { + type: "Identifier", + name: "node", + + range: [126, 130], + loc: { + start: { column: 31, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [134, 140], + loc: { + start: { column: 39, line: 4 }, + end: { column: 45, line: 4 }, + }, + }, + + range: [134, 140], + loc: { + start: { column: 39, line: 4 }, + end: { column: 45, line: 4 }, + }, + }, + + range: [118, 140], + loc: { + start: { column: 23, line: 4 }, + end: { column: 45, line: 4 }, + }, + }, + + range: [116, 140], + loc: { + start: { column: 21, line: 4 }, + end: { column: 45, line: 4 }, + }, + }, + + range: [97, 141], + loc: { + start: { column: 2, line: 4 }, + end: { column: 46, line: 4 }, + }, + }, + ], + + range: [93, 143], + loc: { + start: { column: 20, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "AssertFoo", + + range: [83, 92], + loc: { + start: { column: 10, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [73, 143], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 144], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..3fe9263a2a2f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-interface Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "AssertFoo", + + range: [83, 92], + loc: { + start: { column: 10, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "isString", + + range: [97, 105], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [105, 106], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "node", + + range: [106, 110], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [110, 111], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [112, 115], + loc: { + start: { column: 17, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [115, 116], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [116, 117], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [118, 125], + loc: { + start: { column: 23, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "node", + + range: [126, 130], + loc: { + start: { column: 31, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [131, 133], + loc: { + start: { column: 36, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [134, 140], + loc: { + start: { column: 39, line: 4 }, + end: { column: 45, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [140, 141], + loc: { + start: { column: 45, line: 4 }, + end: { column: 46, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [142, 143], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..c5d8b48f1753 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,150 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-interface AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [ + TSMethodSignature { + type: 'TSMethodSignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'isString', + + range: [97, 105], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + kind: 'method', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'node', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSAnyKeyword { + type: 'TSAnyKeyword', + + range: [112, 115], + loc: { + start: { column: 17, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [110, 115], + loc: { + start: { column: 15, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [106, 115], + loc: { + start: { column: 11, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypePredicate { + type: 'TSTypePredicate', + asserts: true, + parameterName: Identifier { + type: 'Identifier', + name: 'node', + + range: [126, 130], + loc: { + start: { column: 31, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [134, 140], + loc: { + start: { column: 39, line: 4 }, + end: { column: 45, line: 4 }, + }, + }, + + range: [134, 140], + loc: { + start: { column: 39, line: 4 }, + end: { column: 45, line: 4 }, + }, + }, + + range: [118, 140], + loc: { + start: { column: 23, line: 4 }, + end: { column: 45, line: 4 }, + }, + }, + + range: [116, 140], + loc: { + start: { column: 21, line: 4 }, + end: { column: 45, line: 4 }, + }, + }, + + range: [97, 141], + loc: { + start: { column: 2, line: 4 }, + end: { column: 46, line: 4 }, + }, + }, + ], + + range: [93, 143], + loc: { + start: { column: 20, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'AssertFoo', + + range: [83, 92], + loc: { + start: { column: 10, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [73, 143], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 144], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..a045cdaa387f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,172 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-interface AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'AssertFoo', + + range: [83, 92], + loc: { + start: { column: 10, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'isString', + + range: [97, 105], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [105, 106], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'node', + + range: [106, 110], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [110, 111], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'any', + + range: [112, 115], + loc: { + start: { column: 17, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [115, 116], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [116, 117], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'asserts', + + range: [118, 125], + loc: { + start: { column: 23, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'node', + + range: [126, 130], + loc: { + start: { column: 31, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'is', + + range: [131, 133], + loc: { + start: { column: 36, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [134, 140], + loc: { + start: { column: 39, line: 4 }, + end: { column: 45, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [140, 141], + loc: { + start: { column: 45, line: 4 }, + end: { column: 46, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [142, 143], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/fixture.ts new file mode 100644 index 000000000000..da55dbd638d5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/fixture.ts @@ -0,0 +1,10 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class AssertsFoo { + isBar(): asserts this is string { + return; + } + isBaz = (): asserts this is string => { + return; + }; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..a3c5693ed3dc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,255 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-method TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "isBar", + + range: [94, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: null, + + range: [132, 139], + loc: { + start: { column: 4, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + ], + + range: [126, 143], + loc: { + start: { column: 34, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: true, + parameterName: TSThisType { + type: "TSThisType", + + range: [111, 115], + loc: { + start: { column: 19, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [119, 125], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [119, 125], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [103, 125], + loc: { + start: { column: 11, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [101, 125], + loc: { + start: { column: 9, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [99, 143], + loc: { + start: { column: 7, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [94, 143], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "isBaz", + + range: [146, 151], + loc: { + start: { column: 2, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + override: false, + static: false, + value: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: null, + + range: [190, 197], + loc: { + start: { column: 4, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + ], + + range: [184, 201], + loc: { + start: { column: 40, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: true, + parameterName: TSThisType { + type: "TSThisType", + + range: [166, 170], + loc: { + start: { column: 22, line: 7 }, + end: { column: 26, line: 7 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [174, 180], + loc: { + start: { column: 30, line: 7 }, + end: { column: 36, line: 7 }, + }, + }, + + range: [174, 180], + loc: { + start: { column: 30, line: 7 }, + end: { column: 36, line: 7 }, + }, + }, + + range: [158, 180], + loc: { + start: { column: 14, line: 7 }, + end: { column: 36, line: 7 }, + }, + }, + + range: [156, 180], + loc: { + start: { column: 12, line: 7 }, + end: { column: 36, line: 7 }, + }, + }, + + range: [154, 201], + loc: { + start: { column: 10, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + + range: [146, 202], + loc: { + start: { column: 2, line: 7 }, + end: { column: 4, line: 9 }, + }, + }, + ], + + range: [90, 204], + loc: { + start: { column: 17, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "AssertsFoo", + + range: [79, 89], + loc: { + start: { column: 6, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + superClass: null, + + range: [73, 204], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 205], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..675fbc54f5b2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,316 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-method TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "AssertsFoo", + + range: [79, 89], + loc: { + start: { column: 6, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "isBar", + + range: [94, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [99, 100], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [100, 101], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [101, 102], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [103, 110], + loc: { + start: { column: 11, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [111, 115], + loc: { + start: { column: 19, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [116, 118], + loc: { + start: { column: 24, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [119, 125], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [126, 127], + loc: { + start: { column: 34, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [132, 138], + loc: { + start: { column: 4, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [138, 139], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [142, 143], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "isBaz", + + range: [146, 151], + loc: { + start: { column: 2, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [152, 153], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [154, 155], + loc: { + start: { column: 10, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [155, 156], + loc: { + start: { column: 11, line: 7 }, + end: { column: 12, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [156, 157], + loc: { + start: { column: 12, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [158, 165], + loc: { + start: { column: 14, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [166, 170], + loc: { + start: { column: 22, line: 7 }, + end: { column: 26, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [171, 173], + loc: { + start: { column: 27, line: 7 }, + end: { column: 29, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [174, 180], + loc: { + start: { column: 30, line: 7 }, + end: { column: 36, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [181, 183], + loc: { + start: { column: 37, line: 7 }, + end: { column: 39, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [184, 185], + loc: { + start: { column: 40, line: 7 }, + end: { column: 41, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [190, 196], + loc: { + start: { column: 4, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [196, 197], + loc: { + start: { column: 10, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [200, 201], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [201, 202], + loc: { + start: { column: 3, line: 9 }, + end: { column: 4, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [203, 204], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..69dac50a8b95 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/3-Babel-AST.shot @@ -0,0 +1,252 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-method Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "isBar", + + range: [94, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: null, + + range: [132, 139], + loc: { + start: { column: 4, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + ], + + range: [126, 143], + loc: { + start: { column: 34, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: true, + parameterName: TSThisType { + type: "TSThisType", + + range: [111, 115], + loc: { + start: { column: 19, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [119, 125], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [119, 125], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [103, 125], + loc: { + start: { column: 11, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [101, 125], + loc: { + start: { column: 9, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [99, 143], + loc: { + start: { column: 7, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [94, 143], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "isBaz", + + range: [146, 151], + loc: { + start: { column: 2, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + static: false, + value: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: null, + + range: [190, 197], + loc: { + start: { column: 4, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + ], + + range: [184, 201], + loc: { + start: { column: 40, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: true, + parameterName: TSThisType { + type: "TSThisType", + + range: [166, 170], + loc: { + start: { column: 22, line: 7 }, + end: { column: 26, line: 7 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [174, 180], + loc: { + start: { column: 30, line: 7 }, + end: { column: 36, line: 7 }, + }, + }, + + range: [174, 180], + loc: { + start: { column: 30, line: 7 }, + end: { column: 36, line: 7 }, + }, + }, + + range: [158, 180], + loc: { + start: { column: 14, line: 7 }, + end: { column: 36, line: 7 }, + }, + }, + + range: [156, 180], + loc: { + start: { column: 12, line: 7 }, + end: { column: 36, line: 7 }, + }, + }, + + range: [154, 201], + loc: { + start: { column: 10, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + + range: [146, 202], + loc: { + start: { column: 2, line: 7 }, + end: { column: 4, line: 9 }, + }, + }, + ], + + range: [90, 204], + loc: { + start: { column: 17, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "AssertsFoo", + + range: [79, 89], + loc: { + start: { column: 6, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + superClass: null, + + range: [73, 204], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 205], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..683358c39af4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,316 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-method Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "AssertsFoo", + + range: [79, 89], + loc: { + start: { column: 6, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "isBar", + + range: [94, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [99, 100], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [100, 101], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [101, 102], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [103, 110], + loc: { + start: { column: 11, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [111, 115], + loc: { + start: { column: 19, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [116, 118], + loc: { + start: { column: 24, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [119, 125], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [126, 127], + loc: { + start: { column: 34, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [132, 138], + loc: { + start: { column: 4, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [138, 139], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [142, 143], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "isBaz", + + range: [146, 151], + loc: { + start: { column: 2, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [152, 153], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [154, 155], + loc: { + start: { column: 10, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [155, 156], + loc: { + start: { column: 11, line: 7 }, + end: { column: 12, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [156, 157], + loc: { + start: { column: 12, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "asserts", + + range: [158, 165], + loc: { + start: { column: 14, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [166, 170], + loc: { + start: { column: 22, line: 7 }, + end: { column: 26, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [171, 173], + loc: { + start: { column: 27, line: 7 }, + end: { column: 29, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [174, 180], + loc: { + start: { column: 30, line: 7 }, + end: { column: 36, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [181, 183], + loc: { + start: { column: 37, line: 7 }, + end: { column: 39, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [184, 185], + loc: { + start: { column: 40, line: 7 }, + end: { column: 41, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [190, 196], + loc: { + start: { column: 4, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [196, 197], + loc: { + start: { column: 10, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [200, 201], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [201, 202], + loc: { + start: { column: 3, line: 9 }, + end: { column: 4, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [203, 204], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..0477b699d6bf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,259 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-method AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'isBar', + + range: [94, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: null, + + range: [132, 139], + loc: { + start: { column: 4, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + ], + + range: [126, 143], + loc: { + start: { column: 34, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypePredicate { + type: 'TSTypePredicate', + asserts: true, + parameterName: TSThisType { + type: 'TSThisType', + + range: [111, 115], + loc: { + start: { column: 19, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [119, 125], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [119, 125], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [103, 125], + loc: { + start: { column: 11, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [101, 125], + loc: { + start: { column: 9, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [99, 143], + loc: { + start: { column: 7, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [94, 143], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'isBaz', + + range: [146, 151], + loc: { + start: { column: 2, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, +- override: false, + static: false, + value: ArrowFunctionExpression { + type: 'ArrowFunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: null, + + range: [190, 197], + loc: { + start: { column: 4, line: 8 }, + end: { column: 11, line: 8 }, + }, + }, + ], + + range: [184, 201], + loc: { + start: { column: 40, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypePredicate { + type: 'TSTypePredicate', + asserts: true, + parameterName: TSThisType { + type: 'TSThisType', + + range: [166, 170], + loc: { + start: { column: 22, line: 7 }, + end: { column: 26, line: 7 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [174, 180], + loc: { + start: { column: 30, line: 7 }, + end: { column: 36, line: 7 }, + }, + }, + + range: [174, 180], + loc: { + start: { column: 30, line: 7 }, + end: { column: 36, line: 7 }, + }, + }, + + range: [158, 180], + loc: { + start: { column: 14, line: 7 }, + end: { column: 36, line: 7 }, + }, + }, + + range: [156, 180], + loc: { + start: { column: 12, line: 7 }, + end: { column: 36, line: 7 }, + }, + }, + + range: [154, 201], + loc: { + start: { column: 10, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + + range: [146, 202], + loc: { + start: { column: 2, line: 7 }, + end: { column: 4, line: 9 }, + }, + }, + ], + + range: [90, 204], + loc: { + start: { column: 17, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'AssertsFoo', + + range: [79, 89], + loc: { + start: { column: 6, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + superClass: null, + + range: [73, 204], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 205], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..5be5d05cd613 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-method AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/fixture.ts new file mode 100644 index 000000000000..3a956bb47f25 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +const isString = (x: any): x is string => { + return typeof x === 'string'; +}; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..76dcf3de2d25 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,199 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-arrow-function TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "isString", + + range: [79, 87], + loc: { + start: { column: 6, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + init: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: BinaryExpression { + type: "BinaryExpression", + left: UnaryExpression { + type: "UnaryExpression", + argument: Identifier { + type: "Identifier", + name: "x", + + range: [133, 134], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + operator: "typeof", + prefix: true, + + range: [126, 134], + loc: { + start: { column: 9, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + operator: "===", + right: Literal { + type: "Literal", + raw: "'string'", + value: "string", + + range: [139, 147], + loc: { + start: { column: 22, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + + range: [126, 147], + loc: { + start: { column: 9, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + + range: [119, 148], + loc: { + start: { column: 2, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + ], + + range: [115, 150], + loc: { + start: { column: 42, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [92, 97], + loc: { + start: { column: 19, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [91, 97], + loc: { + start: { column: 18, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: false, + parameterName: Identifier { + type: "Identifier", + name: "x", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [100, 111], + loc: { + start: { column: 27, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [98, 111], + loc: { + start: { column: 25, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [90, 150], + loc: { + start: { column: 17, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + + range: [79, 150], + loc: { + start: { column: 6, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + kind: "const", + + range: [73, 151], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 152], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..87f244b8ef10 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,226 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-arrow-function TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "const", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "isString", + + range: [79, 87], + loc: { + start: { column: 6, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [102, 104], + loc: { + start: { column: 29, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [112, 114], + loc: { + start: { column: 39, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [119, 125], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "typeof", + + range: [126, 132], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [133, 134], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "===", + + range: [135, 138], + loc: { + start: { column: 18, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + String { + type: "String", + value: "'string'", + + range: [139, 147], + loc: { + start: { column: 22, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [147, 148], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [149, 150], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [150, 151], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..1326840b778a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/3-Babel-AST.shot @@ -0,0 +1,199 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-arrow-function Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "isString", + + range: [79, 87], + loc: { + start: { column: 6, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + init: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: BinaryExpression { + type: "BinaryExpression", + left: UnaryExpression { + type: "UnaryExpression", + argument: Identifier { + type: "Identifier", + name: "x", + + range: [133, 134], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + operator: "typeof", + prefix: true, + + range: [126, 134], + loc: { + start: { column: 9, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + operator: "===", + right: Literal { + type: "Literal", + raw: "'string'", + value: "string", + + range: [139, 147], + loc: { + start: { column: 22, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + + range: [126, 147], + loc: { + start: { column: 9, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + + range: [119, 148], + loc: { + start: { column: 2, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + ], + + range: [115, 150], + loc: { + start: { column: 42, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [92, 97], + loc: { + start: { column: 19, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [91, 97], + loc: { + start: { column: 18, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: false, + parameterName: Identifier { + type: "Identifier", + name: "x", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [100, 111], + loc: { + start: { column: 27, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [98, 111], + loc: { + start: { column: 25, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [90, 150], + loc: { + start: { column: 17, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + + range: [79, 150], + loc: { + start: { column: 6, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + kind: "const", + + range: [73, 151], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 152], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..78e9c0a89723 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,226 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-arrow-function Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "const", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "isString", + + range: [79, 87], + loc: { + start: { column: 6, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [102, 104], + loc: { + start: { column: 29, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [112, 114], + loc: { + start: { column: 39, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [119, 125], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "typeof", + + range: [126, 132], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [133, 134], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "===", + + range: [135, 138], + loc: { + start: { column: 18, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + String { + type: "String", + value: "'string'", + + range: [139, 147], + loc: { + start: { column: 22, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [147, 148], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [149, 150], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [150, 151], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..d53c65828a29 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-arrow-function AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..6507a25838aa --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-arrow-function AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/fixture.ts new file mode 100644 index 000000000000..5b0a41fb2a8d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function isString(x: any): x is string { + return typeof x === 'string'; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..2bea2721280b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,177 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-function TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: BinaryExpression { + type: "BinaryExpression", + left: UnaryExpression { + type: "UnaryExpression", + argument: Identifier { + type: "Identifier", + name: "x", + + range: [130, 131], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + operator: "typeof", + prefix: true, + + range: [123, 131], + loc: { + start: { column: 9, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + operator: "===", + right: Literal { + type: "Literal", + raw: "'string'", + value: "string", + + range: [136, 144], + loc: { + start: { column: 22, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + + range: [123, 144], + loc: { + start: { column: 9, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + + range: [116, 145], + loc: { + start: { column: 2, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + ], + + range: [112, 147], + loc: { + start: { column: 39, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "isString", + + range: [82, 90], + loc: { + start: { column: 9, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [92, 97], + loc: { + start: { column: 19, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [91, 97], + loc: { + start: { column: 18, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: false, + parameterName: Identifier { + type: "Identifier", + name: "x", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [100, 111], + loc: { + start: { column: 27, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [98, 111], + loc: { + start: { column: 25, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [73, 147], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 148], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..acda059bc114 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,196 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-function TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "isString", + + range: [82, 90], + loc: { + start: { column: 9, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [102, 104], + loc: { + start: { column: 29, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [116, 122], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "typeof", + + range: [123, 129], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [130, 131], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "===", + + range: [132, 135], + loc: { + start: { column: 18, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + String { + type: "String", + value: "'string'", + + range: [136, 144], + loc: { + start: { column: 22, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [144, 145], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [146, 147], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..8a6b2898251d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/3-Babel-AST.shot @@ -0,0 +1,177 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-function Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: BinaryExpression { + type: "BinaryExpression", + left: UnaryExpression { + type: "UnaryExpression", + argument: Identifier { + type: "Identifier", + name: "x", + + range: [130, 131], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + operator: "typeof", + prefix: true, + + range: [123, 131], + loc: { + start: { column: 9, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + operator: "===", + right: Literal { + type: "Literal", + raw: "'string'", + value: "string", + + range: [136, 144], + loc: { + start: { column: 22, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + + range: [123, 144], + loc: { + start: { column: 9, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + + range: [116, 145], + loc: { + start: { column: 2, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + ], + + range: [112, 147], + loc: { + start: { column: 39, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "isString", + + range: [82, 90], + loc: { + start: { column: 9, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [92, 97], + loc: { + start: { column: 19, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [91, 97], + loc: { + start: { column: 18, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: false, + parameterName: Identifier { + type: "Identifier", + name: "x", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [100, 111], + loc: { + start: { column: 27, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [98, 111], + loc: { + start: { column: 25, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [73, 147], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 148], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..75ff2acd0d2f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,196 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-function Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "isString", + + range: [82, 90], + loc: { + start: { column: 9, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [94, 97], + loc: { + start: { column: 21, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [102, 104], + loc: { + start: { column: 29, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [105, 111], + loc: { + start: { column: 32, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [116, 122], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "typeof", + + range: [123, 129], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [130, 131], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "===", + + range: [132, 135], + loc: { + start: { column: 18, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + String { + type: "String", + value: "'string'", + + range: [136, 144], + loc: { + start: { column: 22, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [144, 145], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [146, 147], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..a14b4cb26df9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-function AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..fa2de67e56fa --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-function AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/fixture.ts new file mode 100644 index 000000000000..76be25896444 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo { + isString(node: any): node is string; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..8337484f095d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,144 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-interface TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "isString", + + range: [91, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + kind: "method", + params: Array [ + Identifier { + type: "Identifier", + name: "node", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [106, 109], + loc: { + start: { column: 17, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [104, 109], + loc: { + start: { column: 15, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [100, 109], + loc: { + start: { column: 11, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: false, + parameterName: Identifier { + type: "Identifier", + name: "node", + + range: [112, 116], + loc: { + start: { column: 23, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [120, 126], + loc: { + start: { column: 31, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + + range: [120, 126], + loc: { + start: { column: 31, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + + range: [112, 126], + loc: { + start: { column: 23, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + + range: [110, 126], + loc: { + start: { column: 21, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + + range: [91, 127], + loc: { + start: { column: 2, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + ], + + range: [87, 129], + loc: { + start: { column: 14, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 129], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 130], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..9edb0fa8cf47 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-interface TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "isString", + + range: [91, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [99, 100], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "node", + + range: [100, 104], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [104, 105], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [106, 109], + loc: { + start: { column: 17, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [109, 110], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [110, 111], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "node", + + range: [112, 116], + loc: { + start: { column: 23, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [117, 119], + loc: { + start: { column: 28, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [120, 126], + loc: { + start: { column: 31, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [126, 127], + loc: { + start: { column: 37, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [128, 129], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..fa1e37ee0e4d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/3-Babel-AST.shot @@ -0,0 +1,144 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-interface Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "isString", + + range: [91, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + kind: "method", + parameters: Array [ + Identifier { + type: "Identifier", + name: "node", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [106, 109], + loc: { + start: { column: 17, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [104, 109], + loc: { + start: { column: 15, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [100, 109], + loc: { + start: { column: 11, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: false, + parameterName: Identifier { + type: "Identifier", + name: "node", + + range: [112, 116], + loc: { + start: { column: 23, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [120, 126], + loc: { + start: { column: 31, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + + range: [120, 126], + loc: { + start: { column: 31, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + + range: [112, 126], + loc: { + start: { column: 23, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + + range: [110, 126], + loc: { + start: { column: 21, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + + range: [91, 127], + loc: { + start: { column: 2, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + ], + + range: [87, 129], + loc: { + start: { column: 14, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 129], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 130], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..dd8e4bd4eeae --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-interface Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "isString", + + range: [91, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [99, 100], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "node", + + range: [100, 104], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [104, 105], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [106, 109], + loc: { + start: { column: 17, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [109, 110], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [110, 111], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "node", + + range: [112, 116], + loc: { + start: { column: 23, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [117, 119], + loc: { + start: { column: 28, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [120, 126], + loc: { + start: { column: 31, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [126, 127], + loc: { + start: { column: 37, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [128, 129], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..da5fc1fa0acb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,150 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-interface AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [ + TSMethodSignature { + type: 'TSMethodSignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'isString', + + range: [91, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + kind: 'method', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'node', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSAnyKeyword { + type: 'TSAnyKeyword', + + range: [106, 109], + loc: { + start: { column: 17, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [104, 109], + loc: { + start: { column: 15, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [100, 109], + loc: { + start: { column: 11, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypePredicate { + type: 'TSTypePredicate', + asserts: false, + parameterName: Identifier { + type: 'Identifier', + name: 'node', + + range: [112, 116], + loc: { + start: { column: 23, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [120, 126], + loc: { + start: { column: 31, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + + range: [120, 126], + loc: { + start: { column: 31, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + + range: [112, 126], + loc: { + start: { column: 23, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + + range: [110, 126], + loc: { + start: { column: 21, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + + range: [91, 127], + loc: { + start: { column: 2, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + ], + + range: [87, 129], + loc: { + start: { column: 14, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 129], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 130], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..2271c3213317 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,162 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-interface AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'isString', + + range: [91, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [99, 100], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'node', + + range: [100, 104], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [104, 105], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'any', + + range: [106, 109], + loc: { + start: { column: 17, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [109, 110], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [110, 111], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'node', + + range: [112, 116], + loc: { + start: { column: 23, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'is', + + range: [117, 119], + loc: { + start: { column: 28, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [120, 126], + loc: { + start: { column: 31, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [126, 127], + loc: { + start: { column: 37, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [128, 129], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/fixture.ts new file mode 100644 index 000000000000..d6cfc79252e1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/fixture.ts @@ -0,0 +1,10 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + isBar(): this is string { + return this instanceof Foo; + } + isBaz = (): this is string => { + return this instanceof Foo; + }; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..4ca55e047db6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,311 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-method TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "isBar", + + range: [87, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: BinaryExpression { + type: "BinaryExpression", + left: ThisExpression { + type: "ThisExpression", + + range: [124, 128], + loc: { + start: { column: 11, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + operator: "instanceof", + right: Identifier { + type: "Identifier", + name: "Foo", + + range: [140, 143], + loc: { + start: { column: 27, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + + range: [124, 143], + loc: { + start: { column: 11, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + + range: [117, 144], + loc: { + start: { column: 4, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + ], + + range: [111, 148], + loc: { + start: { column: 26, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: false, + parameterName: TSThisType { + type: "TSThisType", + + range: [96, 100], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [104, 110], + loc: { + start: { column: 19, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [104, 110], + loc: { + start: { column: 19, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [96, 110], + loc: { + start: { column: 11, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [94, 110], + loc: { + start: { column: 9, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [92, 148], + loc: { + start: { column: 7, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [87, 148], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "isBaz", + + range: [151, 156], + loc: { + start: { column: 2, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + override: false, + static: false, + value: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: BinaryExpression { + type: "BinaryExpression", + left: ThisExpression { + type: "ThisExpression", + + range: [194, 198], + loc: { + start: { column: 11, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + operator: "instanceof", + right: Identifier { + type: "Identifier", + name: "Foo", + + range: [210, 213], + loc: { + start: { column: 27, line: 8 }, + end: { column: 30, line: 8 }, + }, + }, + + range: [194, 213], + loc: { + start: { column: 11, line: 8 }, + end: { column: 30, line: 8 }, + }, + }, + + range: [187, 214], + loc: { + start: { column: 4, line: 8 }, + end: { column: 31, line: 8 }, + }, + }, + ], + + range: [181, 218], + loc: { + start: { column: 32, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: false, + parameterName: TSThisType { + type: "TSThisType", + + range: [163, 167], + loc: { + start: { column: 14, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [171, 177], + loc: { + start: { column: 22, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + + range: [171, 177], + loc: { + start: { column: 22, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + + range: [163, 177], + loc: { + start: { column: 14, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + + range: [161, 177], + loc: { + start: { column: 12, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + + range: [159, 218], + loc: { + start: { column: 10, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + + range: [151, 219], + loc: { + start: { column: 2, line: 7 }, + end: { column: 4, line: 9 }, + }, + }, + ], + + range: [83, 221], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 221], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 222], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..e6d67cf0f375 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,356 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-method TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "isBar", + + range: [87, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [92, 93], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [93, 94], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [94, 95], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [96, 100], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [101, 103], + loc: { + start: { column: 16, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [104, 110], + loc: { + start: { column: 19, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [111, 112], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [117, 123], + loc: { + start: { column: 4, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [124, 128], + loc: { + start: { column: 11, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "instanceof", + + range: [129, 139], + loc: { + start: { column: 16, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [140, 143], + loc: { + start: { column: 27, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [143, 144], + loc: { + start: { column: 30, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [147, 148], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "isBaz", + + range: [151, 156], + loc: { + start: { column: 2, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [157, 158], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [159, 160], + loc: { + start: { column: 10, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [160, 161], + loc: { + start: { column: 11, line: 7 }, + end: { column: 12, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [161, 162], + loc: { + start: { column: 12, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [163, 167], + loc: { + start: { column: 14, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [168, 170], + loc: { + start: { column: 19, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [171, 177], + loc: { + start: { column: 22, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [178, 180], + loc: { + start: { column: 29, line: 7 }, + end: { column: 31, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [181, 182], + loc: { + start: { column: 32, line: 7 }, + end: { column: 33, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [187, 193], + loc: { + start: { column: 4, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [194, 198], + loc: { + start: { column: 11, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Keyword { + type: "Keyword", + value: "instanceof", + + range: [199, 209], + loc: { + start: { column: 16, line: 8 }, + end: { column: 26, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [210, 213], + loc: { + start: { column: 27, line: 8 }, + end: { column: 30, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [213, 214], + loc: { + start: { column: 30, line: 8 }, + end: { column: 31, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [217, 218], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [218, 219], + loc: { + start: { column: 3, line: 9 }, + end: { column: 4, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [220, 221], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..68a1b6492a9c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/3-Babel-AST.shot @@ -0,0 +1,308 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-method Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "isBar", + + range: [87, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: BinaryExpression { + type: "BinaryExpression", + left: ThisExpression { + type: "ThisExpression", + + range: [124, 128], + loc: { + start: { column: 11, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + operator: "instanceof", + right: Identifier { + type: "Identifier", + name: "Foo", + + range: [140, 143], + loc: { + start: { column: 27, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + + range: [124, 143], + loc: { + start: { column: 11, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + + range: [117, 144], + loc: { + start: { column: 4, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + ], + + range: [111, 148], + loc: { + start: { column: 26, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: false, + parameterName: TSThisType { + type: "TSThisType", + + range: [96, 100], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [104, 110], + loc: { + start: { column: 19, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [104, 110], + loc: { + start: { column: 19, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [96, 110], + loc: { + start: { column: 11, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [94, 110], + loc: { + start: { column: 9, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [92, 148], + loc: { + start: { column: 7, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [87, 148], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "isBaz", + + range: [151, 156], + loc: { + start: { column: 2, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + static: false, + value: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: BinaryExpression { + type: "BinaryExpression", + left: ThisExpression { + type: "ThisExpression", + + range: [194, 198], + loc: { + start: { column: 11, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + operator: "instanceof", + right: Identifier { + type: "Identifier", + name: "Foo", + + range: [210, 213], + loc: { + start: { column: 27, line: 8 }, + end: { column: 30, line: 8 }, + }, + }, + + range: [194, 213], + loc: { + start: { column: 11, line: 8 }, + end: { column: 30, line: 8 }, + }, + }, + + range: [187, 214], + loc: { + start: { column: 4, line: 8 }, + end: { column: 31, line: 8 }, + }, + }, + ], + + range: [181, 218], + loc: { + start: { column: 32, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypePredicate { + type: "TSTypePredicate", + asserts: false, + parameterName: TSThisType { + type: "TSThisType", + + range: [163, 167], + loc: { + start: { column: 14, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [171, 177], + loc: { + start: { column: 22, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + + range: [171, 177], + loc: { + start: { column: 22, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + + range: [163, 177], + loc: { + start: { column: 14, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + + range: [161, 177], + loc: { + start: { column: 12, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + + range: [159, 218], + loc: { + start: { column: 10, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + + range: [151, 219], + loc: { + start: { column: 2, line: 7 }, + end: { column: 4, line: 9 }, + }, + }, + ], + + range: [83, 221], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 221], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: "script", + + range: [73, 222], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..596d81964769 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,356 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-method Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "isBar", + + range: [87, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [92, 93], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [93, 94], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [94, 95], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [96, 100], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [101, 103], + loc: { + start: { column: 16, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [104, 110], + loc: { + start: { column: 19, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [111, 112], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [117, 123], + loc: { + start: { column: 4, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [124, 128], + loc: { + start: { column: 11, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "instanceof", + + range: [129, 139], + loc: { + start: { column: 16, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [140, 143], + loc: { + start: { column: 27, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [143, 144], + loc: { + start: { column: 30, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [147, 148], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "isBaz", + + range: [151, 156], + loc: { + start: { column: 2, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [157, 158], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [159, 160], + loc: { + start: { column: 10, line: 7 }, + end: { column: 11, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [160, 161], + loc: { + start: { column: 11, line: 7 }, + end: { column: 12, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [161, 162], + loc: { + start: { column: 12, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [163, 167], + loc: { + start: { column: 14, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "is", + + range: [168, 170], + loc: { + start: { column: 19, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [171, 177], + loc: { + start: { column: 22, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [178, 180], + loc: { + start: { column: 29, line: 7 }, + end: { column: 31, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [181, 182], + loc: { + start: { column: 32, line: 7 }, + end: { column: 33, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [187, 193], + loc: { + start: { column: 4, line: 8 }, + end: { column: 10, line: 8 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [194, 198], + loc: { + start: { column: 11, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Keyword { + type: "Keyword", + value: "instanceof", + + range: [199, 209], + loc: { + start: { column: 16, line: 8 }, + end: { column: 26, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [210, 213], + loc: { + start: { column: 27, line: 8 }, + end: { column: 30, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [213, 214], + loc: { + start: { column: 30, line: 8 }, + end: { column: 31, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [217, 218], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [218, 219], + loc: { + start: { column: 3, line: 9 }, + end: { column: 4, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [220, 221], + loc: { + start: { column: 0, line: 10 }, + end: { column: 1, line: 10 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..d4b80cfc1c0b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,315 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-method AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'isBar', + + range: [87, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: BinaryExpression { + type: 'BinaryExpression', + left: ThisExpression { + type: 'ThisExpression', + + range: [124, 128], + loc: { + start: { column: 11, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + operator: 'instanceof', + right: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [140, 143], + loc: { + start: { column: 27, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + + range: [124, 143], + loc: { + start: { column: 11, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + + range: [117, 144], + loc: { + start: { column: 4, line: 5 }, + end: { column: 31, line: 5 }, + }, + }, + ], + + range: [111, 148], + loc: { + start: { column: 26, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypePredicate { + type: 'TSTypePredicate', + asserts: false, + parameterName: TSThisType { + type: 'TSThisType', + + range: [96, 100], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [104, 110], + loc: { + start: { column: 19, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [104, 110], + loc: { + start: { column: 19, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [96, 110], + loc: { + start: { column: 11, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [94, 110], + loc: { + start: { column: 9, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [92, 148], + loc: { + start: { column: 7, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [87, 148], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'isBaz', + + range: [151, 156], + loc: { + start: { column: 2, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, +- override: false, + static: false, + value: ArrowFunctionExpression { + type: 'ArrowFunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: BinaryExpression { + type: 'BinaryExpression', + left: ThisExpression { + type: 'ThisExpression', + + range: [194, 198], + loc: { + start: { column: 11, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + operator: 'instanceof', + right: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [210, 213], + loc: { + start: { column: 27, line: 8 }, + end: { column: 30, line: 8 }, + }, + }, + + range: [194, 213], + loc: { + start: { column: 11, line: 8 }, + end: { column: 30, line: 8 }, + }, + }, + + range: [187, 214], + loc: { + start: { column: 4, line: 8 }, + end: { column: 31, line: 8 }, + }, + }, + ], + + range: [181, 218], + loc: { + start: { column: 32, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypePredicate { + type: 'TSTypePredicate', + asserts: false, + parameterName: TSThisType { + type: 'TSThisType', + + range: [163, 167], + loc: { + start: { column: 14, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [171, 177], + loc: { + start: { column: 22, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + + range: [171, 177], + loc: { + start: { column: 22, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + + range: [163, 177], + loc: { + start: { column: 14, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + + range: [161, 177], + loc: { + start: { column: 12, line: 7 }, + end: { column: 28, line: 7 }, + }, + }, + + range: [159, 218], + loc: { + start: { column: 10, line: 7 }, + end: { column: 3, line: 9 }, + }, + }, + + range: [151, 219], + loc: { + start: { column: 2, line: 7 }, + end: { column: 4, line: 9 }, + }, + }, + ], + + range: [83, 221], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 221], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 10 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 222], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 11 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..231849aa3af6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-guard-in-method AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/fixture.ts new file mode 100644 index 000000000000..c02d6c0fe781 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type X = A>; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..d43098f77886 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,125 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-import-type-with-type-parameters-in-type-reference TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "X", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSImportType { + type: "TSImportType", + isTypeOf: false, + parameter: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "''", + value: "", + + range: [91, 93], + loc: { + start: { column: 18, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [91, 93], + loc: { + start: { column: 18, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + qualifier: Identifier { + type: "Identifier", + name: "B", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSAnyKeyword { + type: "TSAnyKeyword", + + range: [97, 100], + loc: { + start: { column: 24, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + + range: [96, 101], + loc: { + start: { column: 23, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [84, 101], + loc: { + start: { column: 11, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + ], + + range: [83, 102], + loc: { + start: { column: 10, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [82, 102], + loc: { + start: { column: 9, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..883e01509e7d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-import-type-with-type-parameters-in-type-reference TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "import", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + String { + type: "String", + value: "''", + + range: [91, 93], + loc: { + start: { column: 18, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [97, 100], + loc: { + start: { column: 24, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..990c67030635 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/3-Babel-AST.shot @@ -0,0 +1,115 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-import-type-with-type-parameters-in-type-reference Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "X", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSImportType { + type: "TSImportType", + argument: Literal { + type: "Literal", + raw: "''", + value: "", + + range: [91, 93], + loc: { + start: { column: 18, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + qualifier: Identifier { + type: "Identifier", + name: "B", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSAnyKeyword { + type: "TSAnyKeyword", + + range: [97, 100], + loc: { + start: { column: 24, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + + range: [96, 101], + loc: { + start: { column: 23, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [84, 101], + loc: { + start: { column: 11, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + ], + + range: [83, 102], + loc: { + start: { column: 10, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [82, 102], + loc: { + start: { column: 9, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..a8b1491c2061 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-import-type-with-type-parameters-in-type-reference Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "import", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + String { + type: "String", + value: "''", + + range: [91, 93], + loc: { + start: { column: 18, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [97, 100], + loc: { + start: { column: 24, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..be524030353d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,133 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-import-type-with-type-parameters-in-type-reference AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'X', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'A', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSImportType { + type: 'TSImportType', +- isTypeOf: false, +- parameter: TSLiteralType { +- type: 'TSLiteralType', +- literal: Literal { +- type: 'Literal', +- raw: '\\\\'\\\\'', +- value: '', +- +- range: [91, 93], +- loc: { +- start: { column: 18, line: 3 }, +- end: { column: 20, line: 3 }, +- }, +- }, ++ argument: Literal { ++ type: 'Literal', ++ raw: '\\\\'\\\\'', ++ value: '', + + range: [91, 93], + loc: { + start: { column: 18, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + qualifier: Identifier { + type: 'Identifier', + name: 'B', + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSAnyKeyword { + type: 'TSAnyKeyword', + + range: [97, 100], + loc: { + start: { column: 24, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + + range: [96, 101], + loc: { + start: { column: 23, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [84, 101], + loc: { + start: { column: 11, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + ], + + range: [83, 102], + loc: { + start: { column: 10, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [82, 102], + loc: { + start: { column: 9, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..60757fd36b6e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-import-type-with-type-parameters-in-type-reference AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/fixture.ts new file mode 100644 index 000000000000..92fd390c4fad --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/fixture.ts @@ -0,0 +1,4 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type A = typeof import('A'); +type B = import('B').X; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..8da69b43079c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-import-type TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "A", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + typeAnnotation: TSImportType { + type: "TSImportType", + isTypeOf: true, + parameter: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "'A'", + value: "A", + + range: [96, 99], + loc: { + start: { column: 23, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [96, 99], + loc: { + start: { column: 23, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + qualifier: null, + typeParameters: null, + + range: [82, 100], + loc: { + start: { column: 9, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "B", + + range: [107, 108], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + typeAnnotation: TSImportType { + type: "TSImportType", + isTypeOf: false, + parameter: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "'B'", + value: "B", + + range: [118, 121], + loc: { + start: { column: 16, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + + range: [118, 121], + loc: { + start: { column: 16, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + qualifier: Identifier { + type: "Identifier", + name: "X", + + range: [123, 124], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Y", + + range: [125, 126], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [125, 126], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + ], + + range: [124, 127], + loc: { + start: { column: 22, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [111, 127], + loc: { + start: { column: 9, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [102, 128], + loc: { + start: { column: 0, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 129], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..693830fdd0dd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,226 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-import-type TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "typeof", + + range: [82, 88], + loc: { + start: { column: 9, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "import", + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + String { + type: "String", + value: "'A'", + + range: [96, 99], + loc: { + start: { column: 23, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [102, 106], + loc: { + start: { column: 0, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [107, 108], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [109, 110], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "import", + + range: [111, 117], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [117, 118], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + String { + type: "String", + value: "'B'", + + range: [118, 121], + loc: { + start: { column: 16, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [121, 122], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [122, 123], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [123, 124], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [124, 125], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Y", + + range: [125, 126], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [126, 127], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [127, 128], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..d577d2310a32 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/3-Babel-AST.shot @@ -0,0 +1,143 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-import-type Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "A", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + typeAnnotation: TSTypeQuery { + type: "TSTypeQuery", + exprName: TSImportType { + type: "TSImportType", + argument: Literal { + type: "Literal", + raw: "'A'", + value: "A", + + range: [96, 99], + loc: { + start: { column: 23, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [89, 100], + loc: { + start: { column: 16, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [82, 100], + loc: { + start: { column: 9, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "B", + + range: [107, 108], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + typeAnnotation: TSImportType { + type: "TSImportType", + argument: Literal { + type: "Literal", + raw: "'B'", + value: "B", + + range: [118, 121], + loc: { + start: { column: 16, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + qualifier: Identifier { + type: "Identifier", + name: "X", + + range: [123, 124], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Y", + + range: [125, 126], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [125, 126], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + ], + + range: [124, 127], + loc: { + start: { column: 22, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [111, 127], + loc: { + start: { column: 9, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [102, 128], + loc: { + start: { column: 0, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 129], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..b857cac00346 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,226 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-import-type Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "typeof", + + range: [82, 88], + loc: { + start: { column: 9, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "import", + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + String { + type: "String", + value: "'A'", + + range: [96, 99], + loc: { + start: { column: 23, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [102, 106], + loc: { + start: { column: 0, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [107, 108], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [109, 110], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "import", + + range: [111, 117], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [117, 118], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + String { + type: "String", + value: "'B'", + + range: [118, 121], + loc: { + start: { column: 16, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [121, 122], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [122, 123], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [123, 124], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [124, 125], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Y", + + range: [125, 126], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [126, 127], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [127, 128], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..7eb35747e26d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,172 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-import-type AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'A', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, +- typeAnnotation: TSImportType { +- type: 'TSImportType', +- isTypeOf: true, +- parameter: TSLiteralType { +- type: 'TSLiteralType', +- literal: Literal { ++ typeAnnotation: TSTypeQuery { ++ type: 'TSTypeQuery', ++ exprName: TSImportType { ++ type: 'TSImportType', ++ argument: Literal { + type: 'Literal', + raw: '\\\\'A\\\\'', + value: 'A', + + range: [96, 99], + loc: { + start: { column: 23, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + +- range: [96, 99], ++ range: [89, 100], + loc: { +- start: { column: 23, line: 3 }, +- end: { column: 26, line: 3 }, ++ start: { column: 16, line: 3 }, ++ end: { column: 27, line: 3 }, + }, + }, +- qualifier: null, +- typeParameters: null, + + range: [82, 100], + loc: { + start: { column: 9, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'B', + + range: [107, 108], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + typeAnnotation: TSImportType { + type: 'TSImportType', +- isTypeOf: false, +- parameter: TSLiteralType { +- type: 'TSLiteralType', +- literal: Literal { +- type: 'Literal', +- raw: '\\\\'B\\\\'', +- value: 'B', +- +- range: [118, 121], +- loc: { +- start: { column: 16, line: 4 }, +- end: { column: 19, line: 4 }, +- }, +- }, ++ argument: Literal { ++ type: 'Literal', ++ raw: '\\\\'B\\\\'', ++ value: 'B', + + range: [118, 121], + loc: { + start: { column: 16, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + qualifier: Identifier { + type: 'Identifier', + name: 'X', + + range: [123, 124], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'Y', + + range: [125, 126], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [125, 126], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + ], + + range: [124, 127], + loc: { + start: { column: 22, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [111, 127], + loc: { + start: { column: 9, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [102, 128], + loc: { + start: { column: 0, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 129], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..3809f4162916 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-import-type AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/fixture.ts new file mode 100644 index 000000000000..5e97bf7c7bb7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export { type A, type B } from 'mod'; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..a34c4a80e3e8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,101 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-only-export-specifiers TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [104, 109], + loc: { + start: { column: 31, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + specifiers: Array [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "A", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + exportKind: "type", + local: Identifier { + type: "Identifier", + name: "A", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [82, 88], + loc: { + start: { column: 9, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "B", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + exportKind: "type", + local: Identifier { + type: "Identifier", + name: "B", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [90, 96], + loc: { + start: { column: 17, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 111], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..3280ea010fa8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-only-export-specifiers TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [82, 86], + loc: { + start: { column: 9, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [90, 94], + loc: { + start: { column: 17, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [99, 103], + loc: { + start: { column: 26, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [104, 109], + loc: { + start: { column: 31, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..174042ed3ad9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/3-Babel-AST.shot @@ -0,0 +1,101 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-only-export-specifiers Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [104, 109], + loc: { + start: { column: 31, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + specifiers: Array [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "A", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + exportKind: "type", + local: Identifier { + type: "Identifier", + name: "A", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [82, 88], + loc: { + start: { column: 9, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "B", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + exportKind: "type", + local: Identifier { + type: "Identifier", + name: "B", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [90, 96], + loc: { + start: { column: 17, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 111], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..d11606f25662 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-only-export-specifiers Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [82, 86], + loc: { + start: { column: 9, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [90, 94], + loc: { + start: { column: 17, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [99, 103], + loc: { + start: { column: 26, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [104, 109], + loc: { + start: { column: 31, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..b269b793948e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-only-export-specifiers AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..1db1ef638f8d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-only-export-specifiers AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/fixture.ts new file mode 100644 index 000000000000..d069f3df8745 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +import { type A, type B } from 'mod'; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..8e636185a48b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,100 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-only-import-specifiers TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ImportDeclaration { + type: "ImportDeclaration", + assertions: Array [], + importKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [104, 109], + loc: { + start: { column: 31, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + specifiers: Array [ + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "A", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + importKind: "type", + local: Identifier { + type: "Identifier", + name: "A", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [82, 88], + loc: { + start: { column: 9, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "B", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + importKind: "type", + local: Identifier { + type: "Identifier", + name: "B", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [90, 96], + loc: { + start: { column: 17, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 111], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..cfd3524adc17 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-only-import-specifiers TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "import", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [82, 86], + loc: { + start: { column: 9, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [90, 94], + loc: { + start: { column: 17, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [99, 103], + loc: { + start: { column: 26, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [104, 109], + loc: { + start: { column: 31, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..9c4e521e00a0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/3-Babel-AST.shot @@ -0,0 +1,100 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-only-import-specifiers Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ImportDeclaration { + type: "ImportDeclaration", + assertions: Array [], + importKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [104, 109], + loc: { + start: { column: 31, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + specifiers: Array [ + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "A", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + importKind: "type", + local: Identifier { + type: "Identifier", + name: "A", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [82, 88], + loc: { + start: { column: 9, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "B", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + importKind: "type", + local: Identifier { + type: "Identifier", + name: "B", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [90, 96], + loc: { + start: { column: 17, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + ], + sourceType: "module", + + range: [73, 111], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..702fdab12a5f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-only-import-specifiers Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "import", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [82, 86], + loc: { + start: { column: 9, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [90, 94], + loc: { + start: { column: 17, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [99, 103], + loc: { + start: { column: 26, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [104, 109], + loc: { + start: { column: 31, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..c473f9f118ee --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-only-import-specifiers AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..f5edce33d5b5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-only-import-specifiers AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/fixture.ts new file mode 100644 index 000000000000..024c7f459b0d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/fixture.ts @@ -0,0 +1,9 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class foo extends bar {} +class foo2< + /* aaa */ A /* bbb */ = 2 /* bbb */, +> extends bar {} +interface bar extends bar2 {} +interface bar2 + extends bar {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..576e0c9b98a9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,482 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [141, 143], + loc: { + start: { column: 68, line: 3 }, + end: { column: 70, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "bar", + + range: [114, 117], + loc: { + start: { column: 41, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + superTypeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [128, 129], + loc: { + start: { column: 55, line: 3 }, + end: { column: 56, line: 3 }, + }, + }, + + range: [128, 129], + loc: { + start: { column: 55, line: 3 }, + end: { column: 56, line: 3 }, + }, + }, + ], + + range: [117, 140], + loc: { + start: { column: 44, line: 3 }, + end: { column: 67, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "A", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + out: false, + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + + range: [82, 105], + loc: { + start: { column: 9, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [73, 143], + loc: { + start: { column: 0, line: 3 }, + end: { column: 70, line: 3 }, + }, + }, + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [232, 234], + loc: { + start: { column: 37, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "foo2", + + range: [150, 154], + loc: { + start: { column: 6, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "bar", + + range: [205, 208], + loc: { + start: { column: 10, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + superTypeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [219, 220], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + + range: [219, 220], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + ], + + range: [208, 231], + loc: { + start: { column: 13, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + default: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [182, 183], + loc: { + start: { column: 26, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + + range: [182, 183], + loc: { + start: { column: 26, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "A", + + range: [168, 169], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + out: false, + + range: [168, 183], + loc: { + start: { column: 12, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + ], + + range: [154, 196], + loc: { + start: { column: 10, line: 4 }, + end: { column: 1, line: 6 }, + }, + }, + + range: [144, 234], + loc: { + start: { column: 0, line: 4 }, + end: { column: 39, line: 6 }, + }, + }, + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [308, 310], + loc: { + start: { column: 73, line: 7 }, + end: { column: 75, line: 7 }, + }, + }, + extends: Array [ + TSInterfaceHeritage { + type: "TSInterfaceHeritage", + expression: Identifier { + type: "Identifier", + name: "bar2", + + range: [280, 284], + loc: { + start: { column: 45, line: 7 }, + end: { column: 49, line: 7 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [295, 296], + loc: { + start: { column: 60, line: 7 }, + end: { column: 61, line: 7 }, + }, + }, + + range: [295, 296], + loc: { + start: { column: 60, line: 7 }, + end: { column: 61, line: 7 }, + }, + }, + ], + + range: [284, 307], + loc: { + start: { column: 49, line: 7 }, + end: { column: 72, line: 7 }, + }, + }, + + range: [280, 307], + loc: { + start: { column: 45, line: 7 }, + end: { column: 72, line: 7 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "bar", + + range: [245, 248], + loc: { + start: { column: 10, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "A", + + range: [259, 260], + loc: { + start: { column: 24, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + out: false, + + range: [259, 260], + loc: { + start: { column: 24, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + ], + + range: [248, 271], + loc: { + start: { column: 13, line: 7 }, + end: { column: 36, line: 7 }, + }, + }, + + range: [235, 310], + loc: { + start: { column: 0, line: 7 }, + end: { column: 75, line: 7 }, + }, + }, + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [400, 402], + loc: { + start: { column: 37, line: 9 }, + end: { column: 39, line: 9 }, + }, + }, + extends: Array [ + TSInterfaceHeritage { + type: "TSInterfaceHeritage", + expression: Identifier { + type: "Identifier", + name: "bar", + + range: [373, 376], + loc: { + start: { column: 10, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [387, 388], + loc: { + start: { column: 24, line: 9 }, + end: { column: 25, line: 9 }, + }, + }, + + range: [387, 388], + loc: { + start: { column: 24, line: 9 }, + end: { column: 25, line: 9 }, + }, + }, + ], + + range: [376, 399], + loc: { + start: { column: 13, line: 9 }, + end: { column: 36, line: 9 }, + }, + }, + + range: [373, 399], + loc: { + start: { column: 10, line: 9 }, + end: { column: 36, line: 9 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "bar2", + + range: [321, 325], + loc: { + start: { column: 10, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + default: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [350, 351], + loc: { + start: { column: 39, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, + + range: [350, 351], + loc: { + start: { column: 39, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "A", + + range: [336, 337], + loc: { + start: { column: 25, line: 8 }, + end: { column: 26, line: 8 }, + }, + }, + out: false, + + range: [336, 351], + loc: { + start: { column: 25, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, + ], + + range: [325, 362], + loc: { + start: { column: 14, line: 8 }, + end: { column: 51, line: 8 }, + }, + }, + + range: [311, 402], + loc: { + start: { column: 0, line: 8 }, + end: { column: 39, line: 9 }, + }, + }, + ], + sourceType: "script", + + range: [73, 403], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 10 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..f2501ac1c390 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,536 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [106, 113], + loc: { + start: { column: 33, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [114, 117], + loc: { + start: { column: 41, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [128, 129], + loc: { + start: { column: 55, line: 3 }, + end: { column: 56, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [139, 140], + loc: { + start: { column: 66, line: 3 }, + end: { column: 67, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [141, 142], + loc: { + start: { column: 68, line: 3 }, + end: { column: 69, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [142, 143], + loc: { + start: { column: 69, line: 3 }, + end: { column: 70, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [144, 149], + loc: { + start: { column: 0, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo2", + + range: [150, 154], + loc: { + start: { column: 6, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [154, 155], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [168, 169], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [180, 181], + loc: { + start: { column: 24, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [182, 183], + loc: { + start: { column: 26, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [193, 194], + loc: { + start: { column: 37, line: 5 }, + end: { column: 38, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [195, 196], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [197, 204], + loc: { + start: { column: 2, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [205, 208], + loc: { + start: { column: 10, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [208, 209], + loc: { + start: { column: 13, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [219, 220], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [230, 231], + loc: { + start: { column: 35, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [232, 233], + loc: { + start: { column: 37, line: 6 }, + end: { column: 38, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [233, 234], + loc: { + start: { column: 38, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "interface", + + range: [235, 244], + loc: { + start: { column: 0, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [245, 248], + loc: { + start: { column: 10, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [248, 249], + loc: { + start: { column: 13, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [259, 260], + loc: { + start: { column: 24, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [270, 271], + loc: { + start: { column: 35, line: 7 }, + end: { column: 36, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [272, 279], + loc: { + start: { column: 37, line: 7 }, + end: { column: 44, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar2", + + range: [280, 284], + loc: { + start: { column: 45, line: 7 }, + end: { column: 49, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [284, 285], + loc: { + start: { column: 49, line: 7 }, + end: { column: 50, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [295, 296], + loc: { + start: { column: 60, line: 7 }, + end: { column: 61, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [306, 307], + loc: { + start: { column: 71, line: 7 }, + end: { column: 72, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [308, 309], + loc: { + start: { column: 73, line: 7 }, + end: { column: 74, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [309, 310], + loc: { + start: { column: 74, line: 7 }, + end: { column: 75, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "interface", + + range: [311, 320], + loc: { + start: { column: 0, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar2", + + range: [321, 325], + loc: { + start: { column: 10, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [325, 326], + loc: { + start: { column: 14, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [336, 337], + loc: { + start: { column: 25, line: 8 }, + end: { column: 26, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [348, 349], + loc: { + start: { column: 37, line: 8 }, + end: { column: 38, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [350, 351], + loc: { + start: { column: 39, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [361, 362], + loc: { + start: { column: 50, line: 8 }, + end: { column: 51, line: 8 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [365, 372], + loc: { + start: { column: 2, line: 9 }, + end: { column: 9, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [373, 376], + loc: { + start: { column: 10, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [376, 377], + loc: { + start: { column: 13, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [387, 388], + loc: { + start: { column: 24, line: 9 }, + end: { column: 25, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [398, 399], + loc: { + start: { column: 35, line: 9 }, + end: { column: 36, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [400, 401], + loc: { + start: { column: 37, line: 9 }, + end: { column: 38, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [401, 402], + loc: { + start: { column: 38, line: 9 }, + end: { column: 39, line: 9 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..39287bba2601 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/3-Babel-AST.shot @@ -0,0 +1,438 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [141, 143], + loc: { + start: { column: 68, line: 3 }, + end: { column: 70, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "bar", + + range: [114, 117], + loc: { + start: { column: 41, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + superTypeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [128, 129], + loc: { + start: { column: 55, line: 3 }, + end: { column: 56, line: 3 }, + }, + }, + + range: [128, 129], + loc: { + start: { column: 55, line: 3 }, + end: { column: 56, line: 3 }, + }, + }, + ], + + range: [117, 140], + loc: { + start: { column: 44, line: 3 }, + end: { column: 67, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "A", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + + range: [82, 105], + loc: { + start: { column: 9, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [73, 143], + loc: { + start: { column: 0, line: 3 }, + end: { column: 70, line: 3 }, + }, + }, + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [232, 234], + loc: { + start: { column: 37, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "foo2", + + range: [150, 154], + loc: { + start: { column: 6, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "bar", + + range: [205, 208], + loc: { + start: { column: 10, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + superTypeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [219, 220], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + + range: [219, 220], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + ], + + range: [208, 231], + loc: { + start: { column: 13, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + default: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [182, 183], + loc: { + start: { column: 26, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + + range: [182, 183], + loc: { + start: { column: 26, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + name: "A", + + range: [168, 183], + loc: { + start: { column: 12, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + ], + + range: [154, 196], + loc: { + start: { column: 10, line: 4 }, + end: { column: 1, line: 6 }, + }, + }, + + range: [144, 234], + loc: { + start: { column: 0, line: 4 }, + end: { column: 39, line: 6 }, + }, + }, + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [308, 310], + loc: { + start: { column: 73, line: 7 }, + end: { column: 75, line: 7 }, + }, + }, + extends: Array [ + TSExpressionWithTypeArguments { + type: "TSExpressionWithTypeArguments", + expression: Identifier { + type: "Identifier", + name: "bar2", + + range: [280, 284], + loc: { + start: { column: 45, line: 7 }, + end: { column: 49, line: 7 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [295, 296], + loc: { + start: { column: 60, line: 7 }, + end: { column: 61, line: 7 }, + }, + }, + + range: [295, 296], + loc: { + start: { column: 60, line: 7 }, + end: { column: 61, line: 7 }, + }, + }, + ], + + range: [284, 307], + loc: { + start: { column: 49, line: 7 }, + end: { column: 72, line: 7 }, + }, + }, + + range: [280, 307], + loc: { + start: { column: 45, line: 7 }, + end: { column: 72, line: 7 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "bar", + + range: [245, 248], + loc: { + start: { column: 10, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "A", + + range: [259, 260], + loc: { + start: { column: 24, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + ], + + range: [248, 271], + loc: { + start: { column: 13, line: 7 }, + end: { column: 36, line: 7 }, + }, + }, + + range: [235, 310], + loc: { + start: { column: 0, line: 7 }, + end: { column: 75, line: 7 }, + }, + }, + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [400, 402], + loc: { + start: { column: 37, line: 9 }, + end: { column: 39, line: 9 }, + }, + }, + extends: Array [ + TSExpressionWithTypeArguments { + type: "TSExpressionWithTypeArguments", + expression: Identifier { + type: "Identifier", + name: "bar", + + range: [373, 376], + loc: { + start: { column: 10, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [387, 388], + loc: { + start: { column: 24, line: 9 }, + end: { column: 25, line: 9 }, + }, + }, + + range: [387, 388], + loc: { + start: { column: 24, line: 9 }, + end: { column: 25, line: 9 }, + }, + }, + ], + + range: [376, 399], + loc: { + start: { column: 13, line: 9 }, + end: { column: 36, line: 9 }, + }, + }, + + range: [373, 399], + loc: { + start: { column: 10, line: 9 }, + end: { column: 36, line: 9 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "bar2", + + range: [321, 325], + loc: { + start: { column: 10, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + default: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [350, 351], + loc: { + start: { column: 39, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, + + range: [350, 351], + loc: { + start: { column: 39, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, + name: "A", + + range: [336, 351], + loc: { + start: { column: 25, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, + ], + + range: [325, 362], + loc: { + start: { column: 14, line: 8 }, + end: { column: 51, line: 8 }, + }, + }, + + range: [311, 402], + loc: { + start: { column: 0, line: 8 }, + end: { column: 39, line: 9 }, + }, + }, + ], + sourceType: "script", + + range: [73, 403], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 10 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..f6fa18d3be7f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,536 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [106, 113], + loc: { + start: { column: 33, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [114, 117], + loc: { + start: { column: 41, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [128, 129], + loc: { + start: { column: 55, line: 3 }, + end: { column: 56, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [139, 140], + loc: { + start: { column: 66, line: 3 }, + end: { column: 67, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [141, 142], + loc: { + start: { column: 68, line: 3 }, + end: { column: 69, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [142, 143], + loc: { + start: { column: 69, line: 3 }, + end: { column: 70, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [144, 149], + loc: { + start: { column: 0, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo2", + + range: [150, 154], + loc: { + start: { column: 6, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [154, 155], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [168, 169], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [180, 181], + loc: { + start: { column: 24, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [182, 183], + loc: { + start: { column: 26, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [193, 194], + loc: { + start: { column: 37, line: 5 }, + end: { column: 38, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [195, 196], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [197, 204], + loc: { + start: { column: 2, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [205, 208], + loc: { + start: { column: 10, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [208, 209], + loc: { + start: { column: 13, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [219, 220], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [230, 231], + loc: { + start: { column: 35, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [232, 233], + loc: { + start: { column: 37, line: 6 }, + end: { column: 38, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [233, 234], + loc: { + start: { column: 38, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "interface", + + range: [235, 244], + loc: { + start: { column: 0, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [245, 248], + loc: { + start: { column: 10, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [248, 249], + loc: { + start: { column: 13, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [259, 260], + loc: { + start: { column: 24, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [270, 271], + loc: { + start: { column: 35, line: 7 }, + end: { column: 36, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [272, 279], + loc: { + start: { column: 37, line: 7 }, + end: { column: 44, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar2", + + range: [280, 284], + loc: { + start: { column: 45, line: 7 }, + end: { column: 49, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [284, 285], + loc: { + start: { column: 49, line: 7 }, + end: { column: 50, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [295, 296], + loc: { + start: { column: 60, line: 7 }, + end: { column: 61, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [306, 307], + loc: { + start: { column: 71, line: 7 }, + end: { column: 72, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [308, 309], + loc: { + start: { column: 73, line: 7 }, + end: { column: 74, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [309, 310], + loc: { + start: { column: 74, line: 7 }, + end: { column: 75, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "interface", + + range: [311, 320], + loc: { + start: { column: 0, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar2", + + range: [321, 325], + loc: { + start: { column: 10, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [325, 326], + loc: { + start: { column: 14, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [336, 337], + loc: { + start: { column: 25, line: 8 }, + end: { column: 26, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [348, 349], + loc: { + start: { column: 37, line: 8 }, + end: { column: 38, line: 8 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [350, 351], + loc: { + start: { column: 39, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [361, 362], + loc: { + start: { column: 50, line: 8 }, + end: { column: 51, line: 8 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [365, 372], + loc: { + start: { column: 2, line: 9 }, + end: { column: 9, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [373, 376], + loc: { + start: { column: 10, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [376, 377], + loc: { + start: { column: 13, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [387, 388], + loc: { + start: { column: 24, line: 9 }, + end: { column: 25, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [398, 399], + loc: { + start: { column: 35, line: 9 }, + end: { column: 36, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [400, 401], + loc: { + start: { column: 37, line: 9 }, + end: { column: 38, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [401, 402], + loc: { + start: { column: 38, line: 9 }, + end: { column: 39, line: 9 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..d1bcce0c6fc3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,494 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [141, 143], + loc: { + start: { column: 68, line: 3 }, + end: { column: 70, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: Identifier { + type: 'Identifier', + name: 'bar', + + range: [114, 117], + loc: { + start: { column: 41, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + superTypeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'A', + + range: [128, 129], + loc: { + start: { column: 55, line: 3 }, + end: { column: 56, line: 3 }, + }, + }, + + range: [128, 129], + loc: { + start: { column: 55, line: 3 }, + end: { column: 56, line: 3 }, + }, + }, + ], + + range: [117, 140], + loc: { + start: { column: 44, line: 3 }, + end: { column: 67, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'A', +- +- range: [93, 94], +- loc: { +- start: { column: 20, line: 3 }, +- end: { column: 21, line: 3 }, +- }, +- }, +- out: false, ++ name: 'A', + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + + range: [82, 105], + loc: { + start: { column: 9, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [73, 143], + loc: { + start: { column: 0, line: 3 }, + end: { column: 70, line: 3 }, + }, + }, + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [232, 234], + loc: { + start: { column: 37, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'foo2', + + range: [150, 154], + loc: { + start: { column: 6, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + superClass: Identifier { + type: 'Identifier', + name: 'bar', + + range: [205, 208], + loc: { + start: { column: 10, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + superTypeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'A', + + range: [219, 220], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + + range: [219, 220], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + ], + + range: [208, 231], + loc: { + start: { column: 13, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + default: TSLiteralType { + type: 'TSLiteralType', + literal: Literal { + type: 'Literal', + raw: '2', + value: 2, + + range: [182, 183], + loc: { + start: { column: 26, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + + range: [182, 183], + loc: { + start: { column: 26, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'A', +- +- range: [168, 169], +- loc: { +- start: { column: 12, line: 5 }, +- end: { column: 13, line: 5 }, +- }, +- }, +- out: false, ++ name: 'A', + + range: [168, 183], + loc: { + start: { column: 12, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + ], + + range: [154, 196], + loc: { + start: { column: 10, line: 4 }, + end: { column: 1, line: 6 }, + }, + }, + + range: [144, 234], + loc: { + start: { column: 0, line: 4 }, + end: { column: 39, line: 6 }, + }, + }, + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [], + + range: [308, 310], + loc: { + start: { column: 73, line: 7 }, + end: { column: 75, line: 7 }, + }, + }, + extends: Array [ +- TSInterfaceHeritage { +- type: 'TSInterfaceHeritage', ++ TSExpressionWithTypeArguments { ++ type: 'TSExpressionWithTypeArguments', + expression: Identifier { + type: 'Identifier', + name: 'bar2', + + range: [280, 284], + loc: { + start: { column: 45, line: 7 }, + end: { column: 49, line: 7 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'A', + + range: [295, 296], + loc: { + start: { column: 60, line: 7 }, + end: { column: 61, line: 7 }, + }, + }, + + range: [295, 296], + loc: { + start: { column: 60, line: 7 }, + end: { column: 61, line: 7 }, + }, + }, + ], + + range: [284, 307], + loc: { + start: { column: 49, line: 7 }, + end: { column: 72, line: 7 }, + }, + }, + + range: [280, 307], + loc: { + start: { column: 45, line: 7 }, + end: { column: 72, line: 7 }, + }, + }, + ], + id: Identifier { + type: 'Identifier', + name: 'bar', + + range: [245, 248], + loc: { + start: { column: 10, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'A', +- +- range: [259, 260], +- loc: { +- start: { column: 24, line: 7 }, +- end: { column: 25, line: 7 }, +- }, +- }, +- out: false, ++ name: 'A', + + range: [259, 260], + loc: { + start: { column: 24, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + ], + + range: [248, 271], + loc: { + start: { column: 13, line: 7 }, + end: { column: 36, line: 7 }, + }, + }, + + range: [235, 310], + loc: { + start: { column: 0, line: 7 }, + end: { column: 75, line: 7 }, + }, + }, + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [], + + range: [400, 402], + loc: { + start: { column: 37, line: 9 }, + end: { column: 39, line: 9 }, + }, + }, + extends: Array [ +- TSInterfaceHeritage { +- type: 'TSInterfaceHeritage', ++ TSExpressionWithTypeArguments { ++ type: 'TSExpressionWithTypeArguments', + expression: Identifier { + type: 'Identifier', + name: 'bar', + + range: [373, 376], + loc: { + start: { column: 10, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'A', + + range: [387, 388], + loc: { + start: { column: 24, line: 9 }, + end: { column: 25, line: 9 }, + }, + }, + + range: [387, 388], + loc: { + start: { column: 24, line: 9 }, + end: { column: 25, line: 9 }, + }, + }, + ], + + range: [376, 399], + loc: { + start: { column: 13, line: 9 }, + end: { column: 36, line: 9 }, + }, + }, + + range: [373, 399], + loc: { + start: { column: 10, line: 9 }, + end: { column: 36, line: 9 }, + }, + }, + ], + id: Identifier { + type: 'Identifier', + name: 'bar2', + + range: [321, 325], + loc: { + start: { column: 10, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + default: TSLiteralType { + type: 'TSLiteralType', + literal: Literal { + type: 'Literal', + raw: '2', + value: 2, + + range: [350, 351], + loc: { + start: { column: 39, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, + + range: [350, 351], + loc: { + start: { column: 39, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'A', +- +- range: [336, 337], +- loc: { +- start: { column: 25, line: 8 }, +- end: { column: 26, line: 8 }, +- }, +- }, +- out: false, ++ name: 'A', + + range: [336, 351], + loc: { + start: { column: 25, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, + ], + + range: [325, 362], + loc: { + start: { column: 14, line: 8 }, + end: { column: 51, line: 8 }, + }, + }, + + range: [311, 402], + loc: { + start: { column: 0, line: 8 }, + end: { column: 39, line: 9 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 403], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 10 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..8a8ae2c4f719 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,544 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'A', + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'extends', + + range: [106, 113], + loc: { + start: { column: 33, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar', + + range: [114, 117], + loc: { + start: { column: 41, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'A', + + range: [128, 129], + loc: { + start: { column: 55, line: 3 }, + end: { column: 56, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [139, 140], + loc: { + start: { column: 66, line: 3 }, + end: { column: 67, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [141, 142], + loc: { + start: { column: 68, line: 3 }, + end: { column: 69, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [142, 143], + loc: { + start: { column: 69, line: 3 }, + end: { column: 70, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'class', + + range: [144, 149], + loc: { + start: { column: 0, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'foo2', + + range: [150, 154], + loc: { + start: { column: 6, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [154, 155], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'A', + + range: [168, 169], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [180, 181], + loc: { + start: { column: 24, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + Numeric { + type: 'Numeric', + value: '2', + + range: [182, 183], + loc: { + start: { column: 26, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [193, 194], + loc: { + start: { column: 37, line: 5 }, + end: { column: 38, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [195, 196], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'extends', + + range: [197, 204], + loc: { + start: { column: 2, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar', + + range: [205, 208], + loc: { + start: { column: 10, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [208, 209], + loc: { + start: { column: 13, line: 6 }, + end: { column: 14, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'A', + + range: [219, 220], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [230, 231], + loc: { + start: { column: 35, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [232, 233], + loc: { + start: { column: 37, line: 6 }, + end: { column: 38, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [233, 234], + loc: { + start: { column: 38, line: 6 }, + end: { column: 39, line: 6 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [235, 244], + loc: { + start: { column: 0, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar', + + range: [245, 248], + loc: { + start: { column: 10, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [248, 249], + loc: { + start: { column: 13, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'A', + + range: [259, 260], + loc: { + start: { column: 24, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [270, 271], + loc: { + start: { column: 35, line: 7 }, + end: { column: 36, line: 7 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'extends', + + range: [272, 279], + loc: { + start: { column: 37, line: 7 }, + end: { column: 44, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar2', + + range: [280, 284], + loc: { + start: { column: 45, line: 7 }, + end: { column: 49, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [284, 285], + loc: { + start: { column: 49, line: 7 }, + end: { column: 50, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'A', + + range: [295, 296], + loc: { + start: { column: 60, line: 7 }, + end: { column: 61, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [306, 307], + loc: { + start: { column: 71, line: 7 }, + end: { column: 72, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [308, 309], + loc: { + start: { column: 73, line: 7 }, + end: { column: 74, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [309, 310], + loc: { + start: { column: 74, line: 7 }, + end: { column: 75, line: 7 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [311, 320], + loc: { + start: { column: 0, line: 8 }, + end: { column: 9, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar2', + + range: [321, 325], + loc: { + start: { column: 10, line: 8 }, + end: { column: 14, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [325, 326], + loc: { + start: { column: 14, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'A', + + range: [336, 337], + loc: { + start: { column: 25, line: 8 }, + end: { column: 26, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [348, 349], + loc: { + start: { column: 37, line: 8 }, + end: { column: 38, line: 8 }, + }, + }, + Numeric { + type: 'Numeric', + value: '2', + + range: [350, 351], + loc: { + start: { column: 39, line: 8 }, + end: { column: 40, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [361, 362], + loc: { + start: { column: 50, line: 8 }, + end: { column: 51, line: 8 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'extends', + + range: [365, 372], + loc: { + start: { column: 2, line: 9 }, + end: { column: 9, line: 9 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'bar', + + range: [373, 376], + loc: { + start: { column: 10, line: 9 }, + end: { column: 13, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [376, 377], + loc: { + start: { column: 13, line: 9 }, + end: { column: 14, line: 9 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'A', + + range: [387, 388], + loc: { + start: { column: 24, line: 9 }, + end: { column: 25, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [398, 399], + loc: { + start: { column: 35, line: 9 }, + end: { column: 36, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [400, 401], + loc: { + start: { column: 37, line: 9 }, + end: { column: 38, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [401, 402], + loc: { + start: { column: 38, line: 9 }, + end: { column: 39, line: 9 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/fixture.ts new file mode 100644 index 000000000000..d9641959f892 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +foo(); +function bar() {} +function baz() {} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..15fde1c2edb9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,225 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-parameters-comments TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "foo", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + optional: false, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + + range: [76, 111], + loc: { + start: { column: 3, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + + range: [73, 114], + loc: { + start: { column: 0, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [153, 155], + loc: { + start: { column: 38, line: 4 }, + end: { column: 40, line: 4 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "bar", + + range: [124, 127], + loc: { + start: { column: 9, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "A", + + range: [138, 139], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + out: false, + + range: [138, 139], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + ], + + range: [127, 150], + loc: { + start: { column: 12, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + + range: [115, 155], + loc: { + start: { column: 0, line: 4 }, + end: { column: 40, line: 4 }, + }, + }, + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [200, 202], + loc: { + start: { column: 44, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "baz", + + range: [165, 168], + loc: { + start: { column: 9, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + default: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Foo", + + range: [193, 196], + loc: { + start: { column: 37, line: 5 }, + end: { column: 40, line: 5 }, + }, + }, + + range: [193, 196], + loc: { + start: { column: 37, line: 5 }, + end: { column: 40, line: 5 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "A", + + range: [179, 180], + loc: { + start: { column: 23, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + out: false, + + range: [179, 196], + loc: { + start: { column: 23, line: 5 }, + end: { column: 40, line: 5 }, + }, + }, + ], + + range: [168, 197], + loc: { + start: { column: 12, line: 5 }, + end: { column: 41, line: 5 }, + }, + }, + + range: [156, 202], + loc: { + start: { column: 0, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 203], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..85a5d22d8279 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,276 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-parameters-comments TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [76, 77], + loc: { + start: { column: 3, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [113, 114], + loc: { + start: { column: 40, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [115, 123], + loc: { + start: { column: 0, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [124, 127], + loc: { + start: { column: 9, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [127, 128], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [138, 139], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [149, 150], + loc: { + start: { column: 34, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [150, 151], + loc: { + start: { column: 35, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [151, 152], + loc: { + start: { column: 36, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [153, 154], + loc: { + start: { column: 38, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [154, 155], + loc: { + start: { column: 39, line: 4 }, + end: { column: 40, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [156, 164], + loc: { + start: { column: 0, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [165, 168], + loc: { + start: { column: 9, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [168, 169], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [179, 180], + loc: { + start: { column: 23, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [191, 192], + loc: { + start: { column: 35, line: 5 }, + end: { column: 36, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [193, 196], + loc: { + start: { column: 37, line: 5 }, + end: { column: 40, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [196, 197], + loc: { + start: { column: 40, line: 5 }, + end: { column: 41, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [197, 198], + loc: { + start: { column: 41, line: 5 }, + end: { column: 42, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [198, 199], + loc: { + start: { column: 42, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [200, 201], + loc: { + start: { column: 44, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [201, 202], + loc: { + start: { column: 45, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..e0dc1bc22df5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/3-Babel-AST.shot @@ -0,0 +1,203 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-parameters-comments Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "foo", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + optional: false, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + + range: [76, 111], + loc: { + start: { column: 3, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + + range: [73, 114], + loc: { + start: { column: 0, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [153, 155], + loc: { + start: { column: 38, line: 4 }, + end: { column: 40, line: 4 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "bar", + + range: [124, 127], + loc: { + start: { column: 9, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "A", + + range: [138, 139], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + ], + + range: [127, 150], + loc: { + start: { column: 12, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + + range: [115, 155], + loc: { + start: { column: 0, line: 4 }, + end: { column: 40, line: 4 }, + }, + }, + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [200, 202], + loc: { + start: { column: 44, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "baz", + + range: [165, 168], + loc: { + start: { column: 9, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + default: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Foo", + + range: [193, 196], + loc: { + start: { column: 37, line: 5 }, + end: { column: 40, line: 5 }, + }, + }, + + range: [193, 196], + loc: { + start: { column: 37, line: 5 }, + end: { column: 40, line: 5 }, + }, + }, + name: "A", + + range: [179, 196], + loc: { + start: { column: 23, line: 5 }, + end: { column: 40, line: 5 }, + }, + }, + ], + + range: [168, 197], + loc: { + start: { column: 12, line: 5 }, + end: { column: 41, line: 5 }, + }, + }, + + range: [156, 202], + loc: { + start: { column: 0, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 203], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..aa02bd259043 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,276 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-parameters-comments Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [76, 77], + loc: { + start: { column: 3, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [113, 114], + loc: { + start: { column: 40, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [115, 123], + loc: { + start: { column: 0, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [124, 127], + loc: { + start: { column: 9, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [127, 128], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [138, 139], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [149, 150], + loc: { + start: { column: 34, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [150, 151], + loc: { + start: { column: 35, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [151, 152], + loc: { + start: { column: 36, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [153, 154], + loc: { + start: { column: 38, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [154, 155], + loc: { + start: { column: 39, line: 4 }, + end: { column: 40, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [156, 164], + loc: { + start: { column: 0, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [165, 168], + loc: { + start: { column: 9, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [168, 169], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [179, 180], + loc: { + start: { column: 23, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [191, 192], + loc: { + start: { column: 35, line: 5 }, + end: { column: 36, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [193, 196], + loc: { + start: { column: 37, line: 5 }, + end: { column: 40, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [196, 197], + loc: { + start: { column: 40, line: 5 }, + end: { column: 41, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [197, 198], + loc: { + start: { column: 41, line: 5 }, + end: { column: 42, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [198, 199], + loc: { + start: { column: 42, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [200, 201], + loc: { + start: { column: 44, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [201, 202], + loc: { + start: { column: 45, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..ff26a6e29d7e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,231 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-parameters-comments AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExpressionStatement { + type: 'ExpressionStatement', + expression: CallExpression { + type: 'CallExpression', + arguments: Array [], + callee: Identifier { + type: 'Identifier', + name: 'foo', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + optional: false, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'A', + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + + range: [76, 111], + loc: { + start: { column: 3, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + + range: [73, 114], + loc: { + start: { column: 0, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + FunctionDeclaration { + type: 'FunctionDeclaration', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [153, 155], + loc: { + start: { column: 38, line: 4 }, + end: { column: 40, line: 4 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: 'Identifier', + name: 'bar', + + range: [124, 127], + loc: { + start: { column: 9, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'A', +- +- range: [138, 139], +- loc: { +- start: { column: 23, line: 4 }, +- end: { column: 24, line: 4 }, +- }, +- }, +- out: false, ++ name: 'A', + + range: [138, 139], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + ], + + range: [127, 150], + loc: { + start: { column: 12, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + + range: [115, 155], + loc: { + start: { column: 0, line: 4 }, + end: { column: 40, line: 4 }, + }, + }, + FunctionDeclaration { + type: 'FunctionDeclaration', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [200, 202], + loc: { + start: { column: 44, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: 'Identifier', + name: 'baz', + + range: [165, 168], + loc: { + start: { column: 9, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + default: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [193, 196], + loc: { + start: { column: 37, line: 5 }, + end: { column: 40, line: 5 }, + }, + }, + + range: [193, 196], + loc: { + start: { column: 37, line: 5 }, + end: { column: 40, line: 5 }, +- }, +- }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'A', +- +- range: [179, 180], +- loc: { +- start: { column: 23, line: 5 }, +- end: { column: 24, line: 5 }, + }, + }, +- out: false, ++ name: 'A', + + range: [179, 196], + loc: { + start: { column: 23, line: 5 }, + end: { column: 40, line: 5 }, + }, + }, + ], + + range: [168, 197], + loc: { + start: { column: 12, line: 5 }, + end: { column: 41, line: 5 }, + }, + }, + + range: [156, 202], + loc: { + start: { column: 0, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 203], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..f2bb12528fc0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-parameters-comments AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/fixture.ts new file mode 100644 index 000000000000..8dd6a789cd45 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class AudioBufferList { + mBuffers: interop.Reference; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..4535f1eaac49 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,138 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-reference-comments TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "mBuffers", + + range: [99, 107], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: TSQualifiedName { + type: "TSQualifiedName", + left: Identifier { + type: "Identifier", + name: "interop", + + range: [109, 116], + loc: { + start: { column: 12, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + right: Identifier { + type: "Identifier", + name: "Reference", + + range: [117, 126], + loc: { + start: { column: 20, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + + range: [109, 126], + loc: { + start: { column: 12, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSAnyKeyword { + type: "TSAnyKeyword", + + range: [127, 130], + loc: { + start: { column: 30, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + + range: [126, 147], + loc: { + start: { column: 29, line: 4 }, + end: { column: 50, line: 4 }, + }, + }, + + range: [109, 147], + loc: { + start: { column: 12, line: 4 }, + end: { column: 50, line: 4 }, + }, + }, + + range: [107, 147], + loc: { + start: { column: 10, line: 4 }, + end: { column: 50, line: 4 }, + }, + }, + value: null, + + range: [99, 148], + loc: { + start: { column: 2, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + ], + + range: [95, 150], + loc: { + start: { column: 22, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "AudioBufferList", + + range: [79, 94], + loc: { + start: { column: 6, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + superClass: null, + + range: [73, 150], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 151], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..15bf10705824 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-reference-comments TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "AudioBufferList", + + range: [79, 94], + loc: { + start: { column: 6, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "mBuffers", + + range: [99, 107], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [107, 108], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "interop", + + range: [109, 116], + loc: { + start: { column: 12, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [116, 117], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Reference", + + range: [117, 126], + loc: { + start: { column: 20, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [126, 127], + loc: { + start: { column: 29, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [127, 130], + loc: { + start: { column: 30, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [146, 147], + loc: { + start: { column: 49, line: 4 }, + end: { column: 50, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [147, 148], + loc: { + start: { column: 50, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [149, 150], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..4ff3ecad902c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/3-Babel-AST.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-reference-comments Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "mBuffers", + + range: [99, 107], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: TSQualifiedName { + type: "TSQualifiedName", + left: Identifier { + type: "Identifier", + name: "interop", + + range: [109, 116], + loc: { + start: { column: 12, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + right: Identifier { + type: "Identifier", + name: "Reference", + + range: [117, 126], + loc: { + start: { column: 20, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + + range: [109, 126], + loc: { + start: { column: 12, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSAnyKeyword { + type: "TSAnyKeyword", + + range: [127, 130], + loc: { + start: { column: 30, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + + range: [126, 147], + loc: { + start: { column: 29, line: 4 }, + end: { column: 50, line: 4 }, + }, + }, + + range: [109, 147], + loc: { + start: { column: 12, line: 4 }, + end: { column: 50, line: 4 }, + }, + }, + + range: [107, 147], + loc: { + start: { column: 10, line: 4 }, + end: { column: 50, line: 4 }, + }, + }, + value: null, + + range: [99, 148], + loc: { + start: { column: 2, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + ], + + range: [95, 150], + loc: { + start: { column: 22, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "AudioBufferList", + + range: [79, 94], + loc: { + start: { column: 6, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + superClass: null, + + range: [73, 150], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 151], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..8f97c54c997b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-reference-comments Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "AudioBufferList", + + range: [79, 94], + loc: { + start: { column: 6, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "mBuffers", + + range: [99, 107], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [107, 108], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "interop", + + range: [109, 116], + loc: { + start: { column: 12, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [116, 117], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Reference", + + range: [117, 126], + loc: { + start: { column: 20, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [126, 127], + loc: { + start: { column: 29, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [127, 130], + loc: { + start: { column: 30, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [146, 147], + loc: { + start: { column: 49, line: 4 }, + end: { column: 50, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [147, 148], + loc: { + start: { column: 50, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [149, 150], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..81d663d91cb1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,142 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-reference-comments AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'mBuffers', + + range: [99, 107], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: TSQualifiedName { + type: 'TSQualifiedName', + left: Identifier { + type: 'Identifier', + name: 'interop', + + range: [109, 116], + loc: { + start: { column: 12, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + right: Identifier { + type: 'Identifier', + name: 'Reference', + + range: [117, 126], + loc: { + start: { column: 20, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + + range: [109, 126], + loc: { + start: { column: 12, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSAnyKeyword { + type: 'TSAnyKeyword', + + range: [127, 130], + loc: { + start: { column: 30, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + + range: [126, 147], + loc: { + start: { column: 29, line: 4 }, + end: { column: 50, line: 4 }, + }, + }, + + range: [109, 147], + loc: { + start: { column: 12, line: 4 }, + end: { column: 50, line: 4 }, + }, + }, + + range: [107, 147], + loc: { + start: { column: 10, line: 4 }, + end: { column: 50, line: 4 }, + }, + }, + value: null, + + range: [99, 148], + loc: { + start: { column: 2, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + ], + + range: [95, 150], + loc: { + start: { column: 22, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'AudioBufferList', + + range: [79, 94], + loc: { + start: { column: 6, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + superClass: null, + + range: [73, 150], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 151], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..78f2619fea9c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics type-reference-comments AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/fixture.ts new file mode 100644 index 000000000000..6b061af4ca6c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Foo = bigint; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..7bc28435babc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-bigint TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSBigIntKeyword { + type: "TSBigIntKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..62c135a97417 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-bigint TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bigint", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..684ed5bb321e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/3-Babel-AST.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-bigint Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSBigIntKeyword { + type: "TSBigIntKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..7167e1e962f3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-bigint Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bigint", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..bba1fc6c6f9b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-bigint AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..63f9f159769e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-bigint AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/fixture.ts new file mode 100644 index 000000000000..4a00b9348959 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Foo = boolean; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..30579fe3323c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-boolean TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [84, 91], + loc: { + start: { column: 11, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..15a1c727b27d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-boolean TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [84, 91], + loc: { + start: { column: 11, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..79432c4fd65c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/3-Babel-AST.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-boolean Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [84, 91], + loc: { + start: { column: 11, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..1dce25ffa2d0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-boolean Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [84, 91], + loc: { + start: { column: 11, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..26e84868cf50 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-boolean AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..f46951508c22 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-boolean AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/fixture.ts new file mode 100644 index 000000000000..55ad1fa1674b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Foo = false; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..d00e785e0e3b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,55 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-false TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "false", + value: false, + + range: [84, 89], + loc: { + start: { column: 11, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [84, 89], + loc: { + start: { column: 11, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [73, 90], + loc: { + start: { column: 0, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..966b1788f0b2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-false TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Boolean { + type: "Boolean", + value: "false", + + range: [84, 89], + loc: { + start: { column: 11, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..c221936f8bea --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/3-Babel-AST.shot @@ -0,0 +1,55 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-false Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "false", + value: false, + + range: [84, 89], + loc: { + start: { column: 11, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [84, 89], + loc: { + start: { column: 11, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [73, 90], + loc: { + start: { column: 0, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..fc767cce196f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-false Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Boolean { + type: "Boolean", + value: "false", + + range: [84, 89], + loc: { + start: { column: 11, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..d96b38d76a7a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-false AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..3787058dfe68 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-false AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/fixture.ts new file mode 100644 index 000000000000..c423428fba92 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Foo = never; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..1dca9610fe69 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-never TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSNeverKeyword { + type: "TSNeverKeyword", + + range: [84, 89], + loc: { + start: { column: 11, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [73, 90], + loc: { + start: { column: 0, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..8281e828e1b5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-never TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "never", + + range: [84, 89], + loc: { + start: { column: 11, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..b4b968cc9380 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/3-Babel-AST.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-never Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSNeverKeyword { + type: "TSNeverKeyword", + + range: [84, 89], + loc: { + start: { column: 11, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [73, 90], + loc: { + start: { column: 0, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..0ffa9284236a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-never Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "never", + + range: [84, 89], + loc: { + start: { column: 11, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..c377742b9593 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-never AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..6a8549afebe3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-never AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/fixture.ts new file mode 100644 index 000000000000..8ee08e69555f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Foo = null; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..3e43912a3966 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-null TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSNullKeyword { + type: "TSNullKeyword", + + range: [84, 88], + loc: { + start: { column: 11, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [73, 89], + loc: { + start: { column: 0, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 90], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..f665e29d021c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-null TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "null", + + range: [84, 88], + loc: { + start: { column: 11, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..91b3de461651 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/3-Babel-AST.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-null Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSNullKeyword { + type: "TSNullKeyword", + + range: [84, 88], + loc: { + start: { column: 11, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [73, 89], + loc: { + start: { column: 0, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 90], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..6dc27bd4901b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-null Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Null { + type: "Null", + value: "null", + + range: [84, 88], + loc: { + start: { column: 11, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..fca6050d833f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-null AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..463ec874b0c9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,62 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-null AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Identifier { + type: 'Identifier', + value: 'type', + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Null { ++ type: 'Null', + value: 'null', + + range: [84, 88], + loc: { + start: { column: 11, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/fixture.ts new file mode 100644 index 000000000000..508db778af85 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Foo = number; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..cf951e399b78 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-number TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..c7428a8c585f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-number TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..7255ce74ca50 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/3-Babel-AST.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-number Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..c7a13e9bb9eb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-number Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..8eb6a37462b4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-number AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..cf5ac4859493 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-number AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/fixture.ts new file mode 100644 index 000000000000..05c1ed2c92cf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Foo = object; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..459a6185563e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-object TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSObjectKeyword { + type: "TSObjectKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..eb33bca3787d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-object TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "object", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..bdf585c2d684 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/3-Babel-AST.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-object Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSObjectKeyword { + type: "TSObjectKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..973bcb56dc86 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-object Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "object", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..1989928fcdf8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-object AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..7dc65f36dc5c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-object AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/fixture.ts new file mode 100644 index 000000000000..c13d0de27e26 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Foo = string; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..50520103c36d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-string TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..a60230128396 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-string TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..340cdd364a3c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/3-Babel-AST.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-string Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..3fa485fea125 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-string Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..5eca842524b8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-string AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..3b36f2678c2c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-string AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/fixture.ts new file mode 100644 index 000000000000..db4bb82b477d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Foo = symbol; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..d4bde83529c8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-symbol TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSSymbolKeyword { + type: "TSSymbolKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..af7541753f55 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-symbol TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "symbol", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..3e111c5fa3b5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/3-Babel-AST.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-symbol Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSSymbolKeyword { + type: "TSSymbolKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..35aa2a9387e0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-symbol Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "symbol", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..8b7dfb95fb31 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-symbol AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..744a7d3311ce --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-symbol AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/fixture.ts new file mode 100644 index 000000000000..27646ba0778b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Foo = true; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..671689fbe2c0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,55 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-true TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "true", + value: true, + + range: [84, 88], + loc: { + start: { column: 11, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [84, 88], + loc: { + start: { column: 11, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [73, 89], + loc: { + start: { column: 0, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 90], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..02df5e6b3da7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-true TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Boolean { + type: "Boolean", + value: "true", + + range: [84, 88], + loc: { + start: { column: 11, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..486420dfb440 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/3-Babel-AST.shot @@ -0,0 +1,55 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-true Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "true", + value: true, + + range: [84, 88], + loc: { + start: { column: 11, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [84, 88], + loc: { + start: { column: 11, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [73, 89], + loc: { + start: { column: 0, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 90], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..d04586d91904 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-true Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Boolean { + type: "Boolean", + value: "true", + + range: [84, 88], + loc: { + start: { column: 11, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..c25d16a9d1bd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-true AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..5ee38e099ba1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-true AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/fixture.ts new file mode 100644 index 000000000000..7da342dfa398 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Foo = undefined; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..cb70a31ba28d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-undefined TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSUndefinedKeyword { + type: "TSUndefinedKeyword", + + range: [84, 93], + loc: { + start: { column: 11, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..319eb8eca282 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-undefined TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "undefined", + + range: [84, 93], + loc: { + start: { column: 11, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..e4155864a8b1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/3-Babel-AST.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-undefined Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSUndefinedKeyword { + type: "TSUndefinedKeyword", + + range: [84, 93], + loc: { + start: { column: 11, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..32b144a05b85 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-undefined Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "undefined", + + range: [84, 93], + loc: { + start: { column: 11, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..6ed7dcc09d3f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-undefined AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..7597cbfe6a06 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-undefined AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/fixture.ts new file mode 100644 index 000000000000..f8e94adfb4d3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Foo = unknown; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..acc1dccfd233 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-unknown TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSUnknownKeyword { + type: "TSUnknownKeyword", + + range: [84, 91], + loc: { + start: { column: 11, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..8b482f251528 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-unknown TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "unknown", + + range: [84, 91], + loc: { + start: { column: 11, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..7966ec36f463 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/3-Babel-AST.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-unknown Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSUnknownKeyword { + type: "TSUnknownKeyword", + + range: [84, 91], + loc: { + start: { column: 11, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..dec5713f7035 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-unknown Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "unknown", + + range: [84, 91], + loc: { + start: { column: 11, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..a2c14932bd7e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-unknown AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..e3ac47b024e5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-unknown AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/fixture.ts new file mode 100644 index 000000000000..d525b75623e0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Foo = void; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..126b4f0beaa9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-void TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [84, 88], + loc: { + start: { column: 11, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [73, 89], + loc: { + start: { column: 0, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 90], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..a929b7b6950b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-void TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [84, 88], + loc: { + start: { column: 11, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..eedaa12aa430 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/3-Babel-AST.shot @@ -0,0 +1,44 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-void Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [84, 88], + loc: { + start: { column: 11, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [73, 89], + loc: { + start: { column: 0, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 90], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..b657ea11035e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-void Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [84, 88], + loc: { + start: { column: 11, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..8b70a69a9c15 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-void AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..442cd60a128f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-keyword-void AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/fixture.ts new file mode 100644 index 000000000000..ec23e07f59ce --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Foo = { + h(bar: string): void; + g(bar: T): T; +}; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..a1143b8b44c6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,236 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-method-signature TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "h", + + range: [88, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + kind: "method", + params: Array [ + Identifier { + type: "Identifier", + name: "bar", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [95, 101], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [93, 101], + loc: { + start: { column: 7, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [90, 101], + loc: { + start: { column: 4, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [104, 108], + loc: { + start: { column: 18, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [102, 108], + loc: { + start: { column: 16, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [88, 109], + loc: { + start: { column: 2, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "g", + + range: [112, 113], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + kind: "method", + params: Array [ + Identifier { + type: "Identifier", + name: "bar", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [122, 123], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [122, 123], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [120, 123], + loc: { + start: { column: 10, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [117, 123], + loc: { + start: { column: 7, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [126, 127], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [126, 127], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [124, 127], + loc: { + start: { column: 14, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [114, 115], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + out: false, + + range: [114, 115], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + ], + + range: [113, 116], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + + range: [112, 128], + loc: { + start: { column: 2, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + ], + + range: [84, 130], + loc: { + start: { column: 11, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + + range: [73, 131], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 132], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..ba9e81fac357 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,276 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-method-signature TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "h", + + range: [88, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [89, 90], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [90, 93], + loc: { + start: { column: 4, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [93, 94], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [95, 101], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [101, 102], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [104, 108], + loc: { + start: { column: 18, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [108, 109], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "g", + + range: [112, 113], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [113, 114], + loc: { + start: { column: 3, line: 5 }, + end: { column: 4, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [114, 115], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [115, 116], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [116, 117], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [117, 120], + loc: { + start: { column: 7, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [120, 121], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [122, 123], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [123, 124], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [124, 125], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [126, 127], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [127, 128], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [129, 130], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [130, 131], + loc: { + start: { column: 1, line: 6 }, + end: { column: 2, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..fc18c7b0d0c7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/3-Babel-AST.shot @@ -0,0 +1,225 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-method-signature Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "h", + + range: [88, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + kind: "method", + parameters: Array [ + Identifier { + type: "Identifier", + name: "bar", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [95, 101], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [93, 101], + loc: { + start: { column: 7, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [90, 101], + loc: { + start: { column: 4, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [104, 108], + loc: { + start: { column: 18, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [102, 108], + loc: { + start: { column: 16, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [88, 109], + loc: { + start: { column: 2, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "g", + + range: [112, 113], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + kind: "method", + parameters: Array [ + Identifier { + type: "Identifier", + name: "bar", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [122, 123], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [122, 123], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [120, 123], + loc: { + start: { column: 10, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [117, 123], + loc: { + start: { column: 7, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [126, 127], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [126, 127], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [124, 127], + loc: { + start: { column: 14, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [114, 115], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + ], + + range: [113, 116], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + + range: [112, 128], + loc: { + start: { column: 2, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + ], + + range: [84, 130], + loc: { + start: { column: 11, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + + range: [73, 131], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 132], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..f9d1e6905795 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,276 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-method-signature Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "h", + + range: [88, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [89, 90], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [90, 93], + loc: { + start: { column: 4, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [93, 94], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [95, 101], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [101, 102], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [104, 108], + loc: { + start: { column: 18, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [108, 109], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "g", + + range: [112, 113], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [113, 114], + loc: { + start: { column: 3, line: 5 }, + end: { column: 4, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [114, 115], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [115, 116], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [116, 117], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [117, 120], + loc: { + start: { column: 7, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [120, 121], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [122, 123], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [123, 124], + loc: { + start: { column: 13, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [124, 125], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [126, 127], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [127, 128], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [129, 130], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [130, 131], + loc: { + start: { column: 1, line: 6 }, + end: { column: 2, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..8d86878a9bce --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,245 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-method-signature AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: 'TSTypeLiteral', + members: Array [ + TSMethodSignature { + type: 'TSMethodSignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'h', + + range: [88, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + kind: 'method', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'bar', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [95, 101], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [93, 101], + loc: { + start: { column: 7, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [90, 101], + loc: { + start: { column: 4, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSVoidKeyword { + type: 'TSVoidKeyword', + + range: [104, 108], + loc: { + start: { column: 18, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [102, 108], + loc: { + start: { column: 16, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [88, 109], + loc: { + start: { column: 2, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + TSMethodSignature { + type: 'TSMethodSignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'g', + + range: [112, 113], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + kind: 'method', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'bar', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [122, 123], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [122, 123], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [120, 123], + loc: { + start: { column: 10, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + + range: [117, 123], + loc: { + start: { column: 7, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [126, 127], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [126, 127], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [124, 127], + loc: { + start: { column: 14, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [114, 115], +- loc: { +- start: { column: 4, line: 5 }, +- end: { column: 5, line: 5 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [114, 115], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + ], + + range: [113, 116], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + + range: [112, 128], + loc: { + start: { column: 2, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + ], + + range: [84, 130], + loc: { + start: { column: 11, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + + range: [73, 131], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 6 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 132], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..48935f574e92 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-method-signature AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/fixture.ts new file mode 100644 index 000000000000..b496947a62e0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface UIElement { + addClickListener(onclick: (this: void, e: Event) => void): void; +} diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..f3369540a940 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,201 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-this TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "addClickListener", + + range: [97, 113], + loc: { + start: { column: 2, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + kind: "method", + params: Array [ + Identifier { + type: "Identifier", + name: "onclick", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + params: Array [ + Identifier { + type: "Identifier", + name: "this", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [130, 134], + loc: { + start: { column: 35, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + + range: [128, 134], + loc: { + start: { column: 33, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + + range: [124, 134], + loc: { + start: { column: 29, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + name: "e", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Event", + + range: [139, 144], + loc: { + start: { column: 44, line: 4 }, + end: { column: 49, line: 4 }, + }, + }, + + range: [139, 144], + loc: { + start: { column: 44, line: 4 }, + end: { column: 49, line: 4 }, + }, + }, + + range: [137, 144], + loc: { + start: { column: 42, line: 4 }, + end: { column: 49, line: 4 }, + }, + }, + + range: [136, 144], + loc: { + start: { column: 41, line: 4 }, + end: { column: 49, line: 4 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [149, 153], + loc: { + start: { column: 54, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + + range: [146, 153], + loc: { + start: { column: 51, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + + range: [123, 153], + loc: { + start: { column: 28, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + + range: [121, 153], + loc: { + start: { column: 26, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + + range: [114, 153], + loc: { + start: { column: 19, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [156, 160], + loc: { + start: { column: 61, line: 4 }, + end: { column: 65, line: 4 }, + }, + }, + + range: [154, 160], + loc: { + start: { column: 59, line: 4 }, + end: { column: 65, line: 4 }, + }, + }, + + range: [97, 161], + loc: { + start: { column: 2, line: 4 }, + end: { column: 66, line: 4 }, + }, + }, + ], + + range: [93, 163], + loc: { + start: { column: 20, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "UIElement", + + range: [83, 92], + loc: { + start: { column: 10, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [73, 163], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 164], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..43748c69adf1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,236 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-this TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "UIElement", + + range: [83, 92], + loc: { + start: { column: 10, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "addClickListener", + + range: [97, 113], + loc: { + start: { column: 2, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [113, 114], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "onclick", + + range: [114, 121], + loc: { + start: { column: 19, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [121, 122], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [123, 124], + loc: { + start: { column: 28, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [124, 128], + loc: { + start: { column: 29, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [128, 129], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [130, 134], + loc: { + start: { column: 35, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [134, 135], + loc: { + start: { column: 39, line: 4 }, + end: { column: 40, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "e", + + range: [136, 137], + loc: { + start: { column: 41, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [137, 138], + loc: { + start: { column: 42, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Event", + + range: [139, 144], + loc: { + start: { column: 44, line: 4 }, + end: { column: 49, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [144, 145], + loc: { + start: { column: 49, line: 4 }, + end: { column: 50, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [146, 148], + loc: { + start: { column: 51, line: 4 }, + end: { column: 53, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [149, 153], + loc: { + start: { column: 54, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [153, 154], + loc: { + start: { column: 58, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [154, 155], + loc: { + start: { column: 59, line: 4 }, + end: { column: 60, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [156, 160], + loc: { + start: { column: 61, line: 4 }, + end: { column: 65, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [160, 161], + loc: { + start: { column: 65, line: 4 }, + end: { column: 66, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [162, 163], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..5a7a4c05de6a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/3-Babel-AST.shot @@ -0,0 +1,201 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-this Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "addClickListener", + + range: [97, 113], + loc: { + start: { column: 2, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + kind: "method", + parameters: Array [ + Identifier { + type: "Identifier", + name: "onclick", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + parameters: Array [ + Identifier { + type: "Identifier", + name: "this", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [130, 134], + loc: { + start: { column: 35, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + + range: [128, 134], + loc: { + start: { column: 33, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + + range: [124, 134], + loc: { + start: { column: 29, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + name: "e", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Event", + + range: [139, 144], + loc: { + start: { column: 44, line: 4 }, + end: { column: 49, line: 4 }, + }, + }, + + range: [139, 144], + loc: { + start: { column: 44, line: 4 }, + end: { column: 49, line: 4 }, + }, + }, + + range: [137, 144], + loc: { + start: { column: 42, line: 4 }, + end: { column: 49, line: 4 }, + }, + }, + + range: [136, 144], + loc: { + start: { column: 41, line: 4 }, + end: { column: 49, line: 4 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [149, 153], + loc: { + start: { column: 54, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + + range: [146, 153], + loc: { + start: { column: 51, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + + range: [123, 153], + loc: { + start: { column: 28, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + + range: [121, 153], + loc: { + start: { column: 26, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + + range: [114, 153], + loc: { + start: { column: 19, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [156, 160], + loc: { + start: { column: 61, line: 4 }, + end: { column: 65, line: 4 }, + }, + }, + + range: [154, 160], + loc: { + start: { column: 59, line: 4 }, + end: { column: 65, line: 4 }, + }, + }, + + range: [97, 161], + loc: { + start: { column: 2, line: 4 }, + end: { column: 66, line: 4 }, + }, + }, + ], + + range: [93, 163], + loc: { + start: { column: 20, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "UIElement", + + range: [83, 92], + loc: { + start: { column: 10, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [73, 163], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 164], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..b16f7d3d2169 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,236 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-this Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "UIElement", + + range: [83, 92], + loc: { + start: { column: 10, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "addClickListener", + + range: [97, 113], + loc: { + start: { column: 2, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [113, 114], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "onclick", + + range: [114, 121], + loc: { + start: { column: 19, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [121, 122], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [123, 124], + loc: { + start: { column: 28, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "this", + + range: [124, 128], + loc: { + start: { column: 29, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [128, 129], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [130, 134], + loc: { + start: { column: 35, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [134, 135], + loc: { + start: { column: 39, line: 4 }, + end: { column: 40, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "e", + + range: [136, 137], + loc: { + start: { column: 41, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [137, 138], + loc: { + start: { column: 42, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Event", + + range: [139, 144], + loc: { + start: { column: 44, line: 4 }, + end: { column: 49, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [144, 145], + loc: { + start: { column: 49, line: 4 }, + end: { column: 50, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [146, 148], + loc: { + start: { column: 51, line: 4 }, + end: { column: 53, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [149, 153], + loc: { + start: { column: 54, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [153, 154], + loc: { + start: { column: 58, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [154, 155], + loc: { + start: { column: 59, line: 4 }, + end: { column: 60, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [156, 160], + loc: { + start: { column: 61, line: 4 }, + end: { column: 65, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [160, 161], + loc: { + start: { column: 65, line: 4 }, + end: { column: 66, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [162, 163], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..6b66408fdf80 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,209 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-this AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [ + TSMethodSignature { + type: 'TSMethodSignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'addClickListener', + + range: [97, 113], + loc: { + start: { column: 2, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + kind: 'method', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'onclick', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSFunctionType { + type: 'TSFunctionType', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'this', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSVoidKeyword { + type: 'TSVoidKeyword', + + range: [130, 134], + loc: { + start: { column: 35, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + + range: [128, 134], + loc: { + start: { column: 33, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + + range: [124, 134], + loc: { + start: { column: 29, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + name: 'e', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'Event', + + range: [139, 144], + loc: { + start: { column: 44, line: 4 }, + end: { column: 49, line: 4 }, + }, + }, + + range: [139, 144], + loc: { + start: { column: 44, line: 4 }, + end: { column: 49, line: 4 }, + }, + }, + + range: [137, 144], + loc: { + start: { column: 42, line: 4 }, + end: { column: 49, line: 4 }, + }, + }, + + range: [136, 144], + loc: { + start: { column: 41, line: 4 }, + end: { column: 49, line: 4 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSVoidKeyword { + type: 'TSVoidKeyword', + + range: [149, 153], + loc: { + start: { column: 54, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + + range: [146, 153], + loc: { + start: { column: 51, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + + range: [123, 153], + loc: { + start: { column: 28, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + + range: [121, 153], + loc: { + start: { column: 26, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + + range: [114, 153], + loc: { + start: { column: 19, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSVoidKeyword { + type: 'TSVoidKeyword', + + range: [156, 160], + loc: { + start: { column: 61, line: 4 }, + end: { column: 65, line: 4 }, + }, + }, + + range: [154, 160], + loc: { + start: { column: 59, line: 4 }, + end: { column: 65, line: 4 }, + }, + }, + + range: [97, 161], + loc: { + start: { column: 2, line: 4 }, + end: { column: 66, line: 4 }, + }, + }, + ], + + range: [93, 163], + loc: { + start: { column: 20, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'UIElement', + + range: [83, 92], + loc: { + start: { column: 10, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [73, 163], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 164], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..35b998f489ab --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,244 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics typed-this AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'UIElement', + + range: [83, 92], + loc: { + start: { column: 10, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'addClickListener', + + range: [97, 113], + loc: { + start: { column: 2, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [113, 114], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'onclick', + + range: [114, 121], + loc: { + start: { column: 19, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [121, 122], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [123, 124], + loc: { + start: { column: 28, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'this', + + range: [124, 128], + loc: { + start: { column: 29, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [128, 129], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'void', + + range: [130, 134], + loc: { + start: { column: 35, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [134, 135], + loc: { + start: { column: 39, line: 4 }, + end: { column: 40, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'e', + + range: [136, 137], + loc: { + start: { column: 41, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [137, 138], + loc: { + start: { column: 42, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Event', + + range: [139, 144], + loc: { + start: { column: 44, line: 4 }, + end: { column: 49, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [144, 145], + loc: { + start: { column: 49, line: 4 }, + end: { column: 50, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=>', + + range: [146, 148], + loc: { + start: { column: 51, line: 4 }, + end: { column: 53, line: 4 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'void', + + range: [149, 153], + loc: { + start: { column: 54, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [153, 154], + loc: { + start: { column: 58, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [154, 155], + loc: { + start: { column: 59, line: 4 }, + end: { column: 60, line: 4 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'void', + + range: [156, 160], + loc: { + start: { column: 61, line: 4 }, + end: { column: 65, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [160, 161], + loc: { + start: { column: 65, line: 4 }, + end: { column: 66, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [162, 163], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/fixture.ts new file mode 100644 index 000000000000..9df2dffcf72e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/fixture.ts @@ -0,0 +1,11 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let union: number | null | undefined; +let intersection: number & string; +let precedence1: number | (string & boolean); +let precedence2: (number & string) | boolean; + +type unionLeading = number | string; +type intersectionLeading = number & string; +type unionLeadingSingle = number; +type intersectionLeadingSingle = number; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..25f8bed4a1df --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,497 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics union-intersection TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "union", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + TSNullKeyword { + type: "TSNullKeyword", + + range: [93, 97], + loc: { + start: { column: 20, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + TSUndefinedKeyword { + type: "TSUndefinedKeyword", + + range: [100, 109], + loc: { + start: { column: 27, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + + range: [84, 109], + loc: { + start: { column: 11, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [82, 109], + loc: { + start: { column: 9, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [77, 109], + loc: { + start: { column: 4, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + init: null, + + range: [77, 109], + loc: { + start: { column: 4, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "intersection", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSIntersectionType { + type: "TSIntersectionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [129, 135], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + TSStringKeyword { + type: "TSStringKeyword", + + range: [138, 144], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + + range: [129, 144], + loc: { + start: { column: 18, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [127, 144], + loc: { + start: { column: 16, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [115, 144], + loc: { + start: { column: 4, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + init: null, + + range: [115, 144], + loc: { + start: { column: 4, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + kind: "let", + + range: [111, 145], + loc: { + start: { column: 0, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "precedence1", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [163, 169], + loc: { + start: { column: 17, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + TSIntersectionType { + type: "TSIntersectionType", + types: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [173, 179], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [182, 189], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + ], + + range: [173, 189], + loc: { + start: { column: 27, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + ], + + range: [163, 190], + loc: { + start: { column: 17, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + + range: [161, 190], + loc: { + start: { column: 15, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + + range: [150, 190], + loc: { + start: { column: 4, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + init: null, + + range: [150, 190], + loc: { + start: { column: 4, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + ], + kind: "let", + + range: [146, 191], + loc: { + start: { column: 0, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "precedence2", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSIntersectionType { + type: "TSIntersectionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [210, 216], + loc: { + start: { column: 18, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + TSStringKeyword { + type: "TSStringKeyword", + + range: [219, 225], + loc: { + start: { column: 27, line: 6 }, + end: { column: 33, line: 6 }, + }, + }, + ], + + range: [210, 225], + loc: { + start: { column: 18, line: 6 }, + end: { column: 33, line: 6 }, + }, + }, + TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [229, 236], + loc: { + start: { column: 37, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + ], + + range: [209, 236], + loc: { + start: { column: 17, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + + range: [207, 236], + loc: { + start: { column: 15, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + + range: [196, 236], + loc: { + start: { column: 4, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + init: null, + + range: [196, 236], + loc: { + start: { column: 4, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + ], + kind: "let", + + range: [192, 237], + loc: { + start: { column: 0, line: 6 }, + end: { column: 45, line: 6 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "unionLeading", + + range: [244, 256], + loc: { + start: { column: 5, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [259, 265], + loc: { + start: { column: 20, line: 8 }, + end: { column: 26, line: 8 }, + }, + }, + TSStringKeyword { + type: "TSStringKeyword", + + range: [268, 274], + loc: { + start: { column: 29, line: 8 }, + end: { column: 35, line: 8 }, + }, + }, + ], + + range: [259, 274], + loc: { + start: { column: 20, line: 8 }, + end: { column: 35, line: 8 }, + }, + }, + + range: [239, 275], + loc: { + start: { column: 0, line: 8 }, + end: { column: 36, line: 8 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "intersectionLeading", + + range: [281, 300], + loc: { + start: { column: 5, line: 9 }, + end: { column: 24, line: 9 }, + }, + }, + typeAnnotation: TSIntersectionType { + type: "TSIntersectionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [303, 309], + loc: { + start: { column: 27, line: 9 }, + end: { column: 33, line: 9 }, + }, + }, + TSStringKeyword { + type: "TSStringKeyword", + + range: [312, 318], + loc: { + start: { column: 36, line: 9 }, + end: { column: 42, line: 9 }, + }, + }, + ], + + range: [303, 318], + loc: { + start: { column: 27, line: 9 }, + end: { column: 42, line: 9 }, + }, + }, + + range: [276, 319], + loc: { + start: { column: 0, line: 9 }, + end: { column: 43, line: 9 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "unionLeadingSingle", + + range: [325, 343], + loc: { + start: { column: 5, line: 10 }, + end: { column: 23, line: 10 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [346, 352], + loc: { + start: { column: 26, line: 10 }, + end: { column: 32, line: 10 }, + }, + }, + + range: [320, 353], + loc: { + start: { column: 0, line: 10 }, + end: { column: 33, line: 10 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "intersectionLeadingSingle", + + range: [359, 384], + loc: { + start: { column: 5, line: 11 }, + end: { column: 30, line: 11 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [387, 393], + loc: { + start: { column: 33, line: 11 }, + end: { column: 39, line: 11 }, + }, + }, + + range: [354, 394], + loc: { + start: { column: 0, line: 11 }, + end: { column: 40, line: 11 }, + }, + }, + ], + sourceType: "script", + + range: [73, 395], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 12 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..7755619a8101 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,626 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics union-intersection TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "union", + + range: [77, 82], + loc: { + start: { column: 4, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "null", + + range: [93, 97], + loc: { + start: { column: 20, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "undefined", + + range: [100, 109], + loc: { + start: { column: 27, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "let", + + range: [111, 114], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "intersection", + + range: [115, 127], + loc: { + start: { column: 4, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [127, 128], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [129, 135], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&", + + range: [136, 137], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [138, 144], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [144, 145], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "let", + + range: [146, 149], + loc: { + start: { column: 0, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "precedence1", + + range: [150, 161], + loc: { + start: { column: 4, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [161, 162], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [163, 169], + loc: { + start: { column: 17, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [170, 171], + loc: { + start: { column: 24, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [172, 173], + loc: { + start: { column: 26, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [173, 179], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&", + + range: [180, 181], + loc: { + start: { column: 34, line: 5 }, + end: { column: 35, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [182, 189], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [189, 190], + loc: { + start: { column: 43, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [190, 191], + loc: { + start: { column: 44, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "let", + + range: [192, 195], + loc: { + start: { column: 0, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "precedence2", + + range: [196, 207], + loc: { + start: { column: 4, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [207, 208], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [209, 210], + loc: { + start: { column: 17, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [210, 216], + loc: { + start: { column: 18, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&", + + range: [217, 218], + loc: { + start: { column: 25, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [219, 225], + loc: { + start: { column: 27, line: 6 }, + end: { column: 33, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [225, 226], + loc: { + start: { column: 33, line: 6 }, + end: { column: 34, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [227, 228], + loc: { + start: { column: 35, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [229, 236], + loc: { + start: { column: 37, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [236, 237], + loc: { + start: { column: 44, line: 6 }, + end: { column: 45, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [239, 243], + loc: { + start: { column: 0, line: 8 }, + end: { column: 4, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "unionLeading", + + range: [244, 256], + loc: { + start: { column: 5, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [257, 258], + loc: { + start: { column: 18, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [259, 265], + loc: { + start: { column: 20, line: 8 }, + end: { column: 26, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [266, 267], + loc: { + start: { column: 27, line: 8 }, + end: { column: 28, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [268, 274], + loc: { + start: { column: 29, line: 8 }, + end: { column: 35, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [274, 275], + loc: { + start: { column: 35, line: 8 }, + end: { column: 36, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [276, 280], + loc: { + start: { column: 0, line: 9 }, + end: { column: 4, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "intersectionLeading", + + range: [281, 300], + loc: { + start: { column: 5, line: 9 }, + end: { column: 24, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [301, 302], + loc: { + start: { column: 25, line: 9 }, + end: { column: 26, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [303, 309], + loc: { + start: { column: 27, line: 9 }, + end: { column: 33, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&", + + range: [310, 311], + loc: { + start: { column: 34, line: 9 }, + end: { column: 35, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [312, 318], + loc: { + start: { column: 36, line: 9 }, + end: { column: 42, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [318, 319], + loc: { + start: { column: 42, line: 9 }, + end: { column: 43, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [320, 324], + loc: { + start: { column: 0, line: 10 }, + end: { column: 4, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "unionLeadingSingle", + + range: [325, 343], + loc: { + start: { column: 5, line: 10 }, + end: { column: 23, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [344, 345], + loc: { + start: { column: 24, line: 10 }, + end: { column: 25, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [346, 352], + loc: { + start: { column: 26, line: 10 }, + end: { column: 32, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [352, 353], + loc: { + start: { column: 32, line: 10 }, + end: { column: 33, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [354, 358], + loc: { + start: { column: 0, line: 11 }, + end: { column: 4, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "intersectionLeadingSingle", + + range: [359, 384], + loc: { + start: { column: 5, line: 11 }, + end: { column: 30, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [385, 386], + loc: { + start: { column: 31, line: 11 }, + end: { column: 32, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [387, 393], + loc: { + start: { column: 33, line: 11 }, + end: { column: 39, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [393, 394], + loc: { + start: { column: 39, line: 11 }, + end: { column: 40, line: 11 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..a616b3256e3a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/3-Babel-AST.shot @@ -0,0 +1,515 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics union-intersection Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "union", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + TSNullKeyword { + type: "TSNullKeyword", + + range: [93, 97], + loc: { + start: { column: 20, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + TSUndefinedKeyword { + type: "TSUndefinedKeyword", + + range: [100, 109], + loc: { + start: { column: 27, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + + range: [84, 109], + loc: { + start: { column: 11, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [82, 109], + loc: { + start: { column: 9, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [77, 109], + loc: { + start: { column: 4, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + init: null, + + range: [77, 109], + loc: { + start: { column: 4, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "intersection", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSIntersectionType { + type: "TSIntersectionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [129, 135], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + TSStringKeyword { + type: "TSStringKeyword", + + range: [138, 144], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + + range: [129, 144], + loc: { + start: { column: 18, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [127, 144], + loc: { + start: { column: 16, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [115, 144], + loc: { + start: { column: 4, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + init: null, + + range: [115, 144], + loc: { + start: { column: 4, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + kind: "let", + + range: [111, 145], + loc: { + start: { column: 0, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "precedence1", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [163, 169], + loc: { + start: { column: 17, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + TSParenthesizedType { + type: "TSParenthesizedType", + typeAnnotation: TSIntersectionType { + type: "TSIntersectionType", + types: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [173, 179], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [182, 189], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + ], + + range: [173, 189], + loc: { + start: { column: 27, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + + range: [172, 190], + loc: { + start: { column: 26, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + ], + + range: [163, 190], + loc: { + start: { column: 17, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + + range: [161, 190], + loc: { + start: { column: 15, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + + range: [150, 190], + loc: { + start: { column: 4, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + init: null, + + range: [150, 190], + loc: { + start: { column: 4, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + ], + kind: "let", + + range: [146, 191], + loc: { + start: { column: 0, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "precedence2", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSParenthesizedType { + type: "TSParenthesizedType", + typeAnnotation: TSIntersectionType { + type: "TSIntersectionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [210, 216], + loc: { + start: { column: 18, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + TSStringKeyword { + type: "TSStringKeyword", + + range: [219, 225], + loc: { + start: { column: 27, line: 6 }, + end: { column: 33, line: 6 }, + }, + }, + ], + + range: [210, 225], + loc: { + start: { column: 18, line: 6 }, + end: { column: 33, line: 6 }, + }, + }, + + range: [209, 226], + loc: { + start: { column: 17, line: 6 }, + end: { column: 34, line: 6 }, + }, + }, + TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [229, 236], + loc: { + start: { column: 37, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + ], + + range: [209, 236], + loc: { + start: { column: 17, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + + range: [207, 236], + loc: { + start: { column: 15, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + + range: [196, 236], + loc: { + start: { column: 4, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + init: null, + + range: [196, 236], + loc: { + start: { column: 4, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + ], + kind: "let", + + range: [192, 237], + loc: { + start: { column: 0, line: 6 }, + end: { column: 45, line: 6 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "unionLeading", + + range: [244, 256], + loc: { + start: { column: 5, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [259, 265], + loc: { + start: { column: 20, line: 8 }, + end: { column: 26, line: 8 }, + }, + }, + TSStringKeyword { + type: "TSStringKeyword", + + range: [268, 274], + loc: { + start: { column: 29, line: 8 }, + end: { column: 35, line: 8 }, + }, + }, + ], + + range: [259, 274], + loc: { + start: { column: 20, line: 8 }, + end: { column: 35, line: 8 }, + }, + }, + + range: [239, 275], + loc: { + start: { column: 0, line: 8 }, + end: { column: 36, line: 8 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "intersectionLeading", + + range: [281, 300], + loc: { + start: { column: 5, line: 9 }, + end: { column: 24, line: 9 }, + }, + }, + typeAnnotation: TSIntersectionType { + type: "TSIntersectionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [303, 309], + loc: { + start: { column: 27, line: 9 }, + end: { column: 33, line: 9 }, + }, + }, + TSStringKeyword { + type: "TSStringKeyword", + + range: [312, 318], + loc: { + start: { column: 36, line: 9 }, + end: { column: 42, line: 9 }, + }, + }, + ], + + range: [303, 318], + loc: { + start: { column: 27, line: 9 }, + end: { column: 42, line: 9 }, + }, + }, + + range: [276, 319], + loc: { + start: { column: 0, line: 9 }, + end: { column: 43, line: 9 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "unionLeadingSingle", + + range: [325, 343], + loc: { + start: { column: 5, line: 10 }, + end: { column: 23, line: 10 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [346, 352], + loc: { + start: { column: 26, line: 10 }, + end: { column: 32, line: 10 }, + }, + }, + + range: [320, 353], + loc: { + start: { column: 0, line: 10 }, + end: { column: 33, line: 10 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "intersectionLeadingSingle", + + range: [359, 384], + loc: { + start: { column: 5, line: 11 }, + end: { column: 30, line: 11 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [387, 393], + loc: { + start: { column: 33, line: 11 }, + end: { column: 39, line: 11 }, + }, + }, + + range: [354, 394], + loc: { + start: { column: 0, line: 11 }, + end: { column: 40, line: 11 }, + }, + }, + ], + sourceType: "script", + + range: [73, 395], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 12 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..bcf747282beb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,626 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics union-intersection Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "union", + + range: [77, 82], + loc: { + start: { column: 4, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Null { + type: "Null", + value: "null", + + range: [93, 97], + loc: { + start: { column: 20, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "undefined", + + range: [100, 109], + loc: { + start: { column: 27, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "let", + + range: [111, 114], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "intersection", + + range: [115, 127], + loc: { + start: { column: 4, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [127, 128], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [129, 135], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&", + + range: [136, 137], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [138, 144], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [144, 145], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "let", + + range: [146, 149], + loc: { + start: { column: 0, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "precedence1", + + range: [150, 161], + loc: { + start: { column: 4, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [161, 162], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [163, 169], + loc: { + start: { column: 17, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [170, 171], + loc: { + start: { column: 24, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [172, 173], + loc: { + start: { column: 26, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [173, 179], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&", + + range: [180, 181], + loc: { + start: { column: 34, line: 5 }, + end: { column: 35, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [182, 189], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [189, 190], + loc: { + start: { column: 43, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [190, 191], + loc: { + start: { column: 44, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "let", + + range: [192, 195], + loc: { + start: { column: 0, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "precedence2", + + range: [196, 207], + loc: { + start: { column: 4, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [207, 208], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [209, 210], + loc: { + start: { column: 17, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [210, 216], + loc: { + start: { column: 18, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&", + + range: [217, 218], + loc: { + start: { column: 25, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [219, 225], + loc: { + start: { column: 27, line: 6 }, + end: { column: 33, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [225, 226], + loc: { + start: { column: 33, line: 6 }, + end: { column: 34, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [227, 228], + loc: { + start: { column: 35, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [229, 236], + loc: { + start: { column: 37, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [236, 237], + loc: { + start: { column: 44, line: 6 }, + end: { column: 45, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [239, 243], + loc: { + start: { column: 0, line: 8 }, + end: { column: 4, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "unionLeading", + + range: [244, 256], + loc: { + start: { column: 5, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [257, 258], + loc: { + start: { column: 18, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [259, 265], + loc: { + start: { column: 20, line: 8 }, + end: { column: 26, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [266, 267], + loc: { + start: { column: 27, line: 8 }, + end: { column: 28, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [268, 274], + loc: { + start: { column: 29, line: 8 }, + end: { column: 35, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [274, 275], + loc: { + start: { column: 35, line: 8 }, + end: { column: 36, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [276, 280], + loc: { + start: { column: 0, line: 9 }, + end: { column: 4, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "intersectionLeading", + + range: [281, 300], + loc: { + start: { column: 5, line: 9 }, + end: { column: 24, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [301, 302], + loc: { + start: { column: 25, line: 9 }, + end: { column: 26, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [303, 309], + loc: { + start: { column: 27, line: 9 }, + end: { column: 33, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&", + + range: [310, 311], + loc: { + start: { column: 34, line: 9 }, + end: { column: 35, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [312, 318], + loc: { + start: { column: 36, line: 9 }, + end: { column: 42, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [318, 319], + loc: { + start: { column: 42, line: 9 }, + end: { column: 43, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [320, 324], + loc: { + start: { column: 0, line: 10 }, + end: { column: 4, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "unionLeadingSingle", + + range: [325, 343], + loc: { + start: { column: 5, line: 10 }, + end: { column: 23, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [344, 345], + loc: { + start: { column: 24, line: 10 }, + end: { column: 25, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [346, 352], + loc: { + start: { column: 26, line: 10 }, + end: { column: 32, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [352, 353], + loc: { + start: { column: 32, line: 10 }, + end: { column: 33, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [354, 358], + loc: { + start: { column: 0, line: 11 }, + end: { column: 4, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "intersectionLeadingSingle", + + range: [359, 384], + loc: { + start: { column: 5, line: 11 }, + end: { column: 30, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [385, 386], + loc: { + start: { column: 31, line: 11 }, + end: { column: 32, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [387, 393], + loc: { + start: { column: 33, line: 11 }, + end: { column: 39, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [393, 394], + loc: { + start: { column: 39, line: 11 }, + end: { column: 40, line: 11 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..003d20be4436 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,559 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics union-intersection AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'union', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSUnionType { + type: 'TSUnionType', + types: Array [ + TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + TSNullKeyword { + type: 'TSNullKeyword', + + range: [93, 97], + loc: { + start: { column: 20, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + TSUndefinedKeyword { + type: 'TSUndefinedKeyword', + + range: [100, 109], + loc: { + start: { column: 27, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + + range: [84, 109], + loc: { + start: { column: 11, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [82, 109], + loc: { + start: { column: 9, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [77, 109], + loc: { + start: { column: 4, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + init: null, + + range: [77, 109], + loc: { + start: { column: 4, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + kind: 'let', + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'intersection', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSIntersectionType { + type: 'TSIntersectionType', + types: Array [ + TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [129, 135], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + TSStringKeyword { + type: 'TSStringKeyword', + + range: [138, 144], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + + range: [129, 144], + loc: { + start: { column: 18, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [127, 144], + loc: { + start: { column: 16, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [115, 144], + loc: { + start: { column: 4, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + init: null, + + range: [115, 144], + loc: { + start: { column: 4, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + kind: 'let', + + range: [111, 145], + loc: { + start: { column: 0, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'precedence1', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSUnionType { + type: 'TSUnionType', + types: Array [ + TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [163, 169], + loc: { + start: { column: 17, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, +- TSIntersectionType { +- type: 'TSIntersectionType', +- types: Array [ +- TSStringKeyword { +- type: 'TSStringKeyword', ++ TSParenthesizedType { ++ type: 'TSParenthesizedType', ++ typeAnnotation: TSIntersectionType { ++ type: 'TSIntersectionType', ++ types: Array [ ++ TSStringKeyword { ++ type: 'TSStringKeyword', + +- range: [173, 179], +- loc: { +- start: { column: 27, line: 5 }, +- end: { column: 33, line: 5 }, ++ range: [173, 179], ++ loc: { ++ start: { column: 27, line: 5 }, ++ end: { column: 33, line: 5 }, ++ }, + }, +- }, +- TSBooleanKeyword { +- type: 'TSBooleanKeyword', ++ TSBooleanKeyword { ++ type: 'TSBooleanKeyword', + +- range: [182, 189], +- loc: { +- start: { column: 36, line: 5 }, +- end: { column: 43, line: 5 }, ++ range: [182, 189], ++ loc: { ++ start: { column: 36, line: 5 }, ++ end: { column: 43, line: 5 }, ++ }, + }, ++ ], ++ ++ range: [173, 189], ++ loc: { ++ start: { column: 27, line: 5 }, ++ end: { column: 43, line: 5 }, + }, +- ], ++ }, + +- range: [173, 189], ++ range: [172, 190], + loc: { +- start: { column: 27, line: 5 }, +- end: { column: 43, line: 5 }, ++ start: { column: 26, line: 5 }, ++ end: { column: 44, line: 5 }, + }, + }, + ], + + range: [163, 190], + loc: { + start: { column: 17, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + + range: [161, 190], + loc: { + start: { column: 15, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + + range: [150, 190], + loc: { + start: { column: 4, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + init: null, + + range: [150, 190], + loc: { + start: { column: 4, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + ], + kind: 'let', + + range: [146, 191], + loc: { + start: { column: 0, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'precedence2', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSUnionType { + type: 'TSUnionType', + types: Array [ +- TSIntersectionType { +- type: 'TSIntersectionType', +- types: Array [ +- TSNumberKeyword { +- type: 'TSNumberKeyword', ++ TSParenthesizedType { ++ type: 'TSParenthesizedType', ++ typeAnnotation: TSIntersectionType { ++ type: 'TSIntersectionType', ++ types: Array [ ++ TSNumberKeyword { ++ type: 'TSNumberKeyword', + +- range: [210, 216], +- loc: { +- start: { column: 18, line: 6 }, +- end: { column: 24, line: 6 }, ++ range: [210, 216], ++ loc: { ++ start: { column: 18, line: 6 }, ++ end: { column: 24, line: 6 }, ++ }, + }, +- }, +- TSStringKeyword { +- type: 'TSStringKeyword', ++ TSStringKeyword { ++ type: 'TSStringKeyword', + +- range: [219, 225], +- loc: { +- start: { column: 27, line: 6 }, +- end: { column: 33, line: 6 }, ++ range: [219, 225], ++ loc: { ++ start: { column: 27, line: 6 }, ++ end: { column: 33, line: 6 }, ++ }, + }, ++ ], ++ ++ range: [210, 225], ++ loc: { ++ start: { column: 18, line: 6 }, ++ end: { column: 33, line: 6 }, + }, +- ], ++ }, + +- range: [210, 225], ++ range: [209, 226], + loc: { +- start: { column: 18, line: 6 }, +- end: { column: 33, line: 6 }, ++ start: { column: 17, line: 6 }, ++ end: { column: 34, line: 6 }, + }, + }, + TSBooleanKeyword { + type: 'TSBooleanKeyword', + + range: [229, 236], + loc: { + start: { column: 37, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + ], + + range: [209, 236], + loc: { + start: { column: 17, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + + range: [207, 236], + loc: { + start: { column: 15, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + + range: [196, 236], + loc: { + start: { column: 4, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + init: null, + + range: [196, 236], + loc: { + start: { column: 4, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + ], + kind: 'let', + + range: [192, 237], + loc: { + start: { column: 0, line: 6 }, + end: { column: 45, line: 6 }, + }, + }, + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'unionLeading', + + range: [244, 256], + loc: { + start: { column: 5, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + typeAnnotation: TSUnionType { + type: 'TSUnionType', + types: Array [ + TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [259, 265], + loc: { + start: { column: 20, line: 8 }, + end: { column: 26, line: 8 }, + }, + }, + TSStringKeyword { + type: 'TSStringKeyword', + + range: [268, 274], + loc: { + start: { column: 29, line: 8 }, + end: { column: 35, line: 8 }, + }, + }, + ], + + range: [259, 274], + loc: { + start: { column: 20, line: 8 }, + end: { column: 35, line: 8 }, + }, + }, + + range: [239, 275], + loc: { + start: { column: 0, line: 8 }, + end: { column: 36, line: 8 }, + }, + }, + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'intersectionLeading', + + range: [281, 300], + loc: { + start: { column: 5, line: 9 }, + end: { column: 24, line: 9 }, + }, + }, + typeAnnotation: TSIntersectionType { + type: 'TSIntersectionType', + types: Array [ + TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [303, 309], + loc: { + start: { column: 27, line: 9 }, + end: { column: 33, line: 9 }, + }, + }, + TSStringKeyword { + type: 'TSStringKeyword', + + range: [312, 318], + loc: { + start: { column: 36, line: 9 }, + end: { column: 42, line: 9 }, + }, + }, + ], + + range: [303, 318], + loc: { + start: { column: 27, line: 9 }, + end: { column: 42, line: 9 }, + }, + }, + + range: [276, 319], + loc: { + start: { column: 0, line: 9 }, + end: { column: 43, line: 9 }, + }, + }, + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'unionLeadingSingle', + + range: [325, 343], + loc: { + start: { column: 5, line: 10 }, + end: { column: 23, line: 10 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [346, 352], + loc: { + start: { column: 26, line: 10 }, + end: { column: 32, line: 10 }, + }, + }, + + range: [320, 353], + loc: { + start: { column: 0, line: 10 }, + end: { column: 33, line: 10 }, + }, + }, + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'intersectionLeadingSingle', + + range: [359, 384], + loc: { + start: { column: 5, line: 11 }, + end: { column: 30, line: 11 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [387, 393], + loc: { + start: { column: 33, line: 11 }, + end: { column: 39, line: 11 }, + }, + }, + + range: [354, 394], + loc: { + start: { column: 0, line: 11 }, + end: { column: 40, line: 11 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 395], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 12 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..4b3a1a8acca1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,640 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics union-intersection AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'union', + + range: [77, 82], + loc: { + start: { column: 4, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '|', + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Null { ++ type: 'Null', + value: 'null', + + range: [93, 97], + loc: { + start: { column: 20, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '|', + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'undefined', + + range: [100, 109], + loc: { + start: { column: 27, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [111, 114], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'intersection', + + range: [115, 127], + loc: { + start: { column: 4, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [127, 128], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [129, 135], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '&', + + range: [136, 137], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [138, 144], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [144, 145], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [146, 149], + loc: { + start: { column: 0, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'precedence1', + + range: [150, 161], + loc: { + start: { column: 4, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [161, 162], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [163, 169], + loc: { + start: { column: 17, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '|', + + range: [170, 171], + loc: { + start: { column: 24, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [172, 173], + loc: { + start: { column: 26, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [173, 179], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '&', + + range: [180, 181], + loc: { + start: { column: 34, line: 5 }, + end: { column: 35, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'boolean', + + range: [182, 189], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [189, 190], + loc: { + start: { column: 43, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [190, 191], + loc: { + start: { column: 44, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [192, 195], + loc: { + start: { column: 0, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'precedence2', + + range: [196, 207], + loc: { + start: { column: 4, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [207, 208], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [209, 210], + loc: { + start: { column: 17, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [210, 216], + loc: { + start: { column: 18, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '&', + + range: [217, 218], + loc: { + start: { column: 25, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [219, 225], + loc: { + start: { column: 27, line: 6 }, + end: { column: 33, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [225, 226], + loc: { + start: { column: 33, line: 6 }, + end: { column: 34, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '|', + + range: [227, 228], + loc: { + start: { column: 35, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'boolean', + + range: [229, 236], + loc: { + start: { column: 37, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [236, 237], + loc: { + start: { column: 44, line: 6 }, + end: { column: 45, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'type', + + range: [239, 243], + loc: { + start: { column: 0, line: 8 }, + end: { column: 4, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'unionLeading', + + range: [244, 256], + loc: { + start: { column: 5, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [257, 258], + loc: { + start: { column: 18, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [259, 265], + loc: { + start: { column: 20, line: 8 }, + end: { column: 26, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '|', + + range: [266, 267], + loc: { + start: { column: 27, line: 8 }, + end: { column: 28, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [268, 274], + loc: { + start: { column: 29, line: 8 }, + end: { column: 35, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [274, 275], + loc: { + start: { column: 35, line: 8 }, + end: { column: 36, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'type', + + range: [276, 280], + loc: { + start: { column: 0, line: 9 }, + end: { column: 4, line: 9 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'intersectionLeading', + + range: [281, 300], + loc: { + start: { column: 5, line: 9 }, + end: { column: 24, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [301, 302], + loc: { + start: { column: 25, line: 9 }, + end: { column: 26, line: 9 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [303, 309], + loc: { + start: { column: 27, line: 9 }, + end: { column: 33, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '&', + + range: [310, 311], + loc: { + start: { column: 34, line: 9 }, + end: { column: 35, line: 9 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [312, 318], + loc: { + start: { column: 36, line: 9 }, + end: { column: 42, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [318, 319], + loc: { + start: { column: 42, line: 9 }, + end: { column: 43, line: 9 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'type', + + range: [320, 324], + loc: { + start: { column: 0, line: 10 }, + end: { column: 4, line: 10 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'unionLeadingSingle', + + range: [325, 343], + loc: { + start: { column: 5, line: 10 }, + end: { column: 23, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [344, 345], + loc: { + start: { column: 24, line: 10 }, + end: { column: 25, line: 10 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [346, 352], + loc: { + start: { column: 26, line: 10 }, + end: { column: 32, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [352, 353], + loc: { + start: { column: 32, line: 10 }, + end: { column: 33, line: 10 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'type', + + range: [354, 358], + loc: { + start: { column: 0, line: 11 }, + end: { column: 4, line: 11 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'intersectionLeadingSingle', + + range: [359, 384], + loc: { + start: { column: 5, line: 11 }, + end: { column: 30, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [385, 386], + loc: { + start: { column: 31, line: 11 }, + end: { column: 32, line: 11 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [387, 393], + loc: { + start: { column: 33, line: 11 }, + end: { column: 39, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [393, 394], + loc: { + start: { column: 39, line: 11 }, + end: { column: 40, line: 11 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/fixture.ts new file mode 100644 index 000000000000..f50e8caea146 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type A = unique symbol; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..82249db517a5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,54 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics unique-symbol TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "A", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + typeAnnotation: TSTypeOperator { + type: "TSTypeOperator", + operator: "unique", + typeAnnotation: TSSymbolKeyword { + type: "TSSymbolKeyword", + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [82, 95], + loc: { + start: { column: 9, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [73, 96], + loc: { + start: { column: 0, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 97], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..f62b62a54037 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics unique-symbol TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "unique", + + range: [82, 88], + loc: { + start: { column: 9, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "symbol", + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..a145f3baee5c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/3-Babel-AST.shot @@ -0,0 +1,54 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics unique-symbol Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "A", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + typeAnnotation: TSTypeOperator { + type: "TSTypeOperator", + operator: "unique", + typeAnnotation: TSSymbolKeyword { + type: "TSSymbolKeyword", + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [82, 95], + loc: { + start: { column: 9, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [73, 96], + loc: { + start: { column: 0, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 97], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..acbb7c42e9d6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics unique-symbol Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "unique", + + range: [82, 88], + loc: { + start: { column: 9, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "symbol", + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..624e3a6347f3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics unique-symbol AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..9525ed09b905 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics unique-symbol AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/fixture.ts new file mode 100644 index 000000000000..5455c88fbf1c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let foo: unknown; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..943a5122c5bb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics unknown-type-annotation TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "foo", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnknownKeyword { + type: "TSUnknownKeyword", + + range: [82, 89], + loc: { + start: { column: 9, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [80, 89], + loc: { + start: { column: 7, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [77, 89], + loc: { + start: { column: 4, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + init: null, + + range: [77, 89], + loc: { + start: { column: 4, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 90], + loc: { + start: { column: 0, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..b84da4d86abb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics unknown-type-annotation TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "unknown", + + range: [82, 89], + loc: { + start: { column: 9, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..f311c333fd55 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/3-Babel-AST.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics unknown-type-annotation Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "foo", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnknownKeyword { + type: "TSUnknownKeyword", + + range: [82, 89], + loc: { + start: { column: 9, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [80, 89], + loc: { + start: { column: 7, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [77, 89], + loc: { + start: { column: 4, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + init: null, + + range: [77, 89], + loc: { + start: { column: 4, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 90], + loc: { + start: { column: 0, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..c854fcc88b73 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics unknown-type-annotation Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "unknown", + + range: [82, 89], + loc: { + start: { column: 9, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..9a02cb1d49f0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics unknown-type-annotation AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..4b6d2dac841b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,62 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics unknown-type-annotation AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'foo', + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'unknown', + + range: [82, 89], + loc: { + start: { column: 9, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/fixture.ts new file mode 100644 index 000000000000..d4e92d120556 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +var foo: A.B.C; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..9e08e2b404d6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,114 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics var-with-dotted-type TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "foo", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: TSQualifiedName { + type: "TSQualifiedName", + left: TSQualifiedName { + type: "TSQualifiedName", + left: Identifier { + type: "Identifier", + name: "A", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + right: Identifier { + type: "Identifier", + name: "B", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + right: Identifier { + type: "Identifier", + name: "C", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [80, 87], + loc: { + start: { column: 7, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [77, 87], + loc: { + start: { column: 4, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + init: null, + + range: [77, 87], + loc: { + start: { column: 4, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ], + kind: "var", + + range: [73, 88], + loc: { + start: { column: 0, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 89], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..3c7d20b6bfbf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics var-with-dotted-type TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "var", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..62c6d308f3b5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/3-Babel-AST.shot @@ -0,0 +1,114 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics var-with-dotted-type Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "foo", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: TSQualifiedName { + type: "TSQualifiedName", + left: TSQualifiedName { + type: "TSQualifiedName", + left: Identifier { + type: "Identifier", + name: "A", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + right: Identifier { + type: "Identifier", + name: "B", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + right: Identifier { + type: "Identifier", + name: "C", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [80, 87], + loc: { + start: { column: 7, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [77, 87], + loc: { + start: { column: 4, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + init: null, + + range: [77, 87], + loc: { + start: { column: 4, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ], + kind: "var", + + range: [73, 88], + loc: { + start: { column: 0, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 89], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..87ba8d2c49b2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics var-with-dotted-type Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "var", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..c7abbe042676 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics var-with-dotted-type AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..f3c0266859dd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics var-with-dotted-type AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/fixture.ts new file mode 100644 index 000000000000..a0bccd6b2171 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/fixture.ts @@ -0,0 +1,4 @@ +// TODO: This fixture might be too large, and if so should be split up. + +var name: string = 'Nicholas'; +var foo: string = 'Bar'; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..62ba003935b1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics var-with-type TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "name", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [83, 89], + loc: { + start: { column: 10, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [81, 89], + loc: { + start: { column: 8, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [77, 89], + loc: { + start: { column: 4, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + init: Literal { + type: "Literal", + raw: "'Nicholas'", + value: "Nicholas", + + range: [92, 102], + loc: { + start: { column: 19, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [77, 102], + loc: { + start: { column: 4, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + kind: "var", + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "foo", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [113, 119], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [111, 119], + loc: { + start: { column: 7, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [108, 119], + loc: { + start: { column: 4, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + init: Literal { + type: "Literal", + raw: "'Bar'", + value: "Bar", + + range: [122, 127], + loc: { + start: { column: 18, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [108, 127], + loc: { + start: { column: 4, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + ], + kind: "var", + + range: [104, 128], + loc: { + start: { column: 0, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 129], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..e1f9a72af96b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics var-with-type TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "var", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "name", + + range: [77, 81], + loc: { + start: { column: 4, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [83, 89], + loc: { + start: { column: 10, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + String { + type: "String", + value: "'Nicholas'", + + range: [92, 102], + loc: { + start: { column: 19, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "var", + + range: [104, 107], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [108, 111], + loc: { + start: { column: 4, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [111, 112], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [113, 119], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [120, 121], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + String { + type: "String", + value: "'Bar'", + + range: [122, 127], + loc: { + start: { column: 18, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [127, 128], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..59fa34d17927 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/3-Babel-AST.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics var-with-type Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "name", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [83, 89], + loc: { + start: { column: 10, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [81, 89], + loc: { + start: { column: 8, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [77, 89], + loc: { + start: { column: 4, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + init: Literal { + type: "Literal", + raw: "'Nicholas'", + value: "Nicholas", + + range: [92, 102], + loc: { + start: { column: 19, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [77, 102], + loc: { + start: { column: 4, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + kind: "var", + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "foo", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [113, 119], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [111, 119], + loc: { + start: { column: 7, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [108, 119], + loc: { + start: { column: 4, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + init: Literal { + type: "Literal", + raw: "'Bar'", + value: "Bar", + + range: [122, 127], + loc: { + start: { column: 18, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [108, 127], + loc: { + start: { column: 4, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + ], + kind: "var", + + range: [104, 128], + loc: { + start: { column: 0, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 129], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..7175613a8ff5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics var-with-type Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "var", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "name", + + range: [77, 81], + loc: { + start: { column: 4, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [83, 89], + loc: { + start: { column: 10, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + String { + type: "String", + value: "'Nicholas'", + + range: [92, 102], + loc: { + start: { column: 19, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "var", + + range: [104, 107], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [108, 111], + loc: { + start: { column: 4, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [111, 112], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [113, 119], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [120, 121], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + String { + type: "String", + value: "'Bar'", + + range: [122, 127], + loc: { + start: { column: 18, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [127, 128], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..5db71f16938d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics var-with-type AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..f82ffcf03006 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics var-with-type AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/fixture.ts new file mode 100644 index 000000000000..af3149930297 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let x: string; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..1f0975e69f95 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics variable-declaration-type-annotation-spacing TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [78, 86], + loc: { + start: { column: 5, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [77, 86], + loc: { + start: { column: 4, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + init: null, + + range: [77, 86], + loc: { + start: { column: 4, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 87], + loc: { + start: { column: 0, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 88], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..814a8e63f06c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics variable-declaration-type-annotation-spacing TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..601d0bafa841 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/3-Babel-AST.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics variable-declaration-type-annotation-spacing Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [78, 86], + loc: { + start: { column: 5, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [77, 86], + loc: { + start: { column: 4, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + init: null, + + range: [77, 86], + loc: { + start: { column: 4, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 87], + loc: { + start: { column: 0, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 88], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..1bc67f77ed51 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics variable-declaration-type-annotation-spacing Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..e4933e5c280d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics variable-declaration-type-annotation-spacing AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..63dca6db6fd2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,62 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures basics variable-declaration-type-annotation-spacing AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/fixture.ts b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/fixture.ts new file mode 100644 index 000000000000..7df5fa9ebde7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +@Component({ + selector: 'foo', +}) +class FooComponent {} diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..11c4c7d84f39 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,124 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators class-decorator-factory TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [127, 129], + loc: { + start: { column: 19, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "selector", + + range: [88, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: "'foo'", + value: "foo", + + range: [98, 103], + loc: { + start: { column: 12, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + + range: [88, 103], + loc: { + start: { column: 2, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + ], + + range: [84, 106], + loc: { + start: { column: 11, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "Component", + + range: [74, 83], + loc: { + start: { column: 1, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + optional: false, + + range: [74, 107], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "FooComponent", + + range: [114, 126], + loc: { + start: { column: 6, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + superClass: null, + + range: [73, 129], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 130], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..ece4f1425d5e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators class-decorator-factory TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "@", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Component", + + range: [74, 83], + loc: { + start: { column: 1, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "selector", + + range: [88, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [96, 97], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + String { + type: "String", + value: "'foo'", + + range: [98, 103], + loc: { + start: { column: 12, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [103, 104], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [105, 106], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [106, 107], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [108, 113], + loc: { + start: { column: 0, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "FooComponent", + + range: [114, 126], + loc: { + start: { column: 6, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [127, 128], + loc: { + start: { column: 19, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [128, 129], + loc: { + start: { column: 20, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..673b64b11b9b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/3-Babel-AST.shot @@ -0,0 +1,124 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators class-decorator-factory Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [127, 129], + loc: { + start: { column: 19, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "selector", + + range: [88, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: "'foo'", + value: "foo", + + range: [98, 103], + loc: { + start: { column: 12, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + + range: [88, 103], + loc: { + start: { column: 2, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + ], + + range: [84, 106], + loc: { + start: { column: 11, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "Component", + + range: [74, 83], + loc: { + start: { column: 1, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + optional: false, + + range: [74, 107], + loc: { + start: { column: 1, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "FooComponent", + + range: [114, 126], + loc: { + start: { column: 6, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + superClass: null, + + range: [73, 129], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 130], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..5abed2d4eb10 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators class-decorator-factory Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "@", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Component", + + range: [74, 83], + loc: { + start: { column: 1, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "selector", + + range: [88, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [96, 97], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + String { + type: "String", + value: "'foo'", + + range: [98, 103], + loc: { + start: { column: 12, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [103, 104], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [105, 106], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [106, 107], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [108, 113], + loc: { + start: { column: 0, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "FooComponent", + + range: [114, 126], + loc: { + start: { column: 6, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [127, 128], + loc: { + start: { column: 19, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [128, 129], + loc: { + start: { column: 20, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..8c120b192b5c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators class-decorator-factory AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..9d92ba600297 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators class-decorator-factory AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/fixture.ts b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/fixture.ts new file mode 100644 index 000000000000..acede7d36e21 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/fixture.ts @@ -0,0 +1,4 @@ +// TODO: This fixture might be too large, and if so should be split up. + +@sealed +class Qux {} diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..f1c3785e60b0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,67 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators class-decorator TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [91, 93], + loc: { + start: { column: 10, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "sealed", + + range: [74, 80], + loc: { + start: { column: 1, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "Qux", + + range: [87, 90], + loc: { + start: { column: 6, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + superClass: null, + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 12, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..a63ba94dd34a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators class-decorator TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "@", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "sealed", + + range: [74, 80], + loc: { + start: { column: 1, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [81, 86], + loc: { + start: { column: 0, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Qux", + + range: [87, 90], + loc: { + start: { column: 6, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [91, 92], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [92, 93], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..bb71a3c08e99 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/3-Babel-AST.shot @@ -0,0 +1,67 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators class-decorator Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [91, 93], + loc: { + start: { column: 10, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "sealed", + + range: [74, 80], + loc: { + start: { column: 1, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "Qux", + + range: [87, 90], + loc: { + start: { column: 6, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + superClass: null, + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 12, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..1b7ea557d519 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators class-decorator Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "@", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "sealed", + + range: [74, 80], + loc: { + start: { column: 1, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [81, 86], + loc: { + start: { column: 0, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Qux", + + range: [87, 90], + loc: { + start: { column: 6, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [91, 92], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [92, 93], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..40e0a52e4096 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators class-decorator AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..4525a423e5a4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators class-decorator AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/fixture.ts b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/fixture.ts new file mode 100644 index 000000000000..3fbf672ea333 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class A { + constructor(@d private x: number) {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..cebfd84330ae --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,154 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators class-parameter-property TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [85, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: "constructor", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [119, 121], + loc: { + start: { column: 36, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "private", + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "d", + + range: [98, 99], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [97, 99], + loc: { + start: { column: 14, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + ], + parameter: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [111, 117], + loc: { + start: { column: 28, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [109, 117], + loc: { + start: { column: 26, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [108, 117], + loc: { + start: { column: 25, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [97, 117], + loc: { + start: { column: 14, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + ], + + range: [96, 121], + loc: { + start: { column: 13, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + + range: [85, 121], + loc: { + start: { column: 2, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + ], + + range: [81, 123], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "A", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 124], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..3cc387fae97d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators class-parameter-property TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [85, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [96, 97], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [97, 98], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "d", + + range: [98, 99], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "private", + + range: [100, 107], + loc: { + start: { column: 17, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [108, 109], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [109, 110], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [111, 117], + loc: { + start: { column: 28, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [117, 118], + loc: { + start: { column: 34, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [119, 120], + loc: { + start: { column: 36, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [120, 121], + loc: { + start: { column: 37, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [122, 123], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..d51e890ee073 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/3-Babel-AST.shot @@ -0,0 +1,153 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators class-parameter-property Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [85, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: "constructor", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [119, 121], + loc: { + start: { column: 36, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "private", + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "d", + + range: [98, 99], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [97, 99], + loc: { + start: { column: 14, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + ], + parameter: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [111, 117], + loc: { + start: { column: 28, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [109, 117], + loc: { + start: { column: 26, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [108, 117], + loc: { + start: { column: 25, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [100, 117], + loc: { + start: { column: 17, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + ], + + range: [96, 121], + loc: { + start: { column: 13, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + + range: [85, 121], + loc: { + start: { column: 2, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + ], + + range: [81, 123], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "A", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 124], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..c794a3b4b7b4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators class-parameter-property Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [85, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [96, 97], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [97, 98], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "d", + + range: [98, 99], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "private", + + range: [100, 107], + loc: { + start: { column: 17, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [108, 109], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [109, 110], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [111, 117], + loc: { + start: { column: 28, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [117, 118], + loc: { + start: { column: 34, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [119, 120], + loc: { + start: { column: 36, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [120, 121], + loc: { + start: { column: 37, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [122, 123], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..ad0a3b6af28a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,160 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators class-parameter-property AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'constructor', + + range: [85, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: 'constructor', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [119, 121], + loc: { + start: { column: 36, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: 'TSParameterProperty', + accessibility: 'private', + decorators: Array [ + Decorator { + type: 'Decorator', + expression: Identifier { + type: 'Identifier', + name: 'd', + + range: [98, 99], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [97, 99], + loc: { + start: { column: 14, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + ], + parameter: Identifier { + type: 'Identifier', + name: 'x', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [111, 117], + loc: { + start: { column: 28, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [109, 117], + loc: { + start: { column: 26, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [108, 117], + loc: { + start: { column: 25, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + +- range: [97, 117], ++ range: [100, 117], + loc: { +- start: { column: 14, line: 4 }, ++ start: { column: 17, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + ], + + range: [96, 121], + loc: { + start: { column: 13, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + + range: [85, 121], + loc: { + start: { column: 2, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + ], + + range: [81, 123], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'A', + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 124], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..98c5c13302a5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,162 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators class-parameter-property AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'A', + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'constructor', + + range: [85, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [96, 97], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '@', + + range: [97, 98], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'd', + + range: [98, 99], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'private', + + range: [100, 107], + loc: { + start: { column: 17, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [108, 109], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [109, 110], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [111, 117], + loc: { + start: { column: 28, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [117, 118], + loc: { + start: { column: 34, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [119, 120], + loc: { + start: { column: 36, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [120, 121], + loc: { + start: { column: 37, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [122, 123], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/fixture.ts b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/fixture.ts new file mode 100644 index 000000000000..d955c69b5e56 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/fixture.ts @@ -0,0 +1,4 @@ +// TODO: This fixture might be too large, and if so should be split up. + +@sealed +export default class Qux {} diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..90813124a39b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,77 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators export-default-class-decorator TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [106, 108], + loc: { + start: { column: 25, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "sealed", + + range: [74, 80], + loc: { + start: { column: 1, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "Qux", + + range: [102, 105], + loc: { + start: { column: 21, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + superClass: null, + + range: [96, 108], + loc: { + start: { column: 15, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + exportKind: "value", + + range: [81, 108], + loc: { + start: { column: 0, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + ], + sourceType: "module", + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..12ac7dd89864 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators export-default-class-decorator TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "@", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "sealed", + + range: [74, 80], + loc: { + start: { column: 1, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "export", + + range: [81, 87], + loc: { + start: { column: 0, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [88, 95], + loc: { + start: { column: 7, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [96, 101], + loc: { + start: { column: 15, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Qux", + + range: [102, 105], + loc: { + start: { column: 21, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [106, 107], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [107, 108], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..1b4b56419c3d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/3-Babel-AST.shot @@ -0,0 +1,77 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators export-default-class-decorator Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [106, 108], + loc: { + start: { column: 25, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "sealed", + + range: [74, 80], + loc: { + start: { column: 1, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "Qux", + + range: [102, 105], + loc: { + start: { column: 21, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + superClass: null, + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 27, line: 4 }, + }, + }, + exportKind: "value", + + range: [81, 108], + loc: { + start: { column: 0, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + ], + sourceType: "module", + + range: [81, 109], + loc: { + start: { column: 0, line: 4 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..a996a885d498 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators export-default-class-decorator Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "@", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "sealed", + + range: [74, 80], + loc: { + start: { column: 1, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "export", + + range: [81, 87], + loc: { + start: { column: 0, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [88, 95], + loc: { + start: { column: 7, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [96, 101], + loc: { + start: { column: 15, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Qux", + + range: [102, 105], + loc: { + start: { column: 21, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [106, 107], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [107, 108], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..aab5207c1cfc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,85 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators export-default-class-decorator AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportDefaultDeclaration { + type: 'ExportDefaultDeclaration', + declaration: ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [106, 108], + loc: { + start: { column: 25, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + decorators: Array [ + Decorator { + type: 'Decorator', + expression: Identifier { + type: 'Identifier', + name: 'sealed', + + range: [74, 80], + loc: { + start: { column: 1, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + ], + id: Identifier { + type: 'Identifier', + name: 'Qux', + + range: [102, 105], + loc: { + start: { column: 21, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + superClass: null, + +- range: [96, 108], ++ range: [73, 108], + loc: { +- start: { column: 15, line: 4 }, ++ start: { column: 0, line: 3 }, + end: { column: 27, line: 4 }, + }, + }, + exportKind: 'value', + + range: [81, 108], + loc: { + start: { column: 0, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + ], + sourceType: 'module', + +- range: [73, 109], ++ range: [81, 109], + loc: { +- start: { column: 0, line: 3 }, ++ start: { column: 0, line: 4 }, + end: { column: 0, line: 5 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..5063bc593217 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators export-default-class-decorator AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/fixture.ts b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/fixture.ts new file mode 100644 index 000000000000..2bba6990c85e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/fixture.ts @@ -0,0 +1,4 @@ +// TODO: This fixture might be too large, and if so should be split up. + +@sealed +export class Qux {} diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..e1fe4ea39ea9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,80 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators export-named-class-decorator TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [98, 100], + loc: { + start: { column: 17, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "sealed", + + range: [74, 80], + loc: { + start: { column: 1, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "Qux", + + range: [94, 97], + loc: { + start: { column: 13, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + superClass: null, + + range: [88, 100], + loc: { + start: { column: 7, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [81, 100], + loc: { + start: { column: 0, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + ], + sourceType: "module", + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..13316d71e3a6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators export-named-class-decorator TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "@", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "sealed", + + range: [74, 80], + loc: { + start: { column: 1, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "export", + + range: [81, 87], + loc: { + start: { column: 0, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [88, 93], + loc: { + start: { column: 7, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Qux", + + range: [94, 97], + loc: { + start: { column: 13, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [98, 99], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [99, 100], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..b660eee0d9db --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/3-Babel-AST.shot @@ -0,0 +1,80 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators export-named-class-decorator Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [98, 100], + loc: { + start: { column: 17, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "sealed", + + range: [74, 80], + loc: { + start: { column: 1, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "Qux", + + range: [94, 97], + loc: { + start: { column: 13, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + superClass: null, + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 19, line: 4 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [81, 100], + loc: { + start: { column: 0, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + ], + sourceType: "module", + + range: [81, 101], + loc: { + start: { column: 0, line: 4 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..f3fb937e2075 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators export-named-class-decorator Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "@", + + range: [73, 74], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "sealed", + + range: [74, 80], + loc: { + start: { column: 1, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "export", + + range: [81, 87], + loc: { + start: { column: 0, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [88, 93], + loc: { + start: { column: 7, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Qux", + + range: [94, 97], + loc: { + start: { column: 13, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [98, 99], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [99, 100], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..129de117810a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,88 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators export-named-class-decorator AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [98, 100], + loc: { + start: { column: 17, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + decorators: Array [ + Decorator { + type: 'Decorator', + expression: Identifier { + type: 'Identifier', + name: 'sealed', + + range: [74, 80], + loc: { + start: { column: 1, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + ], + id: Identifier { + type: 'Identifier', + name: 'Qux', + + range: [94, 97], + loc: { + start: { column: 13, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + superClass: null, + +- range: [88, 100], ++ range: [73, 100], + loc: { +- start: { column: 7, line: 4 }, ++ start: { column: 0, line: 3 }, + end: { column: 19, line: 4 }, + }, + }, + exportKind: 'value', + source: null, + specifiers: Array [], + + range: [81, 100], + loc: { + start: { column: 0, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + ], + sourceType: 'module', + +- range: [73, 101], ++ range: [81, 101], + loc: { +- start: { column: 0, line: 3 }, ++ start: { column: 0, line: 4 }, + end: { column: 0, line: 5 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..364a1c6e2586 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures class-decorators export-named-class-decorator AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/fixture.ts b/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/fixture.ts new file mode 100644 index 000000000000..ca5621ddc572 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +const foo = < + Foo // test +>bar; diff --git a/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..381468f0d2a4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,85 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures comments type-assertion-regression-test TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + init: TSTypeAssertion { + type: "TSTypeAssertion", + expression: Identifier { + type: "Identifier", + name: "bar", + + range: [102, 105], + loc: { + start: { column: 1, line: 5 }, + end: { column: 4, line: 5 }, + }, + }, + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Foo", + + range: [89, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + + range: [89, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + + range: [85, 105], + loc: { + start: { column: 12, line: 3 }, + end: { column: 4, line: 5 }, + }, + }, + + range: [79, 105], + loc: { + start: { column: 6, line: 3 }, + end: { column: 4, line: 5 }, + }, + }, + ], + kind: "const", + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..5829d40f0691 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures comments type-assertion-regression-test TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "const", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [89, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [101, 102], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [102, 105], + loc: { + start: { column: 1, line: 5 }, + end: { column: 4, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [105, 106], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..d4c42a7de6ee --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/3-Babel-AST.shot @@ -0,0 +1,85 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures comments type-assertion-regression-test Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + init: TSTypeAssertion { + type: "TSTypeAssertion", + expression: Identifier { + type: "Identifier", + name: "bar", + + range: [102, 105], + loc: { + start: { column: 1, line: 5 }, + end: { column: 4, line: 5 }, + }, + }, + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Foo", + + range: [89, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + + range: [89, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + + range: [85, 105], + loc: { + start: { column: 12, line: 3 }, + end: { column: 4, line: 5 }, + }, + }, + + range: [79, 105], + loc: { + start: { column: 6, line: 3 }, + end: { column: 4, line: 5 }, + }, + }, + ], + kind: "const", + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..1154b63f5765 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures comments type-assertion-regression-test Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "const", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [89, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [101, 102], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [102, 105], + loc: { + start: { column: 1, line: 5 }, + end: { column: 4, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [105, 106], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..72f39c2a9d75 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures comments type-assertion-regression-test AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..8c40d588eaf9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures comments type-assertion-regression-test AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/fixture.ts b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/fixture.ts new file mode 100644 index 000000000000..a53949edcbf2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +declare abstract class Foo {} diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..1754da14fd4d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,48 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare abstract-class TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [100, 102], + loc: { + start: { column: 27, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + declare: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [96, 99], + loc: { + start: { column: 23, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + superClass: null, + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..c766699f8484 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare abstract-class TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [81, 89], + loc: { + start: { column: 8, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [90, 95], + loc: { + start: { column: 17, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [96, 99], + loc: { + start: { column: 23, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..f01b42c487ce --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/3-Babel-AST.shot @@ -0,0 +1,48 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare abstract-class Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [100, 102], + loc: { + start: { column: 27, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + declare: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [96, 99], + loc: { + start: { column: 23, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + superClass: null, + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..79df63368091 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare abstract-class Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [81, 89], + loc: { + start: { column: 8, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [90, 95], + loc: { + start: { column: 17, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [96, 99], + loc: { + start: { column: 23, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..5af6384c0158 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare abstract-class AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..dc501caea018 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare abstract-class AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/fixture.ts b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/fixture.ts new file mode 100644 index 000000000000..5876a05f2316 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +declare class Foo {} diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..2d0980f45ca8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,47 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare class TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [91, 93], + loc: { + start: { column: 18, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + declare: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + superClass: null, + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..cedf82032938 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare class TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [81, 86], + loc: { + start: { column: 8, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..43e79bf82d2b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/3-Babel-AST.shot @@ -0,0 +1,47 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare class Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [91, 93], + loc: { + start: { column: 18, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + declare: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + superClass: null, + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..d7af077a8d17 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare class Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [81, 86], + loc: { + start: { column: 8, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..87f188965e7c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare class AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..425507b265db --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare class AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/fixture.ts b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/fixture.ts new file mode 100644 index 000000000000..083fa3b57c05 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +declare enum Foo { + Bar, + Baz, +} diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..8150d53af105 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare enum TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSEnumDeclaration { + type: "TSEnumDeclaration", + declare: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + members: Array [ + TSEnumMember { + type: "TSEnumMember", + id: Identifier { + type: "Identifier", + name: "Bar", + + range: [94, 97], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + + range: [94, 97], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + TSEnumMember { + type: "TSEnumMember", + id: Identifier { + type: "Identifier", + name: "Baz", + + range: [101, 104], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + + range: [101, 104], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + ], + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..9fe90713d91b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare enum TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "enum", + + range: [81, 85], + loc: { + start: { column: 8, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [94, 97], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [97, 98], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Baz", + + range: [101, 104], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [104, 105], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [106, 107], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..909932e5f720 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/3-Babel-AST.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare enum Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSEnumDeclaration { + type: "TSEnumDeclaration", + declare: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + members: Array [ + TSEnumMember { + type: "TSEnumMember", + id: Identifier { + type: "Identifier", + name: "Bar", + + range: [94, 97], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + + range: [94, 97], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + TSEnumMember { + type: "TSEnumMember", + id: Identifier { + type: "Identifier", + name: "Baz", + + range: [101, 104], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + + range: [101, 104], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + ], + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..88d8eedb6bb2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare enum Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "enum", + + range: [81, 85], + loc: { + start: { column: 8, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [94, 97], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [97, 98], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Baz", + + range: [101, 104], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [104, 105], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [106, 107], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..be39111033ab --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare enum AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..e6d4c6415160 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,102 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare enum AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Identifier { + type: 'Identifier', + value: 'declare', + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'enum', + + range: [81, 85], + loc: { + start: { column: 8, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Bar', + + range: [94, 97], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [97, 98], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Baz', + + range: [101, 104], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [104, 105], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [106, 107], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/fixture.ts b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/fixture.ts new file mode 100644 index 000000000000..d697aefbd5b6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +declare function foo(): void; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..5d3548cb2ae9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,58 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare function TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSDeclareFunction { + type: "TSDeclareFunction", + async: false, + declare: true, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [97, 101], + loc: { + start: { column: 24, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..f398d7d6cab8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare function TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [81, 89], + loc: { + start: { column: 8, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [97, 101], + loc: { + start: { column: 24, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..891598dbb478 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/3-Babel-AST.shot @@ -0,0 +1,58 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare function Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSDeclareFunction { + type: "TSDeclareFunction", + async: false, + declare: true, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [97, 101], + loc: { + start: { column: 24, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..1e8436b09f3e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare function Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [81, 89], + loc: { + start: { column: 8, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [97, 101], + loc: { + start: { column: 24, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..cef0cfc863ed --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare function AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..87ea6d86c1eb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare function AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/fixture.ts b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/fixture.ts new file mode 100644 index 000000000000..213eb014bb4f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +declare interface Foo {} diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..369f6a7fb53d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare interface TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [95, 97], + loc: { + start: { column: 22, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + declare: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [91, 94], + loc: { + start: { column: 18, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [73, 97], + loc: { + start: { column: 0, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..d7adc4d28402 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare interface TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "interface", + + range: [81, 90], + loc: { + start: { column: 8, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [91, 94], + loc: { + start: { column: 18, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..0b8509a483cc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/3-Babel-AST.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare interface Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [95, 97], + loc: { + start: { column: 22, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + declare: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [91, 94], + loc: { + start: { column: 18, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [73, 97], + loc: { + start: { column: 0, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..aa96e49a62b8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare interface Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "interface", + + range: [81, 90], + loc: { + start: { column: 8, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [91, 94], + loc: { + start: { column: 18, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..13fe23e4d2a9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare interface AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..ab72a4a7a14e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,62 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare interface AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Identifier { + type: 'Identifier', + value: 'declare', + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [81, 90], + loc: { + start: { column: 8, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [91, 94], + loc: { + start: { column: 18, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/fixture.ts b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/fixture.ts new file mode 100644 index 000000000000..9d59e1518543 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +declare module Foo {} diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..17df9ce9c9ff --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare module TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [], + + range: [92, 94], + loc: { + start: { column: 19, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + declare: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..fcec61a4cf7a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare module TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "module", + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..3fa64e62d3b9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/3-Babel-AST.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare module Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [], + + range: [92, 94], + loc: { + start: { column: 19, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + declare: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..44f5e06f3d34 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare module Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "module", + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..9546b3d34b31 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare module AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..ecdd09b897e0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare module AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/fixture.ts b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/fixture.ts new file mode 100644 index 000000000000..e56cf1e2b30a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +declare namespace Foo {} diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..85661223163a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare namespace TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [], + + range: [95, 97], + loc: { + start: { column: 22, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + declare: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [91, 94], + loc: { + start: { column: 18, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [73, 97], + loc: { + start: { column: 0, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..c956ed89ecef --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare namespace TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "namespace", + + range: [81, 90], + loc: { + start: { column: 8, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [91, 94], + loc: { + start: { column: 18, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..34abdd0420bc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/3-Babel-AST.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare namespace Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [], + + range: [95, 97], + loc: { + start: { column: 22, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + declare: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [91, 94], + loc: { + start: { column: 18, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [73, 97], + loc: { + start: { column: 0, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..014f4d3e257a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare namespace Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "namespace", + + range: [81, 90], + loc: { + start: { column: 8, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [91, 94], + loc: { + start: { column: 18, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..1d5ab5062386 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare namespace AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..0d7240482d6d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare namespace AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/fixture.ts b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/fixture.ts new file mode 100644 index 000000000000..1499c500cf11 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +declare type Foo = string; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..0df751e2ad83 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,45 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare type-alias TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + declare: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [92, 98], + loc: { + start: { column: 19, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [73, 99], + loc: { + start: { column: 0, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..cc5c10ca3cd8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare type-alias TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [81, 85], + loc: { + start: { column: 8, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [92, 98], + loc: { + start: { column: 19, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..1e3632d9b567 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/3-Babel-AST.shot @@ -0,0 +1,45 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare type-alias Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + declare: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [92, 98], + loc: { + start: { column: 19, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [73, 99], + loc: { + start: { column: 0, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..91707312017f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare type-alias Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [81, 85], + loc: { + start: { column: 8, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [92, 98], + loc: { + start: { column: 19, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..d425ca353e60 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare type-alias AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..01e53ea1042f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare type-alias AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/fixture.ts b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/fixture.ts new file mode 100644 index 000000000000..3dcd2adbfa62 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +declare var foo: any; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..de3d06244c02 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,67 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare variable TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "foo", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [88, 93], + loc: { + start: { column: 15, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + init: null, + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + declare: true, + kind: "var", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..676d3e708565 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare variable TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "var", + + range: [81, 84], + loc: { + start: { column: 8, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..95adb05e6e7e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/3-Babel-AST.shot @@ -0,0 +1,67 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare variable Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "foo", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [88, 93], + loc: { + start: { column: 15, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + init: null, + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + declare: true, + kind: "var", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..b05f923663f0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare variable Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "var", + + range: [81, 84], + loc: { + start: { column: 8, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..3dcece695fea --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare variable AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..0db26e31bd58 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures declare variable AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/fixture.ts new file mode 100644 index 000000000000..7c625062f7e8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo extends implements Bar { + +} diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..a645249de303 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-empty-extends-implements TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..60d72da36dd0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-empty-extends-implements Babel - Error 1`] = `[SyntaxError: Unexpected reserved word 'implements'. (3:18)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..d39f40658107 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-empty-extends-implements Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/fixture.ts new file mode 100644 index 000000000000..4c0f81048d7e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo extends { + +} diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..403ed52cb6dd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-empty-extends TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..4cf63d004827 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-empty-extends Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (6:0)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..797630b5f8c8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-empty-extends Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/fixture.ts new file mode 100644 index 000000000000..fd79971a7c2d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo extends Bar implements { + +} diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..0a8ba11f7bcd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-extends-empty-implements TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..0c3e448daa84 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-extends-empty-implements Babel - Error 1`] = `[SyntaxError: 'implements' list cannot be empty. (3:33)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..cda29807004a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-extends-empty-implements Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/fixture.ts new file mode 100644 index 000000000000..b59b85814bfb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class a implements b implements c {} diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..1868f08ac3c9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-multiple-implements TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..ef0323f1248a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-multiple-implements Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "," (3:21)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..519ad3a361f8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-multiple-implements Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/fixture.ts new file mode 100644 index 000000000000..b84bf935d006 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +@dec enum E {} \ No newline at end of file diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..bcb52edf68d0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-enum-declaration TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..1111df2d4d55 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-enum-declaration Babel - Error 1`] = `[SyntaxError: 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-enum-declaration/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..17ba689c614b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-enum-declaration Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/fixture.ts new file mode 100644 index 000000000000..1d3b82898346 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/fixture.ts @@ -0,0 +1,4 @@ +// TODO: This fixture might be too large, and if so should be split up. + +@dec +function b(){} diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..0d803ce647c5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-function TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..4b9fe05a0db6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-function Babel - Error 1`] = `[SyntaxError: 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-function/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..4c89abf9f72f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-function Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/fixture.ts new file mode 100644 index 000000000000..7604714e47b1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/fixture.ts @@ -0,0 +1,4 @@ +// TODO: This fixture might be too large, and if so should be split up. + +@deco() +interface M {} \ No newline at end of file diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..3905750f9aa5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-interface-declaration TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..46332174237d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-interface-declaration Babel - Error 1`] = `[SyntaxError: 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-interface-declaration/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..f7a4fa57521a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-interface-declaration Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/fixture.ts new file mode 100644 index 000000000000..6a27993435de --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/fixture.ts @@ -0,0 +1,4 @@ +// TODO: This fixture might be too large, and if so should be split up. + +@deco() +const a = 1 diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..184f3d96b4d1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-variable TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..577ab6fdfd23 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-variable Babel - Error 1`] = `[SyntaxError: 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/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..1c90fdcf5406 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-variable Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/fixture.ts new file mode 100644 index 000000000000..a7fb076cdb48 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +foo<>(); diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..dd361ab1c730 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-arguments-in-call-expression TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..4992c1bda8ba --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-arguments-in-call-expression Babel - Error 1`] = `[SyntaxError: Unexpected token (3:4)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..c7ddaf4d3507 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-arguments-in-call-expression Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/fixture.ts new file mode 100644 index 000000000000..2a2f2e32340e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +new Foo<>() diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..702585727a18 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-arguments-in-new-expression TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..4330f2de54d1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-arguments-in-new-expression Babel - Error 1`] = `[SyntaxError: Unexpected token (3:8)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..96ba6b3c25ae --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-arguments-in-new-expression Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/fixture.ts new file mode 100644 index 000000000000..408bc3f28d10 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +const foo: Foo<> \ No newline at end of file diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..ebf3270e4442 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-arguments TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..b9424b15c159 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-arguments Babel - Error 1`] = `[SyntaxError: Type argument list cannot be empty. (3:14)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..231a4e0b03c8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-arguments Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/fixture.ts new file mode 100644 index 000000000000..add9711e2f79 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function f1<>() {} diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..7adaf9c03fab --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-arrow-function TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..12440d8874fa --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-arrow-function Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (3:11)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..04350071ad74 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-arrow-function Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/fixture.ts new file mode 100644 index 000000000000..01f78914f24c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class foo { + constructor<>() {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..b183fe05448a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-constructor TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..5bf5b3f2503c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-constructor Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (4:13)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..406623be3732 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-constructor Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/fixture.ts new file mode 100644 index 000000000000..43d8a0629438 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +const foo = function<>() {} diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..76991a349bac --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-function-expression TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..108f139e0c1e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-function-expression Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (3:20)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..e6cdab797b6c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-function-expression Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/fixture.ts new file mode 100644 index 000000000000..86fe0a04f52d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface foo { + test<>(); +} diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..b2422d273aef --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-method-signature TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..665c83f9988c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-method-signature Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (4:6)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..a5fa26ec178e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-method-signature Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/fixture.ts new file mode 100644 index 000000000000..f1968109a07b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class foo { + test<>() {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..788627e4aba6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-method TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..4e1cb147bbf1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-method Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (4:6)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..bb1641bbb8ae --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-method Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/fixture.ts new file mode 100644 index 000000000000..add9711e2f79 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +function f1<>() {} diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..9875a979bb7e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..ae64111c78c0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (3:11)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..14e18802b751 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/fixture.ts new file mode 100644 index 000000000000..5a0ebf3b0dbd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +export private public protected static readonly abstract async enum X {} \ No newline at end of file diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..264bd320faae --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ enum-with-keywords TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..c16dc935997d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ enum-with-keywords Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (3:7)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..ada94f82c3ab --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ enum-with-keywords Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/fixture.ts new file mode 100644 index 000000000000..c7431353c877 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type foo = { + [a: string, b: string]: string; +} diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..376c6bd433af --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ index-signature-parameters TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..c54798556f5f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ index-signature-parameters Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "]" (4:12)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..9b3c693c259e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ index-signature-parameters Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/fixture.ts new file mode 100644 index 000000000000..cbb3541eef0b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo extends { + +} diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..455794859828 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-empty-extends TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..edb821783089 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-empty-extends Babel - Error 1`] = `[SyntaxError: 'extends' list cannot be empty. (3:22)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..30ede9e96f27 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-empty-extends Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/fixture.ts new file mode 100644 index 000000000000..4bf7368f3dc9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface d implements e {} diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..292b542dcf51 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-implements TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..ddf064bf40fa --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-implements Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (3:12)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..53470554fd31 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-implements Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/fixture.ts new file mode 100644 index 000000000000..59e70e36606f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo { + export [baz: string]: string; +} + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..4ed734c0a3d2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-export TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..3bfdf5319d1a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-export Babel - Error 1`] = `[SyntaxError: Unexpected token, expected ";" (4:9)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..36d9f4ef037f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-export Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/fixture.ts new file mode 100644 index 000000000000..5446ac12a156 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo { + private [baz: string]: string; +} + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..13a96652b2b8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-private TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..55e7b4fae1c2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-private Babel - Error 1`] = `[SyntaxError: 'private' modifier cannot appear on a type member. (4:2)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..70ae64a4a824 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-private Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/fixture.ts new file mode 100644 index 000000000000..137084c95437 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo { + protected [baz: string]: string; +} + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..b6d263475ee6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-protected TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..faf545c75f17 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-protected Babel - Error 1`] = `[SyntaxError: 'protected' modifier cannot appear on a type member. (4:2)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..49a27a188b93 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-protected Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/fixture.ts new file mode 100644 index 000000000000..b44e27009a4b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo { + public [baz: string]: string; +} + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..0ca583aff845 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-public TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..b92427a492b8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-public Babel - Error 1`] = `[SyntaxError: 'public' modifier cannot appear on a type member. (4:2)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..959f932de08c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-public Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/fixture.ts new file mode 100644 index 000000000000..a1a00ec5fd0b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo { + static [baz: string]: string; +} + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..1d5a7a35239a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-static TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..f0cb1e241b2a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-static Babel - Error 1`] = `[SyntaxError: 'static' modifier cannot appear on a type member. (4:2)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..1730fddc1735 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-static Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/fixture.ts new file mode 100644 index 000000000000..8fc197db7a9e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo { + export g(bar: string): void; +} + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..9bffb118f219 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-export TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..ebb45418f678 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-export Babel - Error 1`] = `[SyntaxError: Unexpected token, expected ";" (4:11)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..60a90127afa8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-export Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/fixture.ts new file mode 100644 index 000000000000..662b8dc4d645 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo { + private g(bar: string): void; +} + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..131a13aa7eec --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-private TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..bfa1cb153913 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-private Babel - Error 1`] = `[SyntaxError: 'private' modifier cannot appear on a type member. (4:4)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..2afbbf45ed3c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-private Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/fixture.ts new file mode 100644 index 000000000000..0a2c50e890fb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo { + protected g(bar: string): void; +} + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..2976cbb6ecf4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-protected TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..b78ab26d2d6f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-protected Babel - Error 1`] = `[SyntaxError: 'protected' modifier cannot appear on a type member. (4:2)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..0af7e82ad38f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-protected Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/fixture.ts new file mode 100644 index 000000000000..1ba46f1665e3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo { + public g(bar: string): void; +} + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..32cb1ca974d9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-public TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..93ed430d9703 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-public Babel - Error 1`] = `[SyntaxError: 'public' modifier cannot appear on a type member. (4:4)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..0a09195bd844 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-public Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/fixture.ts new file mode 100644 index 000000000000..7f8e76508987 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo { + readonly g(bar: string): void; +} diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..34d6269d02dd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-readonly TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..10b06c120064 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-readonly Babel - Error 1`] = `[SyntaxError: 'readonly' modifier can only appear on a property declaration or index signature. (4:2)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..062e4baddd0a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-readonly Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/fixture.ts new file mode 100644 index 000000000000..2c5128cdfa63 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo { + static g(bar: string): void; +} + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..01ec4dc383c1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-static TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..abb471fc9c10 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-static Babel - Error 1`] = `[SyntaxError: 'static' modifier cannot appear on a type member. (4:2)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..0cb366cff167 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-static Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/fixture.ts new file mode 100644 index 000000000000..6d5c1ab16482 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface foo extends bar extends baz {} diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..fef3fb47e009 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-multiple-extends TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..000b5cdd2478 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-multiple-extends Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "," (3:26)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..12254d1b48a1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-multiple-extends Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/fixture.ts new file mode 100644 index 000000000000..aac96df44d1e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo { + export a: string; +} + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..cd7457e48906 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-export TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..01bd31b00cb4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-export Babel - Error 1`] = `[SyntaxError: Unexpected token, expected ";" (4:9)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..62a5bb600657 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-export Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/fixture.ts new file mode 100644 index 000000000000..219d7c9404ad --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo { + private b: string; +} + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..c9e45d49f90e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-private TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..2808f07b4501 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-private Babel - Error 1`] = `[SyntaxError: 'private' modifier cannot appear on a type member. (4:2)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..3a57033e136d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-private Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/fixture.ts new file mode 100644 index 000000000000..1929e710a5b1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo { + protected a: string; +} + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..945a89aeb8ee --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-protected TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..9af6d30fe85c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-protected Babel - Error 1`] = `[SyntaxError: 'protected' modifier cannot appear on a type member. (4:2)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..65e263e1264d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-protected Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/fixture.ts new file mode 100644 index 000000000000..b9565edd5e7d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo { + public a: string; +} + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..0beb40de9876 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-public TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..af650dc52873 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-public Babel - Error 1`] = `[SyntaxError: 'public' modifier cannot appear on a type member. (4:4)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..6fe49dd919f1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-public Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/fixture.ts new file mode 100644 index 000000000000..4a3c559debb0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo { + static a: string; +} + diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..4e3c66ceceac --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-static TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..6e667a50f6a3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-static Babel - Error 1`] = `[SyntaxError: 'static' modifier cannot appear on a type member. (4:2)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..6e4940eb9ba6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-static Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/fixture.ts new file mode 100644 index 000000000000..f8e732b8e5c9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo { + bar: string = 'a'; +} diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..2833ac9eb8f0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-with-default-value TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..4b4b6efa0c57 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-with-default-value Babel - Error 1`] = `[SyntaxError: Unexpected token, expected ";" (4:14)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..7b334875fc2d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-with-default-value Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/fixture.ts new file mode 100644 index 000000000000..33b5a7f771f5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..2a48d4763193 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-with-no-body TSESTree - Error 1`] = `[TSError: '{' expected.]`; 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 new file mode 100644 index 000000000000..dc6c9ef4c0b7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-with-no-body Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (4:0)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..89ed2b199bb8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-with-no-body Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/fixture.ts new file mode 100644 index 000000000000..441e00a7537f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Foo { + [fff?: number]: string; +} diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..1c81fe4cce37 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-with-optional-index-signature TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..ae8600ccfdc3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-with-optional-index-signature Babel - Error 1`] = `[SyntaxError: Unexpected token (4:7)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..0ae40614620b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-with-optional-index-signature Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/fixture.ts new file mode 100644 index 000000000000..cbf25af06725 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +({a!} = {}) diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..099a62b2b6ed --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ object-assertion-not-allowed TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..f18a58b39b2b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ object-assertion-not-allowed Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "," (3:3)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..2b47812c46cd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ object-assertion-not-allowed Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/fixture.ts new file mode 100644 index 000000000000..cacd6b0190bb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +({a?} = {}) diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..5f118120b57c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ object-optional-not-allowed TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..373217628a29 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ object-optional-not-allowed Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "," (3:3)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..31aaad026ea5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ object-optional-not-allowed Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/fixture.ts new file mode 100644 index 000000000000..bc1927e701ce --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +const \ No newline at end of file diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..acfafbcff24c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ solo-const TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..4866de224eb4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ solo-const Babel - Error 1`] = `[SyntaxError: Unexpected token (3:5)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..5ba96a6641ee --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ solo-const Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/fixture.ts b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/fixture.ts new file mode 100644 index 000000000000..c6a4c69b0360 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/fixture.ts @@ -0,0 +1,9 @@ +// TODO: This fixture might be too large, and if so should be split up. + +a; + +a; +a(); +a?.(); +a?.b(); +new a(); diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..1f60a6e34020 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions _error_ instantiation-expression TSESTree - Error 1`] = `[TSError: Expression expected.]`; 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 new file mode 100644 index 000000000000..4f730913d192 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions _error_ instantiation-expression Babel - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..7a72a183ff52 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions _error_ instantiation-expression Error Alignment 1`] = `"TSESTree errored but Babel didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/fixture.ts b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/fixture.ts new file mode 100644 index 000000000000..cd5d1c36d3d2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/fixture.ts @@ -0,0 +1,4 @@ +// TODO: This fixture might be too large, and if so should be split up. + +foo(); +foo(); diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..1e4239cbfcec --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions call-expression-type-arguments TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "foo", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + optional: false, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + ], + + range: [76, 79], + loc: { + start: { column: 3, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "foo", + + range: [83, 86], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + optional: false, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [87, 93], + loc: { + start: { column: 4, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + ], + + range: [86, 94], + loc: { + start: { column: 3, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + + range: [83, 96], + loc: { + start: { column: 0, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [83, 97], + loc: { + start: { column: 0, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..4ddc70325bab --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions call-expression-type-arguments TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [76, 77], + loc: { + start: { column: 3, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [83, 86], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [86, 87], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [87, 93], + loc: { + start: { column: 4, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [93, 94], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [94, 95], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [95, 96], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [96, 97], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..c09291078230 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/3-Babel-AST.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions call-expression-type-arguments Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "foo", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + optional: false, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + ], + + range: [76, 79], + loc: { + start: { column: 3, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "foo", + + range: [83, 86], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + optional: false, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [87, 93], + loc: { + start: { column: 4, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + ], + + range: [86, 94], + loc: { + start: { column: 3, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + + range: [83, 96], + loc: { + start: { column: 0, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [83, 97], + loc: { + start: { column: 0, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..a3817102fc08 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions call-expression-type-arguments Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [76, 77], + loc: { + start: { column: 3, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [83, 86], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [86, 87], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [87, 93], + loc: { + start: { column: 4, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [93, 94], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [94, 95], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [95, 96], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [96, 97], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..37371563dade --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions call-expression-type-arguments AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..2177afe0f560 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions call-expression-type-arguments AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/fixture.ts b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/fixture.ts new file mode 100644 index 000000000000..3ea3db682cb4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +const a = new A(); diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..d25ae0fecae0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,97 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions new-expression-type-arguments TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "a", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + init: NewExpression { + type: "NewExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "A", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "B", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ], + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [83, 93], + loc: { + start: { column: 10, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [79, 93], + loc: { + start: { column: 6, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + kind: "const", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..c39d6becbe19 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions new-expression-type-arguments TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "const", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..306f3aa25f44 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/3-Babel-AST.shot @@ -0,0 +1,97 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions new-expression-type-arguments Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "a", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + init: NewExpression { + type: "NewExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "A", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "B", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ], + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [83, 93], + loc: { + start: { column: 10, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [79, 93], + loc: { + start: { column: 6, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + kind: "const", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..52d38075a220 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions new-expression-type-arguments Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "const", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [83, 86], + loc: { + start: { column: 10, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..09f148a90833 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions new-expression-type-arguments AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..c510e9a247b8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions new-expression-type-arguments AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/fixture.ts b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/fixture.ts new file mode 100644 index 000000000000..b9461318032d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/fixture.ts @@ -0,0 +1,4 @@ +// TODO: This fixture might be too large, and if so should be split up. + +foo?.bar(); +foo?.bar(); diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..baeff97c25d8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,186 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions optional-call-expression-type-arguments TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "foo", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "bar", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + optional: false, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + ], + + range: [81, 84], + loc: { + start: { column: 8, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [73, 86], + loc: { + start: { column: 0, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 86], + loc: { + start: { column: 0, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 87], + loc: { + start: { column: 0, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "foo", + + range: [88, 91], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "bar", + + range: [93, 96], + loc: { + start: { column: 5, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + + range: [88, 96], + loc: { + start: { column: 0, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + optional: false, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [97, 103], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + ], + + range: [96, 104], + loc: { + start: { column: 8, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [88, 106], + loc: { + start: { column: 0, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [88, 106], + loc: { + start: { column: 0, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [88, 107], + loc: { + start: { column: 0, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..87b1e73ce88a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,186 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions optional-call-expression-type-arguments TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [76, 78], + loc: { + start: { column: 3, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [88, 91], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [91, 93], + loc: { + start: { column: 3, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [93, 96], + loc: { + start: { column: 5, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [96, 97], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [97, 103], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [103, 104], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [104, 105], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [105, 106], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [106, 107], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..c01448e4374e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/3-Babel-AST.shot @@ -0,0 +1,186 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions optional-call-expression-type-arguments Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "foo", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "bar", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [73, 81], + loc: { + start: { column: 0, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + optional: false, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + ], + + range: [81, 84], + loc: { + start: { column: 8, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [73, 86], + loc: { + start: { column: 0, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 86], + loc: { + start: { column: 0, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 87], + loc: { + start: { column: 0, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ExpressionStatement { + type: "ExpressionStatement", + expression: ChainExpression { + type: "ChainExpression", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "foo", + + range: [88, 91], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + optional: true, + property: Identifier { + type: "Identifier", + name: "bar", + + range: [93, 96], + loc: { + start: { column: 5, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + + range: [88, 96], + loc: { + start: { column: 0, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + optional: false, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [97, 103], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + ], + + range: [96, 104], + loc: { + start: { column: 8, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [88, 106], + loc: { + start: { column: 0, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [88, 106], + loc: { + start: { column: 0, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [88, 107], + loc: { + start: { column: 0, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..d2db3dd59b90 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,186 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions optional-call-expression-type-arguments Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [76, 78], + loc: { + start: { column: 3, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [88, 91], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?.", + + range: [91, 93], + loc: { + start: { column: 3, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [93, 96], + loc: { + start: { column: 5, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [96, 97], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [97, 103], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [103, 104], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [104, 105], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [105, 106], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [106, 107], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..f0db811ffaff --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions optional-call-expression-type-arguments AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..b62d5ec547c8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions optional-call-expression-type-arguments AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/fixture.ts b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/fixture.ts new file mode 100644 index 000000000000..fae5cc4c6c4a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +foo`baz`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..532981ae1344 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,100 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions tagged-template-expression-type-arguments TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TaggedTemplateExpression { + type: "TaggedTemplateExpression", + quasi: TemplateLiteral { + type: "TemplateLiteral", + expressions: Array [], + quasis: Array [ + TemplateElement { + type: "TemplateElement", + tail: true, + value: Object { + "cooked": "baz", + "raw": "baz", + }, + + range: [81, 86], + loc: { + start: { column: 8, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + ], + + range: [81, 86], + loc: { + start: { column: 8, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + tag: Identifier { + type: "Identifier", + name: "foo", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "bar", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + ], + + range: [76, 81], + loc: { + start: { column: 3, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [73, 86], + loc: { + start: { column: 0, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 87], + loc: { + start: { column: 0, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 88], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..734cf5c78d79 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions tagged-template-expression-type-arguments TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [76, 77], + loc: { + start: { column: 3, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Template { + type: "Template", + value: "\`baz\`", + + range: [81, 86], + loc: { + start: { column: 8, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..c0b905dad1a5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/3-Babel-AST.shot @@ -0,0 +1,100 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions tagged-template-expression-type-arguments Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TaggedTemplateExpression { + type: "TaggedTemplateExpression", + quasi: TemplateLiteral { + type: "TemplateLiteral", + expressions: Array [], + quasis: Array [ + TemplateElement { + type: "TemplateElement", + tail: true, + value: Object { + "cooked": "baz", + "raw": "baz", + }, + + range: [81, 86], + loc: { + start: { column: 8, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + ], + + range: [81, 86], + loc: { + start: { column: 8, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + tag: Identifier { + type: "Identifier", + name: "foo", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "bar", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + ], + + range: [76, 81], + loc: { + start: { column: 3, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [73, 86], + loc: { + start: { column: 0, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + + range: [73, 87], + loc: { + start: { column: 0, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 88], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..8706e7480f11 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions tagged-template-expression-type-arguments Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [76, 77], + loc: { + start: { column: 3, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Template { + type: "Template", + value: "\`baz\`", + + range: [81, 86], + loc: { + start: { column: 8, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..63ff0bf8c59c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions tagged-template-expression-type-arguments AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..a69096495779 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures expressions tagged-template-expression-type-arguments AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/fixture.ts b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/fixture.ts new file mode 100644 index 000000000000..b3a773dd47db --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class B { + @onlyRead(false) + instanceMethod() {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..f4e1f8a04eda --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,138 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory-instance-member TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Literal { + type: "Literal", + raw: "false", + value: false, + + range: [95, 100], + loc: { + start: { column: 12, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "onlyRead", + + range: [86, 94], + loc: { + start: { column: 3, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + optional: false, + + range: [86, 101], + loc: { + start: { column: 3, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [85, 101], + loc: { + start: { column: 2, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "instanceMethod", + + range: [104, 118], + loc: { + start: { column: 2, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [121, 123], + loc: { + start: { column: 19, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [118, 123], + loc: { + start: { column: 16, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + + range: [85, 123], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 5 }, + }, + }, + ], + + range: [81, 125], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "B", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 125], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 126], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..993d3399e2c4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory-instance-member TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [85, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "onlyRead", + + range: [86, 94], + loc: { + start: { column: 3, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [94, 95], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Boolean { + type: "Boolean", + value: "false", + + range: [95, 100], + loc: { + start: { column: 12, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [100, 101], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "instanceMethod", + + range: [104, 118], + loc: { + start: { column: 2, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [118, 119], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [119, 120], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [121, 122], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [122, 123], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [124, 125], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..fd6cc578fe21 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/3-Babel-AST.shot @@ -0,0 +1,137 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory-instance-member Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Literal { + type: "Literal", + raw: "false", + value: false, + + range: [95, 100], + loc: { + start: { column: 12, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "onlyRead", + + range: [86, 94], + loc: { + start: { column: 3, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + optional: false, + + range: [86, 101], + loc: { + start: { column: 3, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [85, 101], + loc: { + start: { column: 2, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "instanceMethod", + + range: [104, 118], + loc: { + start: { column: 2, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [121, 123], + loc: { + start: { column: 19, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [118, 123], + loc: { + start: { column: 16, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + + range: [85, 123], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 5 }, + }, + }, + ], + + range: [81, 125], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "B", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 125], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 126], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..265530c0bf96 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory-instance-member Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [85, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "onlyRead", + + range: [86, 94], + loc: { + start: { column: 3, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [94, 95], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Boolean { + type: "Boolean", + value: "false", + + range: [95, 100], + loc: { + start: { column: 12, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [100, 101], + loc: { + start: { column: 17, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "instanceMethod", + + range: [104, 118], + loc: { + start: { column: 2, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [118, 119], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [119, 120], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [121, 122], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [122, 123], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [124, 125], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..a4c8ddcb124c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,142 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory-instance-member AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + decorators: Array [ + Decorator { + type: 'Decorator', + expression: CallExpression { + type: 'CallExpression', + arguments: Array [ + Literal { + type: 'Literal', + raw: 'false', + value: false, + + range: [95, 100], + loc: { + start: { column: 12, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + ], + callee: Identifier { + type: 'Identifier', + name: 'onlyRead', + + range: [86, 94], + loc: { + start: { column: 3, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + optional: false, + + range: [86, 101], + loc: { + start: { column: 3, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [85, 101], + loc: { + start: { column: 2, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + ], + key: Identifier { + type: 'Identifier', + name: 'instanceMethod', + + range: [104, 118], + loc: { + start: { column: 2, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [121, 123], + loc: { + start: { column: 19, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [118, 123], + loc: { + start: { column: 16, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + + range: [85, 123], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 5 }, + }, + }, + ], + + range: [81, 125], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'B', + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 125], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 126], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..abc089a5eb94 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory-instance-member AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/fixture.ts b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/fixture.ts new file mode 100644 index 000000000000..bef67c4fe7b0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class C { + @Foo(false) + static staticMethod() {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..cb404acaf120 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,138 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory-static-member TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Literal { + type: "Literal", + raw: "false", + value: false, + + range: [90, 95], + loc: { + start: { column: 7, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "Foo", + + range: [86, 89], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + optional: false, + + range: [86, 96], + loc: { + start: { column: 3, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [85, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "staticMethod", + + range: [106, 118], + loc: { + start: { column: 9, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + kind: "method", + override: false, + static: true, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [121, 123], + loc: { + start: { column: 24, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [118, 123], + loc: { + start: { column: 21, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + + range: [85, 123], + loc: { + start: { column: 2, line: 4 }, + end: { column: 26, line: 5 }, + }, + }, + ], + + range: [81, 125], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "C", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 125], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 126], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..05b2b67a0e3f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory-static-member TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [85, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [86, 89], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [89, 90], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Boolean { + type: "Boolean", + value: "false", + + range: [90, 95], + loc: { + start: { column: 7, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [95, 96], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [99, 105], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "staticMethod", + + range: [106, 118], + loc: { + start: { column: 9, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [118, 119], + loc: { + start: { column: 21, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [119, 120], + loc: { + start: { column: 22, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [121, 122], + loc: { + start: { column: 24, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [122, 123], + loc: { + start: { column: 25, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [124, 125], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..679c8a074a86 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/3-Babel-AST.shot @@ -0,0 +1,137 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory-static-member Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Literal { + type: "Literal", + raw: "false", + value: false, + + range: [90, 95], + loc: { + start: { column: 7, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "Foo", + + range: [86, 89], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + optional: false, + + range: [86, 96], + loc: { + start: { column: 3, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [85, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "staticMethod", + + range: [106, 118], + loc: { + start: { column: 9, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + kind: "method", + static: true, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [121, 123], + loc: { + start: { column: 24, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [118, 123], + loc: { + start: { column: 21, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + + range: [85, 123], + loc: { + start: { column: 2, line: 4 }, + end: { column: 26, line: 5 }, + }, + }, + ], + + range: [81, 125], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "C", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 125], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 126], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..9b88d5ab4b3f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory-static-member Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [85, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [86, 89], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [89, 90], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Boolean { + type: "Boolean", + value: "false", + + range: [90, 95], + loc: { + start: { column: 7, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [95, 96], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [99, 105], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "staticMethod", + + range: [106, 118], + loc: { + start: { column: 9, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [118, 119], + loc: { + start: { column: 21, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [119, 120], + loc: { + start: { column: 22, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [121, 122], + loc: { + start: { column: 24, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [122, 123], + loc: { + start: { column: 25, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [124, 125], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..1e97f5d5c088 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,142 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory-static-member AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + decorators: Array [ + Decorator { + type: 'Decorator', + expression: CallExpression { + type: 'CallExpression', + arguments: Array [ + Literal { + type: 'Literal', + raw: 'false', + value: false, + + range: [90, 95], + loc: { + start: { column: 7, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + ], + callee: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [86, 89], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + optional: false, + + range: [86, 96], + loc: { + start: { column: 3, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + + range: [85, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + ], + key: Identifier { + type: 'Identifier', + name: 'staticMethod', + + range: [106, 118], + loc: { + start: { column: 9, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + kind: 'method', +- override: false, + static: true, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [121, 123], + loc: { + start: { column: 24, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [118, 123], + loc: { + start: { column: 21, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + + range: [85, 123], + loc: { + start: { column: 2, line: 4 }, + end: { column: 26, line: 5 }, + }, + }, + ], + + range: [81, 125], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'C', + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 125], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 126], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..eaf3927aba7d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory-static-member AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/fixture.ts b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/fixture.ts new file mode 100644 index 000000000000..335acd832720 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class A { + @onlyRead + instanceMethod() {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..68f9a1e928f2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,115 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-instance-member TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "onlyRead", + + range: [86, 94], + loc: { + start: { column: 3, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + + range: [85, 94], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "instanceMethod", + + range: [97, 111], + loc: { + start: { column: 2, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [114, 116], + loc: { + start: { column: 19, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [111, 116], + loc: { + start: { column: 16, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + + range: [85, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 5 }, + }, + }, + ], + + range: [81, 118], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "A", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 119], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..2a2893d47871 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-instance-member TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [85, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "onlyRead", + + range: [86, 94], + loc: { + start: { column: 3, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "instanceMethod", + + range: [97, 111], + loc: { + start: { column: 2, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [111, 112], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [112, 113], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [114, 115], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [115, 116], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [117, 118], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..56178003948d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/3-Babel-AST.shot @@ -0,0 +1,114 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-instance-member Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "onlyRead", + + range: [86, 94], + loc: { + start: { column: 3, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + + range: [85, 94], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "instanceMethod", + + range: [97, 111], + loc: { + start: { column: 2, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [114, 116], + loc: { + start: { column: 19, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [111, 116], + loc: { + start: { column: 16, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + + range: [85, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 5 }, + }, + }, + ], + + range: [81, 118], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "A", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 119], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..78f289479673 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-instance-member Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [85, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "onlyRead", + + range: [86, 94], + loc: { + start: { column: 3, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "instanceMethod", + + range: [97, 111], + loc: { + start: { column: 2, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [111, 112], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [112, 113], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [114, 115], + loc: { + start: { column: 19, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [115, 116], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [117, 118], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..fa544c6a3e88 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,119 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-instance-member AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + decorators: Array [ + Decorator { + type: 'Decorator', + expression: Identifier { + type: 'Identifier', + name: 'onlyRead', + + range: [86, 94], + loc: { + start: { column: 3, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + + range: [85, 94], + loc: { + start: { column: 2, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ], + key: Identifier { + type: 'Identifier', + name: 'instanceMethod', + + range: [97, 111], + loc: { + start: { column: 2, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [114, 116], + loc: { + start: { column: 19, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [111, 116], + loc: { + start: { column: 16, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + + range: [85, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 5 }, + }, + }, + ], + + range: [81, 118], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'A', + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 119], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..e55bf1de6b00 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-instance-member AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/fixture.ts b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/fixture.ts new file mode 100644 index 000000000000..c993e483af84 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class D { + @Foo + static staticMethod() {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..50f63095d101 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,115 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-static-member TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "Foo", + + range: [86, 89], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + + range: [85, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "staticMethod", + + range: [99, 111], + loc: { + start: { column: 9, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + kind: "method", + override: false, + static: true, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [114, 116], + loc: { + start: { column: 24, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [111, 116], + loc: { + start: { column: 21, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + + range: [85, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 26, line: 5 }, + }, + }, + ], + + range: [81, 118], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "D", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 119], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..573dca91dc5b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-static-member TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "D", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [85, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [86, 89], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [92, 98], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "staticMethod", + + range: [99, 111], + loc: { + start: { column: 9, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [111, 112], + loc: { + start: { column: 21, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [112, 113], + loc: { + start: { column: 22, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [114, 115], + loc: { + start: { column: 24, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [115, 116], + loc: { + start: { column: 25, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [117, 118], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..708edc7ffbe0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/3-Babel-AST.shot @@ -0,0 +1,114 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-static-member Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "Foo", + + range: [86, 89], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + + range: [85, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "staticMethod", + + range: [99, 111], + loc: { + start: { column: 9, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + kind: "method", + static: true, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [114, 116], + loc: { + start: { column: 24, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [111, 116], + loc: { + start: { column: 21, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + + range: [85, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 26, line: 5 }, + }, + }, + ], + + range: [81, 118], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "D", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 119], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..0ff4d2265a79 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-static-member Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "D", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [85, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [86, 89], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [92, 98], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "staticMethod", + + range: [99, 111], + loc: { + start: { column: 9, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [111, 112], + loc: { + start: { column: 21, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [112, 113], + loc: { + start: { column: 22, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [114, 115], + loc: { + start: { column: 24, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [115, 116], + loc: { + start: { column: 25, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [117, 118], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..4b4f60f3ffa6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,119 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-static-member AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + decorators: Array [ + Decorator { + type: 'Decorator', + expression: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [86, 89], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + + range: [85, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + ], + key: Identifier { + type: 'Identifier', + name: 'staticMethod', + + range: [99, 111], + loc: { + start: { column: 9, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + kind: 'method', +- override: false, + static: true, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [114, 116], + loc: { + start: { column: 24, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [111, 116], + loc: { + start: { column: 21, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + + range: [85, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 26, line: 5 }, + }, + }, + ], + + range: [81, 118], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'D', + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 119], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..c338191d7b83 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-static-member AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/fixture.ts b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/fixture.ts new file mode 100644 index 000000000000..004a3b18df7f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +declare module 'i-use-things' { + import fs from 'fs'; +} diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..392a9c23b52d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,91 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules ambient-module-declaration-with-import TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [ + ImportDeclaration { + type: "ImportDeclaration", + assertions: Array [], + importKind: "value", + source: Literal { + type: "Literal", + raw: "'fs'", + value: "fs", + + range: [122, 126], + loc: { + start: { column: 17, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + specifiers: Array [ + ImportDefaultSpecifier { + type: "ImportDefaultSpecifier", + local: Identifier { + type: "Identifier", + name: "fs", + + range: [114, 116], + loc: { + start: { column: 9, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + + range: [114, 116], + loc: { + start: { column: 9, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ], + + range: [107, 127], + loc: { + start: { column: 2, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + ], + + range: [103, 129], + loc: { + start: { column: 30, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + declare: true, + id: Literal { + type: "Literal", + raw: "'i-use-things'", + value: "i-use-things", + + range: [88, 102], + loc: { + start: { column: 15, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [73, 129], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 130], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..7719fbe97d83 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules ambient-module-declaration-with-import TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "module", + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + String { + type: "String", + value: "'i-use-things'", + + range: [88, 102], + loc: { + start: { column: 15, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "import", + + range: [107, 113], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "fs", + + range: [114, 116], + loc: { + start: { column: 9, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [117, 121], + loc: { + start: { column: 12, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + String { + type: "String", + value: "'fs'", + + range: [122, 126], + loc: { + start: { column: 17, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [126, 127], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [128, 129], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..a87aeb3998ae --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/3-Babel-AST.shot @@ -0,0 +1,91 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules ambient-module-declaration-with-import Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [ + ImportDeclaration { + type: "ImportDeclaration", + assertions: Array [], + importKind: "value", + source: Literal { + type: "Literal", + raw: "'fs'", + value: "fs", + + range: [122, 126], + loc: { + start: { column: 17, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + specifiers: Array [ + ImportDefaultSpecifier { + type: "ImportDefaultSpecifier", + local: Identifier { + type: "Identifier", + name: "fs", + + range: [114, 116], + loc: { + start: { column: 9, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + + range: [114, 116], + loc: { + start: { column: 9, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ], + + range: [107, 127], + loc: { + start: { column: 2, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + ], + + range: [103, 129], + loc: { + start: { column: 30, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + declare: true, + id: Literal { + type: "Literal", + raw: "'i-use-things'", + value: "i-use-things", + + range: [88, 102], + loc: { + start: { column: 15, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [73, 129], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "module", + + range: [73, 130], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..ebadef958520 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules ambient-module-declaration-with-import Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "module", + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + String { + type: "String", + value: "'i-use-things'", + + range: [88, 102], + loc: { + start: { column: 15, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "import", + + range: [107, 113], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "fs", + + range: [114, 116], + loc: { + start: { column: 9, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [117, 121], + loc: { + start: { column: 12, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + String { + type: "String", + value: "'fs'", + + range: [122, 126], + loc: { + start: { column: 17, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [126, 127], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [128, 129], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..42caff8c0fd1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules ambient-module-declaration-with-import AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleBlock { + type: 'TSModuleBlock', + body: Array [ + ImportDeclaration { + type: 'ImportDeclaration', + assertions: Array [], + importKind: 'value', + source: Literal { + type: 'Literal', + raw: '\\\\'fs\\\\'', + value: 'fs', + + range: [122, 126], + loc: { + start: { column: 17, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + specifiers: Array [ + ImportDefaultSpecifier { + type: 'ImportDefaultSpecifier', + local: Identifier { + type: 'Identifier', + name: 'fs', + + range: [114, 116], + loc: { + start: { column: 9, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + + range: [114, 116], + loc: { + start: { column: 9, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + ], + + range: [107, 127], + loc: { + start: { column: 2, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + ], + + range: [103, 129], + loc: { + start: { column: 30, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + declare: true, + id: Literal { + type: 'Literal', + raw: '\\\\'i-use-things\\\\'', + value: 'i-use-things', + + range: [88, 102], + loc: { + start: { column: 15, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [73, 129], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], +- sourceType: 'script', ++ sourceType: 'module', + + range: [73, 130], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..c3c2fd24f209 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules ambient-module-declaration-with-import AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/fixture.ts b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/fixture.ts new file mode 100644 index 000000000000..9ad2a27a14ed --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +declare namespace d3 { + export function select(selector: string): Selection; +} diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..543c0266dc83 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,160 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules declare-namespace-with-exported-function TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSDeclareFunction { + type: "TSDeclareFunction", + async: false, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "select", + + range: [114, 120], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "selector", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [131, 137], + loc: { + start: { column: 35, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + + range: [129, 137], + loc: { + start: { column: 33, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + + range: [121, 137], + loc: { + start: { column: 25, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Selection", + + range: [140, 149], + loc: { + start: { column: 44, line: 4 }, + end: { column: 53, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSAnyKeyword { + type: "TSAnyKeyword", + + range: [150, 153], + loc: { + start: { column: 54, line: 4 }, + end: { column: 57, line: 4 }, + }, + }, + ], + + range: [149, 154], + loc: { + start: { column: 53, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + + range: [140, 154], + loc: { + start: { column: 44, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + + range: [138, 154], + loc: { + start: { column: 42, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + + range: [105, 155], + loc: { + start: { column: 9, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [98, 155], + loc: { + start: { column: 2, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + ], + + range: [94, 157], + loc: { + start: { column: 21, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + declare: true, + id: Identifier { + type: "Identifier", + name: "d3", + + range: [91, 93], + loc: { + start: { column: 18, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [73, 157], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 158], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..f42cf348c256 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,196 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules declare-namespace-with-exported-function TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "namespace", + + range: [81, 90], + loc: { + start: { column: 8, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "d3", + + range: [91, 93], + loc: { + start: { column: 18, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "export", + + range: [98, 104], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [105, 113], + loc: { + start: { column: 9, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "select", + + range: [114, 120], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [120, 121], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "selector", + + range: [121, 129], + loc: { + start: { column: 25, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [129, 130], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [131, 137], + loc: { + start: { column: 35, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [137, 138], + loc: { + start: { column: 41, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [138, 139], + loc: { + start: { column: 42, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Selection", + + range: [140, 149], + loc: { + start: { column: 44, line: 4 }, + end: { column: 53, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [149, 150], + loc: { + start: { column: 53, line: 4 }, + end: { column: 54, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [150, 153], + loc: { + start: { column: 54, line: 4 }, + end: { column: 57, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [153, 154], + loc: { + start: { column: 57, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [154, 155], + loc: { + start: { column: 58, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [156, 157], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..d153d51196f0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/3-Babel-AST.shot @@ -0,0 +1,160 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules declare-namespace-with-exported-function Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSDeclareFunction { + type: "TSDeclareFunction", + async: false, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "select", + + range: [114, 120], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + params: Array [ + Identifier { + type: "Identifier", + name: "selector", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [131, 137], + loc: { + start: { column: 35, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + + range: [129, 137], + loc: { + start: { column: 33, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + + range: [121, 137], + loc: { + start: { column: 25, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Selection", + + range: [140, 149], + loc: { + start: { column: 44, line: 4 }, + end: { column: 53, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSAnyKeyword { + type: "TSAnyKeyword", + + range: [150, 153], + loc: { + start: { column: 54, line: 4 }, + end: { column: 57, line: 4 }, + }, + }, + ], + + range: [149, 154], + loc: { + start: { column: 53, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + + range: [140, 154], + loc: { + start: { column: 44, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + + range: [138, 154], + loc: { + start: { column: 42, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + + range: [105, 155], + loc: { + start: { column: 9, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [98, 155], + loc: { + start: { column: 2, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + ], + + range: [94, 157], + loc: { + start: { column: 21, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + declare: true, + id: Identifier { + type: "Identifier", + name: "d3", + + range: [91, 93], + loc: { + start: { column: 18, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [73, 157], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "module", + + range: [73, 158], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..3461c38ebce4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,196 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules declare-namespace-with-exported-function Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "namespace", + + range: [81, 90], + loc: { + start: { column: 8, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "d3", + + range: [91, 93], + loc: { + start: { column: 18, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "export", + + range: [98, 104], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [105, 113], + loc: { + start: { column: 9, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "select", + + range: [114, 120], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [120, 121], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "selector", + + range: [121, 129], + loc: { + start: { column: 25, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [129, 130], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [131, 137], + loc: { + start: { column: 35, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [137, 138], + loc: { + start: { column: 41, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [138, 139], + loc: { + start: { column: 42, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Selection", + + range: [140, 149], + loc: { + start: { column: 44, line: 4 }, + end: { column: 53, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [149, 150], + loc: { + start: { column: 53, line: 4 }, + end: { column: 54, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [150, 153], + loc: { + start: { column: 54, line: 4 }, + end: { column: 57, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [153, 154], + loc: { + start: { column: 57, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [154, 155], + loc: { + start: { column: 58, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [156, 157], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..4e3ae3412850 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,165 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules declare-namespace-with-exported-function AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleBlock { + type: 'TSModuleBlock', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: TSDeclareFunction { + type: 'TSDeclareFunction', + async: false, + expression: false, + generator: false, + id: Identifier { + type: 'Identifier', + name: 'select', + + range: [114, 120], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + params: Array [ + Identifier { + type: 'Identifier', + name: 'selector', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [131, 137], + loc: { + start: { column: 35, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + + range: [129, 137], + loc: { + start: { column: 33, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + + range: [121, 137], + loc: { + start: { column: 25, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'Selection', + + range: [140, 149], + loc: { + start: { column: 44, line: 4 }, + end: { column: 53, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSAnyKeyword { + type: 'TSAnyKeyword', + + range: [150, 153], + loc: { + start: { column: 54, line: 4 }, + end: { column: 57, line: 4 }, + }, + }, + ], + + range: [149, 154], + loc: { + start: { column: 53, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + + range: [140, 154], + loc: { + start: { column: 44, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + + range: [138, 154], + loc: { + start: { column: 42, line: 4 }, + end: { column: 58, line: 4 }, + }, + }, + + range: [105, 155], + loc: { + start: { column: 9, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + exportKind: 'value', + source: null, + specifiers: Array [], + + range: [98, 155], + loc: { + start: { column: 2, line: 4 }, + end: { column: 59, line: 4 }, + }, + }, + ], + + range: [94, 157], + loc: { + start: { column: 21, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + declare: true, + id: Identifier { + type: 'Identifier', + name: 'd3', + + range: [91, 93], + loc: { + start: { column: 18, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [73, 157], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], +- sourceType: 'script', ++ sourceType: 'module', + + range: [73, 158], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..158b1ca152a7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules declare-namespace-with-exported-function AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/fixture.ts b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/fixture.ts new file mode 100644 index 000000000000..d5e37198cac1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +declare global { + declare module global {} + declare namespace global {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..c44bb057e429 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,108 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules global-module-declaration TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [], + + range: [114, 116], + loc: { + start: { column: 24, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + declare: true, + id: Identifier { + type: "Identifier", + name: "global", + + range: [107, 113], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [92, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [], + + range: [144, 146], + loc: { + start: { column: 27, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + declare: true, + id: Identifier { + type: "Identifier", + name: "global", + + range: [137, 143], + loc: { + start: { column: 20, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + + range: [119, 146], + loc: { + start: { column: 2, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + ], + + range: [88, 148], + loc: { + start: { column: 15, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + declare: true, + global: true, + id: Identifier { + type: "Identifier", + name: "global", + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [73, 148], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 149], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..fa644bf41cc2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules global-module-declaration TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "global", + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [92, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "module", + + range: [100, 106], + loc: { + start: { column: 10, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "global", + + range: [107, 113], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [114, 115], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [115, 116], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [119, 126], + loc: { + start: { column: 2, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "namespace", + + range: [127, 136], + loc: { + start: { column: 10, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "global", + + range: [137, 143], + loc: { + start: { column: 20, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [144, 145], + loc: { + start: { column: 27, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [145, 146], + loc: { + start: { column: 28, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [147, 148], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..138b3944413d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/3-Babel-AST.shot @@ -0,0 +1,108 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules global-module-declaration Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [], + + range: [114, 116], + loc: { + start: { column: 24, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + declare: true, + id: Identifier { + type: "Identifier", + name: "global", + + range: [107, 113], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [92, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [], + + range: [144, 146], + loc: { + start: { column: 27, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + declare: true, + id: Identifier { + type: "Identifier", + name: "global", + + range: [137, 143], + loc: { + start: { column: 20, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + + range: [119, 146], + loc: { + start: { column: 2, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + ], + + range: [88, 148], + loc: { + start: { column: 15, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + declare: true, + global: true, + id: Identifier { + type: "Identifier", + name: "global", + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [73, 148], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 149], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..dcc869e00d23 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules global-module-declaration Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "global", + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [92, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "module", + + range: [100, 106], + loc: { + start: { column: 10, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "global", + + range: [107, 113], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [114, 115], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [115, 116], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [119, 126], + loc: { + start: { column: 2, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "namespace", + + range: [127, 136], + loc: { + start: { column: 10, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "global", + + range: [137, 143], + loc: { + start: { column: 20, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [144, 145], + loc: { + start: { column: 27, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [145, 146], + loc: { + start: { column: 28, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [147, 148], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..33e8853dea71 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules global-module-declaration AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..647df35d73ea --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules global-module-declaration AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/fixture.ts b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/fixture.ts new file mode 100644 index 000000000000..f7cee0116ea0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/fixture.ts @@ -0,0 +1,8 @@ +// TODO: This fixture might be too large, and if so should be split up. + +module 'foo' { + export default class C { + method(): C {} + } + export default function bar() {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..57b0ed0ed584 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,206 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules module-with-default-exports TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "method", + + range: [119, 125], + loc: { + start: { column: 4, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [131, 133], + loc: { + start: { column: 16, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "C", + + range: [129, 130], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [129, 130], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [127, 130], + loc: { + start: { column: 12, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [125, 133], + loc: { + start: { column: 10, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + + range: [119, 133], + loc: { + start: { column: 4, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + ], + + range: [113, 137], + loc: { + start: { column: 25, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "C", + + range: [111, 112], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + superClass: null, + + range: [105, 137], + loc: { + start: { column: 17, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + exportKind: "value", + + range: [90, 137], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [170, 172], + loc: { + start: { column: 32, line: 7 }, + end: { column: 34, line: 7 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "bar", + + range: [164, 167], + loc: { + start: { column: 26, line: 7 }, + end: { column: 29, line: 7 }, + }, + }, + params: Array [], + + range: [155, 172], + loc: { + start: { column: 17, line: 7 }, + end: { column: 34, line: 7 }, + }, + }, + exportKind: "value", + + range: [140, 172], + loc: { + start: { column: 2, line: 7 }, + end: { column: 34, line: 7 }, + }, + }, + ], + + range: [86, 174], + loc: { + start: { column: 13, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Literal { + type: "Literal", + raw: "'foo'", + value: "foo", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [73, 174], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], + sourceType: "script", + + range: [73, 175], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..c89588013c92 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,256 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules module-with-default-exports TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "module", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + String { + type: "String", + value: "'foo'", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "export", + + range: [90, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [97, 104], + loc: { + start: { column: 9, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [105, 110], + loc: { + start: { column: 17, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [111, 112], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [113, 114], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "method", + + range: [119, 125], + loc: { + start: { column: 4, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [125, 126], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [126, 127], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [127, 128], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [129, 130], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [131, 132], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [132, 133], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [136, 137], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "export", + + range: [140, 146], + loc: { + start: { column: 2, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [147, 154], + loc: { + start: { column: 9, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [155, 163], + loc: { + start: { column: 17, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [164, 167], + loc: { + start: { column: 26, line: 7 }, + end: { column: 29, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [167, 168], + loc: { + start: { column: 29, line: 7 }, + end: { column: 30, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [168, 169], + loc: { + start: { column: 30, line: 7 }, + end: { column: 31, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [170, 171], + loc: { + start: { column: 32, line: 7 }, + end: { column: 33, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [171, 172], + loc: { + start: { column: 33, line: 7 }, + end: { column: 34, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [173, 174], + loc: { + start: { column: 0, line: 8 }, + end: { column: 1, line: 8 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..9938ec6227ce --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/3-Babel-AST.shot @@ -0,0 +1,205 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules module-with-default-exports Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "method", + + range: [119, 125], + loc: { + start: { column: 4, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [131, 133], + loc: { + start: { column: 16, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "C", + + range: [129, 130], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [129, 130], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [127, 130], + loc: { + start: { column: 12, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [125, 133], + loc: { + start: { column: 10, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + + range: [119, 133], + loc: { + start: { column: 4, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + ], + + range: [113, 137], + loc: { + start: { column: 25, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "C", + + range: [111, 112], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + superClass: null, + + range: [105, 137], + loc: { + start: { column: 17, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + exportKind: "value", + + range: [90, 137], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [170, 172], + loc: { + start: { column: 32, line: 7 }, + end: { column: 34, line: 7 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "bar", + + range: [164, 167], + loc: { + start: { column: 26, line: 7 }, + end: { column: 29, line: 7 }, + }, + }, + params: Array [], + + range: [155, 172], + loc: { + start: { column: 17, line: 7 }, + end: { column: 34, line: 7 }, + }, + }, + exportKind: "value", + + range: [140, 172], + loc: { + start: { column: 2, line: 7 }, + end: { column: 34, line: 7 }, + }, + }, + ], + + range: [86, 174], + loc: { + start: { column: 13, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Literal { + type: "Literal", + raw: "'foo'", + value: "foo", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [73, 174], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], + sourceType: "module", + + range: [73, 175], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..5994aef52bcc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,256 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules module-with-default-exports Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "module", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + String { + type: "String", + value: "'foo'", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "export", + + range: [90, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [97, 104], + loc: { + start: { column: 9, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [105, 110], + loc: { + start: { column: 17, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [111, 112], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [113, 114], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "method", + + range: [119, 125], + loc: { + start: { column: 4, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [125, 126], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [126, 127], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [127, 128], + loc: { + start: { column: 12, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [129, 130], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [131, 132], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [132, 133], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [136, 137], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "export", + + range: [140, 146], + loc: { + start: { column: 2, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [147, 154], + loc: { + start: { column: 9, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [155, 163], + loc: { + start: { column: 17, line: 7 }, + end: { column: 25, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [164, 167], + loc: { + start: { column: 26, line: 7 }, + end: { column: 29, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [167, 168], + loc: { + start: { column: 29, line: 7 }, + end: { column: 30, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [168, 169], + loc: { + start: { column: 30, line: 7 }, + end: { column: 31, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [170, 171], + loc: { + start: { column: 32, line: 7 }, + end: { column: 33, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [171, 172], + loc: { + start: { column: 33, line: 7 }, + end: { column: 34, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [173, 174], + loc: { + start: { column: 0, line: 8 }, + end: { column: 1, line: 8 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..f7882ef62079 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,211 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules module-with-default-exports AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleBlock { + type: 'TSModuleBlock', + body: Array [ + ExportDefaultDeclaration { + type: 'ExportDefaultDeclaration', + declaration: ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'method', + + range: [119, 125], + loc: { + start: { column: 4, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [131, 133], + loc: { + start: { column: 16, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'C', + + range: [129, 130], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [129, 130], + loc: { + start: { column: 14, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [127, 130], + loc: { + start: { column: 12, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [125, 133], + loc: { + start: { column: 10, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + + range: [119, 133], + loc: { + start: { column: 4, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + ], + + range: [113, 137], + loc: { + start: { column: 25, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'C', + + range: [111, 112], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + superClass: null, + + range: [105, 137], + loc: { + start: { column: 17, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + exportKind: 'value', + + range: [90, 137], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + ExportDefaultDeclaration { + type: 'ExportDefaultDeclaration', + declaration: FunctionDeclaration { + type: 'FunctionDeclaration', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [170, 172], + loc: { + start: { column: 32, line: 7 }, + end: { column: 34, line: 7 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: 'Identifier', + name: 'bar', + + range: [164, 167], + loc: { + start: { column: 26, line: 7 }, + end: { column: 29, line: 7 }, + }, + }, + params: Array [], + + range: [155, 172], + loc: { + start: { column: 17, line: 7 }, + end: { column: 34, line: 7 }, + }, + }, + exportKind: 'value', + + range: [140, 172], + loc: { + start: { column: 2, line: 7 }, + end: { column: 34, line: 7 }, + }, + }, + ], + + range: [86, 174], + loc: { + start: { column: 13, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Literal { + type: 'Literal', + raw: '\\\\'foo\\\\'', + value: 'foo', + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [73, 174], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], +- sourceType: 'script', ++ sourceType: 'module', + + range: [73, 175], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..baff20b51396 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules module-with-default-exports AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/fixture.ts b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/fixture.ts new file mode 100644 index 000000000000..fb115370b27e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/fixture.ts @@ -0,0 +1,13 @@ +// TODO: This fixture might be too large, and if so should be split up. + +module A { + export var x = 'hello world'; + export class Point { + constructor(public x: number, public y: number) {} + } + export module B { + export interface Id { + name: string; + } + } +} diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..d2b129beb751 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,393 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-module TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + + range: [97, 98], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + init: Literal { + type: "Literal", + raw: "'hello world'", + value: "hello world", + + range: [101, 114], + loc: { + start: { column: 17, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + + range: [97, 114], + loc: { + start: { column: 13, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + ], + kind: "var", + + range: [93, 115], + loc: { + start: { column: 9, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [86, 115], + loc: { + start: { column: 2, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [143, 154], + loc: { + start: { column: 4, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + kind: "constructor", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [191, 193], + loc: { + start: { column: 52, line: 6 }, + end: { column: 54, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "public", + parameter: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [165, 171], + loc: { + start: { column: 26, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + + range: [163, 171], + loc: { + start: { column: 24, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + + range: [162, 171], + loc: { + start: { column: 23, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + + range: [155, 171], + loc: { + start: { column: 16, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "public", + parameter: Identifier { + type: "Identifier", + name: "y", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [183, 189], + loc: { + start: { column: 44, line: 6 }, + end: { column: 50, line: 6 }, + }, + }, + + range: [181, 189], + loc: { + start: { column: 42, line: 6 }, + end: { column: 50, line: 6 }, + }, + }, + + range: [180, 189], + loc: { + start: { column: 41, line: 6 }, + end: { column: 50, line: 6 }, + }, + }, + + range: [173, 189], + loc: { + start: { column: 34, line: 6 }, + end: { column: 50, line: 6 }, + }, + }, + ], + + range: [154, 193], + loc: { + start: { column: 15, line: 6 }, + end: { column: 54, line: 6 }, + }, + }, + + range: [143, 193], + loc: { + start: { column: 4, line: 6 }, + end: { column: 54, line: 6 }, + }, + }, + ], + + range: [137, 197], + loc: { + start: { column: 21, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Point", + + range: [131, 136], + loc: { + start: { column: 15, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + superClass: null, + + range: [125, 197], + loc: { + start: { column: 9, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [118, 197], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "name", + + range: [250, 254], + loc: { + start: { column: 6, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [256, 262], + loc: { + start: { column: 12, line: 10 }, + end: { column: 18, line: 10 }, + }, + }, + + range: [254, 262], + loc: { + start: { column: 10, line: 10 }, + end: { column: 18, line: 10 }, + }, + }, + + range: [250, 263], + loc: { + start: { column: 6, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + ], + + range: [242, 269], + loc: { + start: { column: 24, line: 9 }, + end: { column: 5, line: 11 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Id", + + range: [239, 241], + loc: { + start: { column: 21, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + + range: [229, 269], + loc: { + start: { column: 11, line: 9 }, + end: { column: 5, line: 11 }, + }, + }, + exportKind: "type", + source: null, + specifiers: Array [], + + range: [222, 269], + loc: { + start: { column: 4, line: 9 }, + end: { column: 5, line: 11 }, + }, + }, + ], + + range: [216, 273], + loc: { + start: { column: 18, line: 8 }, + end: { column: 3, line: 12 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "B", + + range: [214, 215], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + + range: [207, 273], + loc: { + start: { column: 9, line: 8 }, + end: { column: 3, line: 12 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [200, 273], + loc: { + start: { column: 2, line: 8 }, + end: { column: 3, line: 12 }, + }, + }, + ], + + range: [82, 275], + loc: { + start: { column: 9, line: 3 }, + end: { column: 1, line: 13 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "A", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [73, 275], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 13 }, + }, + }, + ], + sourceType: "script", + + range: [73, 276], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 14 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..126c97819117 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,436 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-module TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "module", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "export", + + range: [86, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "var", + + range: [93, 96], + loc: { + start: { column: 9, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [97, 98], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [99, 100], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + String { + type: "String", + value: "'hello world'", + + range: [101, 114], + loc: { + start: { column: 17, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [114, 115], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "export", + + range: [118, 124], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [125, 130], + loc: { + start: { column: 9, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "Point", + + range: [131, 136], + loc: { + start: { column: 15, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [137, 138], + loc: { + start: { column: 21, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [143, 154], + loc: { + start: { column: 4, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [154, 155], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [155, 161], + loc: { + start: { column: 16, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [162, 163], + loc: { + start: { column: 23, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [163, 164], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [165, 171], + loc: { + start: { column: 26, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [171, 172], + loc: { + start: { column: 32, line: 6 }, + end: { column: 33, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [173, 179], + loc: { + start: { column: 34, line: 6 }, + end: { column: 40, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "y", + + range: [180, 181], + loc: { + start: { column: 41, line: 6 }, + end: { column: 42, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [181, 182], + loc: { + start: { column: 42, line: 6 }, + end: { column: 43, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [183, 189], + loc: { + start: { column: 44, line: 6 }, + end: { column: 50, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [189, 190], + loc: { + start: { column: 50, line: 6 }, + end: { column: 51, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [191, 192], + loc: { + start: { column: 52, line: 6 }, + end: { column: 53, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [192, 193], + loc: { + start: { column: 53, line: 6 }, + end: { column: 54, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [196, 197], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "export", + + range: [200, 206], + loc: { + start: { column: 2, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "module", + + range: [207, 213], + loc: { + start: { column: 9, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [214, 215], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [216, 217], + loc: { + start: { column: 18, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + Keyword { + type: "Keyword", + value: "export", + + range: [222, 228], + loc: { + start: { column: 4, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + Keyword { + type: "Keyword", + value: "interface", + + range: [229, 238], + loc: { + start: { column: 11, line: 9 }, + end: { column: 20, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "Id", + + range: [239, 241], + loc: { + start: { column: 21, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [242, 243], + loc: { + start: { column: 24, line: 9 }, + end: { column: 25, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "name", + + range: [250, 254], + loc: { + start: { column: 6, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [254, 255], + loc: { + start: { column: 10, line: 10 }, + end: { column: 11, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [256, 262], + loc: { + start: { column: 12, line: 10 }, + end: { column: 18, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [262, 263], + loc: { + start: { column: 18, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [268, 269], + loc: { + start: { column: 4, line: 11 }, + end: { column: 5, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [272, 273], + loc: { + start: { column: 2, line: 12 }, + end: { column: 3, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [274, 275], + loc: { + start: { column: 0, line: 13 }, + end: { column: 1, line: 13 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..fdfb3a4d9107 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/3-Babel-AST.shot @@ -0,0 +1,392 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-module Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + + range: [97, 98], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + init: Literal { + type: "Literal", + raw: "'hello world'", + value: "hello world", + + range: [101, 114], + loc: { + start: { column: 17, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + + range: [97, 114], + loc: { + start: { column: 13, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + ], + kind: "var", + + range: [93, 115], + loc: { + start: { column: 9, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [86, 115], + loc: { + start: { column: 2, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [143, 154], + loc: { + start: { column: 4, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + kind: "constructor", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [191, 193], + loc: { + start: { column: 52, line: 6 }, + end: { column: 54, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "public", + parameter: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [165, 171], + loc: { + start: { column: 26, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + + range: [163, 171], + loc: { + start: { column: 24, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + + range: [162, 171], + loc: { + start: { column: 23, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + + range: [155, 171], + loc: { + start: { column: 16, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + TSParameterProperty { + type: "TSParameterProperty", + accessibility: "public", + parameter: Identifier { + type: "Identifier", + name: "y", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [183, 189], + loc: { + start: { column: 44, line: 6 }, + end: { column: 50, line: 6 }, + }, + }, + + range: [181, 189], + loc: { + start: { column: 42, line: 6 }, + end: { column: 50, line: 6 }, + }, + }, + + range: [180, 189], + loc: { + start: { column: 41, line: 6 }, + end: { column: 50, line: 6 }, + }, + }, + + range: [173, 189], + loc: { + start: { column: 34, line: 6 }, + end: { column: 50, line: 6 }, + }, + }, + ], + + range: [154, 193], + loc: { + start: { column: 15, line: 6 }, + end: { column: 54, line: 6 }, + }, + }, + + range: [143, 193], + loc: { + start: { column: 4, line: 6 }, + end: { column: 54, line: 6 }, + }, + }, + ], + + range: [137, 197], + loc: { + start: { column: 21, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Point", + + range: [131, 136], + loc: { + start: { column: 15, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + superClass: null, + + range: [125, 197], + loc: { + start: { column: 9, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [118, 197], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "name", + + range: [250, 254], + loc: { + start: { column: 6, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [256, 262], + loc: { + start: { column: 12, line: 10 }, + end: { column: 18, line: 10 }, + }, + }, + + range: [254, 262], + loc: { + start: { column: 10, line: 10 }, + end: { column: 18, line: 10 }, + }, + }, + + range: [250, 263], + loc: { + start: { column: 6, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + ], + + range: [242, 269], + loc: { + start: { column: 24, line: 9 }, + end: { column: 5, line: 11 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Id", + + range: [239, 241], + loc: { + start: { column: 21, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + + range: [229, 269], + loc: { + start: { column: 11, line: 9 }, + end: { column: 5, line: 11 }, + }, + }, + exportKind: "type", + source: null, + specifiers: Array [], + + range: [222, 269], + loc: { + start: { column: 4, line: 9 }, + end: { column: 5, line: 11 }, + }, + }, + ], + + range: [216, 273], + loc: { + start: { column: 18, line: 8 }, + end: { column: 3, line: 12 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "B", + + range: [214, 215], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + + range: [207, 273], + loc: { + start: { column: 9, line: 8 }, + end: { column: 3, line: 12 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [200, 273], + loc: { + start: { column: 2, line: 8 }, + end: { column: 3, line: 12 }, + }, + }, + ], + + range: [82, 275], + loc: { + start: { column: 9, line: 3 }, + end: { column: 1, line: 13 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "A", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [73, 275], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 13 }, + }, + }, + ], + sourceType: "module", + + range: [73, 276], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 14 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..6ec3f766f4e1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,436 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-module Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "module", + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "export", + + range: [86, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "var", + + range: [93, 96], + loc: { + start: { column: 9, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [97, 98], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [99, 100], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + String { + type: "String", + value: "'hello world'", + + range: [101, 114], + loc: { + start: { column: 17, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [114, 115], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "export", + + range: [118, 124], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [125, 130], + loc: { + start: { column: 9, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "Point", + + range: [131, 136], + loc: { + start: { column: 15, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [137, 138], + loc: { + start: { column: 21, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [143, 154], + loc: { + start: { column: 4, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [154, 155], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [155, 161], + loc: { + start: { column: 16, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [162, 163], + loc: { + start: { column: 23, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [163, 164], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [165, 171], + loc: { + start: { column: 26, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [171, 172], + loc: { + start: { column: 32, line: 6 }, + end: { column: 33, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [173, 179], + loc: { + start: { column: 34, line: 6 }, + end: { column: 40, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "y", + + range: [180, 181], + loc: { + start: { column: 41, line: 6 }, + end: { column: 42, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [181, 182], + loc: { + start: { column: 42, line: 6 }, + end: { column: 43, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [183, 189], + loc: { + start: { column: 44, line: 6 }, + end: { column: 50, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [189, 190], + loc: { + start: { column: 50, line: 6 }, + end: { column: 51, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [191, 192], + loc: { + start: { column: 52, line: 6 }, + end: { column: 53, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [192, 193], + loc: { + start: { column: 53, line: 6 }, + end: { column: 54, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [196, 197], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "export", + + range: [200, 206], + loc: { + start: { column: 2, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "module", + + range: [207, 213], + loc: { + start: { column: 9, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [214, 215], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [216, 217], + loc: { + start: { column: 18, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + Keyword { + type: "Keyword", + value: "export", + + range: [222, 228], + loc: { + start: { column: 4, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "interface", + + range: [229, 238], + loc: { + start: { column: 11, line: 9 }, + end: { column: 20, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "Id", + + range: [239, 241], + loc: { + start: { column: 21, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [242, 243], + loc: { + start: { column: 24, line: 9 }, + end: { column: 25, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "name", + + range: [250, 254], + loc: { + start: { column: 6, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [254, 255], + loc: { + start: { column: 10, line: 10 }, + end: { column: 11, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [256, 262], + loc: { + start: { column: 12, line: 10 }, + end: { column: 18, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [262, 263], + loc: { + start: { column: 18, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [268, 269], + loc: { + start: { column: 4, line: 11 }, + end: { column: 5, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [272, 273], + loc: { + start: { column: 2, line: 12 }, + end: { column: 3, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [274, 275], + loc: { + start: { column: 0, line: 13 }, + end: { column: 1, line: 13 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..a7f07ea2823e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,398 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-module AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleBlock { + type: 'TSModuleBlock', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'x', + + range: [97, 98], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + init: Literal { + type: 'Literal', + raw: '\\\\'hello world\\\\'', + value: 'hello world', + + range: [101, 114], + loc: { + start: { column: 17, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + + range: [97, 114], + loc: { + start: { column: 13, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + ], + kind: 'var', + + range: [93, 115], + loc: { + start: { column: 9, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + exportKind: 'value', + source: null, + specifiers: Array [], + + range: [86, 115], + loc: { + start: { column: 2, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'constructor', + + range: [143, 154], + loc: { + start: { column: 4, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + kind: 'constructor', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [191, 193], + loc: { + start: { column: 52, line: 6 }, + end: { column: 54, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + TSParameterProperty { + type: 'TSParameterProperty', + accessibility: 'public', + parameter: Identifier { + type: 'Identifier', + name: 'x', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [165, 171], + loc: { + start: { column: 26, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + + range: [163, 171], + loc: { + start: { column: 24, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + + range: [162, 171], + loc: { + start: { column: 23, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + + range: [155, 171], + loc: { + start: { column: 16, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + TSParameterProperty { + type: 'TSParameterProperty', + accessibility: 'public', + parameter: Identifier { + type: 'Identifier', + name: 'y', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [183, 189], + loc: { + start: { column: 44, line: 6 }, + end: { column: 50, line: 6 }, + }, + }, + + range: [181, 189], + loc: { + start: { column: 42, line: 6 }, + end: { column: 50, line: 6 }, + }, + }, + + range: [180, 189], + loc: { + start: { column: 41, line: 6 }, + end: { column: 50, line: 6 }, + }, + }, + + range: [173, 189], + loc: { + start: { column: 34, line: 6 }, + end: { column: 50, line: 6 }, + }, + }, + ], + + range: [154, 193], + loc: { + start: { column: 15, line: 6 }, + end: { column: 54, line: 6 }, + }, + }, + + range: [143, 193], + loc: { + start: { column: 4, line: 6 }, + end: { column: 54, line: 6 }, + }, + }, + ], + + range: [137, 197], + loc: { + start: { column: 21, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Point', + + range: [131, 136], + loc: { + start: { column: 15, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + superClass: null, + + range: [125, 197], + loc: { + start: { column: 9, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + exportKind: 'value', + source: null, + specifiers: Array [], + + range: [118, 197], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 7 }, + }, + }, + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleBlock { + type: 'TSModuleBlock', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [ + TSPropertySignature { + type: 'TSPropertySignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'name', + + range: [250, 254], + loc: { + start: { column: 6, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [256, 262], + loc: { + start: { column: 12, line: 10 }, + end: { column: 18, line: 10 }, + }, + }, + + range: [254, 262], + loc: { + start: { column: 10, line: 10 }, + end: { column: 18, line: 10 }, + }, + }, + + range: [250, 263], + loc: { + start: { column: 6, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + ], + + range: [242, 269], + loc: { + start: { column: 24, line: 9 }, + end: { column: 5, line: 11 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Id', + + range: [239, 241], + loc: { + start: { column: 21, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + + range: [229, 269], + loc: { + start: { column: 11, line: 9 }, + end: { column: 5, line: 11 }, + }, + }, + exportKind: 'type', + source: null, + specifiers: Array [], + + range: [222, 269], + loc: { + start: { column: 4, line: 9 }, + end: { column: 5, line: 11 }, + }, + }, + ], + + range: [216, 273], + loc: { + start: { column: 18, line: 8 }, + end: { column: 3, line: 12 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'B', + + range: [214, 215], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + + range: [207, 273], + loc: { + start: { column: 9, line: 8 }, + end: { column: 3, line: 12 }, + }, + }, + exportKind: 'value', + source: null, + specifiers: Array [], + + range: [200, 273], + loc: { + start: { column: 2, line: 8 }, + end: { column: 3, line: 12 }, + }, + }, + ], + + range: [82, 275], + loc: { + start: { column: 9, line: 3 }, + end: { column: 1, line: 13 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'A', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [73, 275], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 13 }, + }, + }, + ], +- sourceType: 'script', ++ sourceType: 'module', + + range: [73, 276], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 14 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..0085ca364f98 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,446 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-module AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Identifier { + type: 'Identifier', + value: 'module', + + range: [73, 79], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'A', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'export', + + range: [86, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'var', + + range: [93, 96], + loc: { + start: { column: 9, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [97, 98], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [99, 100], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + String { + type: 'String', + value: '\\\\'hello world\\\\'', + + range: [101, 114], + loc: { + start: { column: 17, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [114, 115], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'export', + + range: [118, 124], + loc: { + start: { column: 2, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'class', + + range: [125, 130], + loc: { + start: { column: 9, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Point', + + range: [131, 136], + loc: { + start: { column: 15, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [137, 138], + loc: { + start: { column: 21, line: 5 }, + end: { column: 22, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'constructor', + + range: [143, 154], + loc: { + start: { column: 4, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [154, 155], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [155, 161], + loc: { + start: { column: 16, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [162, 163], + loc: { + start: { column: 23, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [163, 164], + loc: { + start: { column: 24, line: 6 }, + end: { column: 25, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [165, 171], + loc: { + start: { column: 26, line: 6 }, + end: { column: 32, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [171, 172], + loc: { + start: { column: 32, line: 6 }, + end: { column: 33, line: 6 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [173, 179], + loc: { + start: { column: 34, line: 6 }, + end: { column: 40, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'y', + + range: [180, 181], + loc: { + start: { column: 41, line: 6 }, + end: { column: 42, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [181, 182], + loc: { + start: { column: 42, line: 6 }, + end: { column: 43, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [183, 189], + loc: { + start: { column: 44, line: 6 }, + end: { column: 50, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [189, 190], + loc: { + start: { column: 50, line: 6 }, + end: { column: 51, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [191, 192], + loc: { + start: { column: 52, line: 6 }, + end: { column: 53, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [192, 193], + loc: { + start: { column: 53, line: 6 }, + end: { column: 54, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [196, 197], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'export', + + range: [200, 206], + loc: { + start: { column: 2, line: 8 }, + end: { column: 8, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'module', + + range: [207, 213], + loc: { + start: { column: 9, line: 8 }, + end: { column: 15, line: 8 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'B', + + range: [214, 215], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [216, 217], + loc: { + start: { column: 18, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'export', + + range: [222, 228], + loc: { + start: { column: 4, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [229, 238], + loc: { + start: { column: 11, line: 9 }, + end: { column: 20, line: 9 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Id', + + range: [239, 241], + loc: { + start: { column: 21, line: 9 }, + end: { column: 23, line: 9 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [242, 243], + loc: { + start: { column: 24, line: 9 }, + end: { column: 25, line: 9 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'name', + + range: [250, 254], + loc: { + start: { column: 6, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [254, 255], + loc: { + start: { column: 10, line: 10 }, + end: { column: 11, line: 10 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [256, 262], + loc: { + start: { column: 12, line: 10 }, + end: { column: 18, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [262, 263], + loc: { + start: { column: 18, line: 10 }, + end: { column: 19, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [268, 269], + loc: { + start: { column: 4, line: 11 }, + end: { column: 5, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [272, 273], + loc: { + start: { column: 2, line: 12 }, + end: { column: 3, line: 12 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [274, 275], + loc: { + start: { column: 0, line: 13 }, + end: { column: 1, line: 13 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/fixture.ts b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/fixture.ts new file mode 100644 index 000000000000..0e133af917e9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +declare module 'hot-new-module'; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..09f4217111fb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,37 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules shorthand-ambient-module-declaration TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + declare: true, + id: Literal { + type: "Literal", + raw: "'hot-new-module'", + value: "hot-new-module", + + range: [88, 104], + loc: { + start: { column: 15, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..7617a3258cd5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules shorthand-ambient-module-declaration TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "module", + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + String { + type: "String", + value: "'hot-new-module'", + + range: [88, 104], + loc: { + start: { column: 15, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..4e89ae88cf14 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/3-Babel-AST.shot @@ -0,0 +1,37 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules shorthand-ambient-module-declaration Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + declare: true, + id: Literal { + type: "Literal", + raw: "'hot-new-module'", + value: "hot-new-module", + + range: [88, 104], + loc: { + start: { column: 15, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..06a137ecafd8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules shorthand-ambient-module-declaration Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [73, 80], + loc: { + start: { column: 0, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "module", + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + String { + type: "String", + value: "'hot-new-module'", + + range: [88, 104], + loc: { + start: { column: 15, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..c44cfa6ec3e8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules shorthand-ambient-module-declaration AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..f3fcc802b54b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures namespaces-and-modules shorthand-ambient-module-declaration AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/fixture.ts b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/fixture.ts new file mode 100644 index 000000000000..def614b2feee --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + bar(@special(true) [ bar ]: any) {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..fa15aa9df51e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators _error_ parameter-array-pattern-decorator TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..719a4d1f4573 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators _error_ parameter-array-pattern-decorator Babel - Error 1`] = `[SyntaxError: Unexpected token (4:28)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..c2c925447ebe --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators _error_ parameter-array-pattern-decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/fixture.ts b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/fixture.ts new file mode 100644 index 000000000000..729b764b1a76 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + bar(@special(true) ...foo: any) {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..b4ae3371d925 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators _error_ parameter-rest-element-decorator TSESTree - Error 1`] = `"NO ERROR"`; 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 new file mode 100644 index 000000000000..0cc1f7178069 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators _error_ parameter-rest-element-decorator Babel - Error 1`] = `[SyntaxError: Unexpected token (4:21)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..49d961c5a2ff --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators _error_ parameter-rest-element-decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/fixture.ts b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/fixture.ts new file mode 100644 index 000000000000..c6225f43ad2f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/fixture.ts @@ -0,0 +1,7 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Service { + constructor(@Inject(APP_CONFIG) config: AppConfig) { + this.title = config.title; + } +} diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..afe6694b9f58 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,257 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-constructor TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [91, 102], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: "constructor", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [148, 152], + loc: { + start: { column: 4, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "title", + + range: [153, 158], + loc: { + start: { column: 9, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + + range: [148, 158], + loc: { + start: { column: 4, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + operator: "=", + right: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "config", + + range: [161, 167], + loc: { + start: { column: 17, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "title", + + range: [168, 173], + loc: { + start: { column: 24, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + + range: [161, 173], + loc: { + start: { column: 17, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + + range: [148, 173], + loc: { + start: { column: 4, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + + range: [148, 174], + loc: { + start: { column: 4, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + ], + + range: [142, 178], + loc: { + start: { column: 53, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Identifier { + type: "Identifier", + name: "APP_CONFIG", + + range: [111, 121], + loc: { + start: { column: 22, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "Inject", + + range: [104, 110], + loc: { + start: { column: 15, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + optional: false, + + range: [104, 122], + loc: { + start: { column: 15, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [103, 122], + loc: { + start: { column: 14, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + name: "config", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "AppConfig", + + range: [131, 140], + loc: { + start: { column: 42, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + + range: [131, 140], + loc: { + start: { column: 42, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + + range: [129, 140], + loc: { + start: { column: 40, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + + range: [123, 140], + loc: { + start: { column: 34, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + ], + + range: [102, 178], + loc: { + start: { column: 13, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [91, 178], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + ], + + range: [87, 180], + loc: { + start: { column: 14, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Service", + + range: [79, 86], + loc: { + start: { column: 6, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + superClass: null, + + range: [73, 180], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 181], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..b210b9ccc398 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,256 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-constructor TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Service", + + range: [79, 86], + loc: { + start: { column: 6, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [91, 102], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [102, 103], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [103, 104], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Inject", + + range: [104, 110], + loc: { + start: { column: 15, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [110, 111], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "APP_CONFIG", + + range: [111, 121], + loc: { + start: { column: 22, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [121, 122], + loc: { + start: { column: 32, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "config", + + range: [123, 129], + loc: { + start: { column: 34, line: 4 }, + end: { column: 40, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [129, 130], + loc: { + start: { column: 40, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "AppConfig", + + range: [131, 140], + loc: { + start: { column: 42, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [140, 141], + loc: { + start: { column: 51, line: 4 }, + end: { column: 52, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [142, 143], + loc: { + start: { column: 53, line: 4 }, + end: { column: 54, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [148, 152], + loc: { + start: { column: 4, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [152, 153], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "title", + + range: [153, 158], + loc: { + start: { column: 9, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [159, 160], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "config", + + range: [161, 167], + loc: { + start: { column: 17, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [167, 168], + loc: { + start: { column: 23, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "title", + + range: [168, 173], + loc: { + start: { column: 24, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [173, 174], + loc: { + start: { column: 29, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [177, 178], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [179, 180], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..44ff47fce39f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/3-Babel-AST.shot @@ -0,0 +1,256 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-constructor Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "constructor", + + range: [91, 102], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: "constructor", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: AssignmentExpression { + type: "AssignmentExpression", + left: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [148, 152], + loc: { + start: { column: 4, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "title", + + range: [153, 158], + loc: { + start: { column: 9, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + + range: [148, 158], + loc: { + start: { column: 4, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + operator: "=", + right: MemberExpression { + type: "MemberExpression", + computed: false, + object: Identifier { + type: "Identifier", + name: "config", + + range: [161, 167], + loc: { + start: { column: 17, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "title", + + range: [168, 173], + loc: { + start: { column: 24, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + + range: [161, 173], + loc: { + start: { column: 17, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + + range: [148, 173], + loc: { + start: { column: 4, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + + range: [148, 174], + loc: { + start: { column: 4, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + ], + + range: [142, 178], + loc: { + start: { column: 53, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Identifier { + type: "Identifier", + name: "APP_CONFIG", + + range: [111, 121], + loc: { + start: { column: 22, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "Inject", + + range: [104, 110], + loc: { + start: { column: 15, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + optional: false, + + range: [104, 122], + loc: { + start: { column: 15, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [103, 122], + loc: { + start: { column: 14, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + name: "config", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "AppConfig", + + range: [131, 140], + loc: { + start: { column: 42, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + + range: [131, 140], + loc: { + start: { column: 42, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + + range: [129, 140], + loc: { + start: { column: 40, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + + range: [123, 140], + loc: { + start: { column: 34, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + ], + + range: [102, 178], + loc: { + start: { column: 13, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [91, 178], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + ], + + range: [87, 180], + loc: { + start: { column: 14, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Service", + + range: [79, 86], + loc: { + start: { column: 6, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + superClass: null, + + range: [73, 180], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 181], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..b80d35e54b3f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,256 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-constructor Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Service", + + range: [79, 86], + loc: { + start: { column: 6, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "constructor", + + range: [91, 102], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [102, 103], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [103, 104], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Inject", + + range: [104, 110], + loc: { + start: { column: 15, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [110, 111], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "APP_CONFIG", + + range: [111, 121], + loc: { + start: { column: 22, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [121, 122], + loc: { + start: { column: 32, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "config", + + range: [123, 129], + loc: { + start: { column: 34, line: 4 }, + end: { column: 40, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [129, 130], + loc: { + start: { column: 40, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "AppConfig", + + range: [131, 140], + loc: { + start: { column: 42, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [140, 141], + loc: { + start: { column: 51, line: 4 }, + end: { column: 52, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [142, 143], + loc: { + start: { column: 53, line: 4 }, + end: { column: 54, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [148, 152], + loc: { + start: { column: 4, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [152, 153], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "title", + + range: [153, 158], + loc: { + start: { column: 9, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [159, 160], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "config", + + range: [161, 167], + loc: { + start: { column: 17, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [167, 168], + loc: { + start: { column: 23, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "title", + + range: [168, 173], + loc: { + start: { column: 24, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [173, 174], + loc: { + start: { column: 29, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [177, 178], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [179, 180], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..888328c7c4b7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,261 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-constructor AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'constructor', + + range: [91, 102], + loc: { + start: { column: 2, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + kind: 'constructor', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ExpressionStatement { + type: 'ExpressionStatement', + expression: AssignmentExpression { + type: 'AssignmentExpression', + left: MemberExpression { + type: 'MemberExpression', + computed: false, + object: ThisExpression { + type: 'ThisExpression', + + range: [148, 152], + loc: { + start: { column: 4, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: 'Identifier', + name: 'title', + + range: [153, 158], + loc: { + start: { column: 9, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + + range: [148, 158], + loc: { + start: { column: 4, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + operator: '=', + right: MemberExpression { + type: 'MemberExpression', + computed: false, + object: Identifier { + type: 'Identifier', + name: 'config', + + range: [161, 167], + loc: { + start: { column: 17, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + optional: false, + property: Identifier { + type: 'Identifier', + name: 'title', + + range: [168, 173], + loc: { + start: { column: 24, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + + range: [161, 173], + loc: { + start: { column: 17, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + + range: [148, 173], + loc: { + start: { column: 4, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + + range: [148, 174], + loc: { + start: { column: 4, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + ], + + range: [142, 178], + loc: { + start: { column: 53, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: 'Identifier', + decorators: Array [ + Decorator { + type: 'Decorator', + expression: CallExpression { + type: 'CallExpression', + arguments: Array [ + Identifier { + type: 'Identifier', + name: 'APP_CONFIG', + + range: [111, 121], + loc: { + start: { column: 22, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + ], + callee: Identifier { + type: 'Identifier', + name: 'Inject', + + range: [104, 110], + loc: { + start: { column: 15, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + optional: false, + + range: [104, 122], + loc: { + start: { column: 15, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [103, 122], + loc: { + start: { column: 14, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + name: 'config', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'AppConfig', + + range: [131, 140], + loc: { + start: { column: 42, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + + range: [131, 140], + loc: { + start: { column: 42, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + + range: [129, 140], + loc: { + start: { column: 40, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + + range: [123, 140], + loc: { + start: { column: 34, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + ], + + range: [102, 178], + loc: { + start: { column: 13, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [91, 178], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + ], + + range: [87, 180], + loc: { + start: { column: 14, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Service', + + range: [79, 86], + loc: { + start: { column: 6, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + superClass: null, + + range: [73, 180], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 181], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..bd5ec261a8eb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-constructor AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/fixture.ts b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/fixture.ts new file mode 100644 index 000000000000..2e7d106a0094 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + bar(@special(true) baz: number) {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..ab2868fbe2d3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,167 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-decorator-instance-member TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [87, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [119, 121], + loc: { + start: { column: 34, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Literal { + type: "Literal", + raw: "true", + value: true, + + range: [100, 104], + loc: { + start: { column: 15, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "special", + + range: [92, 99], + loc: { + start: { column: 7, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + optional: false, + + range: [92, 105], + loc: { + start: { column: 7, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [91, 105], + loc: { + start: { column: 6, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + name: "baz", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [111, 117], + loc: { + start: { column: 26, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + + range: [109, 117], + loc: { + start: { column: 24, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + + range: [106, 117], + loc: { + start: { column: 21, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + ], + + range: [90, 121], + loc: { + start: { column: 5, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + + range: [87, 121], + loc: { + start: { column: 2, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + ], + + range: [83, 123], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 124], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..96cd8f22e2ce --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-decorator-instance-member TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [87, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [90, 91], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [91, 92], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "special", + + range: [92, 99], + loc: { + start: { column: 7, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [99, 100], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Boolean { + type: "Boolean", + value: "true", + + range: [100, 104], + loc: { + start: { column: 15, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [104, 105], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [106, 109], + loc: { + start: { column: 21, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [109, 110], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [111, 117], + loc: { + start: { column: 26, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [117, 118], + loc: { + start: { column: 32, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [119, 120], + loc: { + start: { column: 34, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [120, 121], + loc: { + start: { column: 35, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [122, 123], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..5267fa1134b3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/3-Babel-AST.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-decorator-instance-member Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [87, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [119, 121], + loc: { + start: { column: 34, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Literal { + type: "Literal", + raw: "true", + value: true, + + range: [100, 104], + loc: { + start: { column: 15, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "special", + + range: [92, 99], + loc: { + start: { column: 7, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + optional: false, + + range: [92, 105], + loc: { + start: { column: 7, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [91, 105], + loc: { + start: { column: 6, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + name: "baz", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [111, 117], + loc: { + start: { column: 26, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + + range: [109, 117], + loc: { + start: { column: 24, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + + range: [106, 117], + loc: { + start: { column: 21, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + ], + + range: [90, 121], + loc: { + start: { column: 5, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + + range: [87, 121], + loc: { + start: { column: 2, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + ], + + range: [83, 123], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 124], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..070ea1c5cee5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-decorator-instance-member Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [87, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [90, 91], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [91, 92], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "special", + + range: [92, 99], + loc: { + start: { column: 7, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [99, 100], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Boolean { + type: "Boolean", + value: "true", + + range: [100, 104], + loc: { + start: { column: 15, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [104, 105], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [106, 109], + loc: { + start: { column: 21, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [109, 110], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [111, 117], + loc: { + start: { column: 26, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [117, 118], + loc: { + start: { column: 32, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [119, 120], + loc: { + start: { column: 34, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [120, 121], + loc: { + start: { column: 35, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [122, 123], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..5f239612d63b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,171 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-decorator-instance-member AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'bar', + + range: [87, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [119, 121], + loc: { + start: { column: 34, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: 'Identifier', + decorators: Array [ + Decorator { + type: 'Decorator', + expression: CallExpression { + type: 'CallExpression', + arguments: Array [ + Literal { + type: 'Literal', + raw: 'true', + value: true, + + range: [100, 104], + loc: { + start: { column: 15, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + ], + callee: Identifier { + type: 'Identifier', + name: 'special', + + range: [92, 99], + loc: { + start: { column: 7, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + optional: false, + + range: [92, 105], + loc: { + start: { column: 7, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [91, 105], + loc: { + start: { column: 6, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + name: 'baz', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [111, 117], + loc: { + start: { column: 26, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + + range: [109, 117], + loc: { + start: { column: 24, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + + range: [106, 117], + loc: { + start: { column: 21, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + ], + + range: [90, 121], + loc: { + start: { column: 5, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + + range: [87, 121], + loc: { + start: { column: 2, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + ], + + range: [83, 123], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 124], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..553eb5ace6cc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-decorator-instance-member AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/fixture.ts b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/fixture.ts new file mode 100644 index 000000000000..885fd84450eb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class StaticFoo { + static bar(@special(true) baz: number) {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..48bbd6bdb662 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,167 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-decorator-static-member TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [100, 103], + loc: { + start: { column: 9, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + kind: "method", + override: false, + static: true, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [132, 134], + loc: { + start: { column: 41, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Literal { + type: "Literal", + raw: "true", + value: true, + + range: [113, 117], + loc: { + start: { column: 22, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "special", + + range: [105, 112], + loc: { + start: { column: 14, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + optional: false, + + range: [105, 118], + loc: { + start: { column: 14, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + + range: [104, 118], + loc: { + start: { column: 13, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + ], + name: "baz", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [124, 130], + loc: { + start: { column: 33, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + + range: [122, 130], + loc: { + start: { column: 31, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + + range: [119, 130], + loc: { + start: { column: 28, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + ], + + range: [103, 134], + loc: { + start: { column: 12, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + + range: [93, 134], + loc: { + start: { column: 2, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + ], + + range: [89, 136], + loc: { + start: { column: 16, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "StaticFoo", + + range: [79, 88], + loc: { + start: { column: 6, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + superClass: null, + + range: [73, 136], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 137], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..2f09aadd14b1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,186 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-decorator-static-member TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "StaticFoo", + + range: [79, 88], + loc: { + start: { column: 6, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [93, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [100, 103], + loc: { + start: { column: 9, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [103, 104], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [104, 105], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "special", + + range: [105, 112], + loc: { + start: { column: 14, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [112, 113], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Boolean { + type: "Boolean", + value: "true", + + range: [113, 117], + loc: { + start: { column: 22, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [117, 118], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [119, 122], + loc: { + start: { column: 28, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [122, 123], + loc: { + start: { column: 31, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [124, 130], + loc: { + start: { column: 33, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [130, 131], + loc: { + start: { column: 39, line: 4 }, + end: { column: 40, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [132, 133], + loc: { + start: { column: 41, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [133, 134], + loc: { + start: { column: 42, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [135, 136], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..0f29373520d7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/3-Babel-AST.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-decorator-static-member Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [100, 103], + loc: { + start: { column: 9, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + kind: "method", + static: true, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [132, 134], + loc: { + start: { column: 41, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Literal { + type: "Literal", + raw: "true", + value: true, + + range: [113, 117], + loc: { + start: { column: 22, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "special", + + range: [105, 112], + loc: { + start: { column: 14, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + optional: false, + + range: [105, 118], + loc: { + start: { column: 14, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + + range: [104, 118], + loc: { + start: { column: 13, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + ], + name: "baz", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [124, 130], + loc: { + start: { column: 33, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + + range: [122, 130], + loc: { + start: { column: 31, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + + range: [119, 130], + loc: { + start: { column: 28, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + ], + + range: [103, 134], + loc: { + start: { column: 12, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + + range: [93, 134], + loc: { + start: { column: 2, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + ], + + range: [89, 136], + loc: { + start: { column: 16, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "StaticFoo", + + range: [79, 88], + loc: { + start: { column: 6, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + superClass: null, + + range: [73, 136], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 137], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..588806aa2107 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,186 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-decorator-static-member Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "StaticFoo", + + range: [79, 88], + loc: { + start: { column: 6, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [93, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [100, 103], + loc: { + start: { column: 9, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [103, 104], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [104, 105], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "special", + + range: [105, 112], + loc: { + start: { column: 14, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [112, 113], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Boolean { + type: "Boolean", + value: "true", + + range: [113, 117], + loc: { + start: { column: 22, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [117, 118], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [119, 122], + loc: { + start: { column: 28, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [122, 123], + loc: { + start: { column: 31, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [124, 130], + loc: { + start: { column: 33, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [130, 131], + loc: { + start: { column: 39, line: 4 }, + end: { column: 40, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [132, 133], + loc: { + start: { column: 41, line: 4 }, + end: { column: 42, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [133, 134], + loc: { + start: { column: 42, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [135, 136], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..ec48a91bda01 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,171 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-decorator-static-member AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'bar', + + range: [100, 103], + loc: { + start: { column: 9, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + kind: 'method', +- override: false, + static: true, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [132, 134], + loc: { + start: { column: 41, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: 'Identifier', + decorators: Array [ + Decorator { + type: 'Decorator', + expression: CallExpression { + type: 'CallExpression', + arguments: Array [ + Literal { + type: 'Literal', + raw: 'true', + value: true, + + range: [113, 117], + loc: { + start: { column: 22, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + ], + callee: Identifier { + type: 'Identifier', + name: 'special', + + range: [105, 112], + loc: { + start: { column: 14, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + optional: false, + + range: [105, 118], + loc: { + start: { column: 14, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + + range: [104, 118], + loc: { + start: { column: 13, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + ], + name: 'baz', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [124, 130], + loc: { + start: { column: 33, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + + range: [122, 130], + loc: { + start: { column: 31, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + + range: [119, 130], + loc: { + start: { column: 28, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + ], + + range: [103, 134], + loc: { + start: { column: 12, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + + range: [93, 134], + loc: { + start: { column: 2, line: 4 }, + end: { column: 43, line: 4 }, + }, + }, + ], + + range: [89, 136], + loc: { + start: { column: 16, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'StaticFoo', + + range: [79, 88], + loc: { + start: { column: 6, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + superClass: null, + + range: [73, 136], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 137], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..87c0d3cf48ba --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-decorator-static-member AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/fixture.ts b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/fixture.ts new file mode 100644 index 000000000000..237c5b083689 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/fixture.ts @@ -0,0 +1,7 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Greeter { + greet(@required name: string) { + return 'Hello ' + name + '!'; + } +} diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..dbb217b47aab --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,206 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-instance-member TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "greet", + + range: [91, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: BinaryExpression { + type: "BinaryExpression", + left: BinaryExpression { + type: "BinaryExpression", + left: Literal { + type: "Literal", + raw: "'Hello '", + value: "Hello ", + + range: [134, 142], + loc: { + start: { column: 11, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + operator: "+", + right: Identifier { + type: "Identifier", + name: "name", + + range: [145, 149], + loc: { + start: { column: 22, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + + range: [134, 149], + loc: { + start: { column: 11, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + operator: "+", + right: Literal { + type: "Literal", + raw: "'!'", + value: "!", + + range: [152, 155], + loc: { + start: { column: 29, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + + range: [134, 155], + loc: { + start: { column: 11, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + + range: [127, 156], + loc: { + start: { column: 4, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + ], + + range: [121, 160], + loc: { + start: { column: 32, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "required", + + range: [98, 106], + loc: { + start: { column: 9, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + + range: [97, 106], + loc: { + start: { column: 8, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + ], + name: "name", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [113, 119], + loc: { + start: { column: 24, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + + range: [111, 119], + loc: { + start: { column: 22, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + + range: [107, 119], + loc: { + start: { column: 18, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + ], + + range: [96, 160], + loc: { + start: { column: 7, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [91, 160], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + ], + + range: [87, 162], + loc: { + start: { column: 14, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Greeter", + + range: [79, 86], + loc: { + start: { column: 6, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + superClass: null, + + range: [73, 162], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 163], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..f03c33446329 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,216 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-instance-member TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Greeter", + + range: [79, 86], + loc: { + start: { column: 6, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "greet", + + range: [91, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [96, 97], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [97, 98], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "required", + + range: [98, 106], + loc: { + start: { column: 9, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "name", + + range: [107, 111], + loc: { + start: { column: 18, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [111, 112], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [113, 119], + loc: { + start: { column: 24, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [119, 120], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [121, 122], + loc: { + start: { column: 32, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [127, 133], + loc: { + start: { column: 4, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + String { + type: "String", + value: "'Hello '", + + range: [134, 142], + loc: { + start: { column: 11, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "+", + + range: [143, 144], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "name", + + range: [145, 149], + loc: { + start: { column: 22, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "+", + + range: [150, 151], + loc: { + start: { column: 27, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + String { + type: "String", + value: "'!'", + + range: [152, 155], + loc: { + start: { column: 29, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [155, 156], + loc: { + start: { column: 32, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [159, 160], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [161, 162], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..aaa63ca2d734 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/3-Babel-AST.shot @@ -0,0 +1,205 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-instance-member Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "greet", + + range: [91, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: BinaryExpression { + type: "BinaryExpression", + left: BinaryExpression { + type: "BinaryExpression", + left: Literal { + type: "Literal", + raw: "'Hello '", + value: "Hello ", + + range: [134, 142], + loc: { + start: { column: 11, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + operator: "+", + right: Identifier { + type: "Identifier", + name: "name", + + range: [145, 149], + loc: { + start: { column: 22, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + + range: [134, 149], + loc: { + start: { column: 11, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + operator: "+", + right: Literal { + type: "Literal", + raw: "'!'", + value: "!", + + range: [152, 155], + loc: { + start: { column: 29, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + + range: [134, 155], + loc: { + start: { column: 11, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + + range: [127, 156], + loc: { + start: { column: 4, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + ], + + range: [121, 160], + loc: { + start: { column: 32, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "required", + + range: [98, 106], + loc: { + start: { column: 9, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + + range: [97, 106], + loc: { + start: { column: 8, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + ], + name: "name", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [113, 119], + loc: { + start: { column: 24, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + + range: [111, 119], + loc: { + start: { column: 22, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + + range: [107, 119], + loc: { + start: { column: 18, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + ], + + range: [96, 160], + loc: { + start: { column: 7, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [91, 160], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + ], + + range: [87, 162], + loc: { + start: { column: 14, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Greeter", + + range: [79, 86], + loc: { + start: { column: 6, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + superClass: null, + + range: [73, 162], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 163], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..c336eda6669b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,216 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-instance-member Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Greeter", + + range: [79, 86], + loc: { + start: { column: 6, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "greet", + + range: [91, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [96, 97], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [97, 98], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "required", + + range: [98, 106], + loc: { + start: { column: 9, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "name", + + range: [107, 111], + loc: { + start: { column: 18, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [111, 112], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [113, 119], + loc: { + start: { column: 24, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [119, 120], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [121, 122], + loc: { + start: { column: 32, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [127, 133], + loc: { + start: { column: 4, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + String { + type: "String", + value: "'Hello '", + + range: [134, 142], + loc: { + start: { column: 11, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "+", + + range: [143, 144], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "name", + + range: [145, 149], + loc: { + start: { column: 22, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "+", + + range: [150, 151], + loc: { + start: { column: 27, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + String { + type: "String", + value: "'!'", + + range: [152, 155], + loc: { + start: { column: 29, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [155, 156], + loc: { + start: { column: 32, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [159, 160], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [161, 162], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..8ea69118b84d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,210 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-instance-member AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'greet', + + range: [91, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: BinaryExpression { + type: 'BinaryExpression', + left: BinaryExpression { + type: 'BinaryExpression', + left: Literal { + type: 'Literal', + raw: '\\\\'Hello \\\\'', + value: 'Hello ', + + range: [134, 142], + loc: { + start: { column: 11, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + operator: '+', + right: Identifier { + type: 'Identifier', + name: 'name', + + range: [145, 149], + loc: { + start: { column: 22, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + + range: [134, 149], + loc: { + start: { column: 11, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + operator: '+', + right: Literal { + type: 'Literal', + raw: '\\\\'!\\\\'', + value: '!', + + range: [152, 155], + loc: { + start: { column: 29, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + + range: [134, 155], + loc: { + start: { column: 11, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + + range: [127, 156], + loc: { + start: { column: 4, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + ], + + range: [121, 160], + loc: { + start: { column: 32, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: 'Identifier', + decorators: Array [ + Decorator { + type: 'Decorator', + expression: Identifier { + type: 'Identifier', + name: 'required', + + range: [98, 106], + loc: { + start: { column: 9, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + + range: [97, 106], + loc: { + start: { column: 8, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + ], + name: 'name', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [113, 119], + loc: { + start: { column: 24, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + + range: [111, 119], + loc: { + start: { column: 22, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + + range: [107, 119], + loc: { + start: { column: 18, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + ], + + range: [96, 160], + loc: { + start: { column: 7, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [91, 160], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + ], + + range: [87, 162], + loc: { + start: { column: 14, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Greeter', + + range: [79, 86], + loc: { + start: { column: 6, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + superClass: null, + + range: [73, 162], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 163], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..941f7026061a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-instance-member AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/fixture.ts b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/fixture.ts new file mode 100644 index 000000000000..be5e233a96e7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/fixture.ts @@ -0,0 +1,7 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class StaticGreeter { + static greet(@required name: string) { + return 'Hello ' + name + '!'; + } +} diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..d4cdbef76e31 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,206 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-static-member TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "greet", + + range: [104, 109], + loc: { + start: { column: 9, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + kind: "method", + override: false, + static: true, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: BinaryExpression { + type: "BinaryExpression", + left: BinaryExpression { + type: "BinaryExpression", + left: Literal { + type: "Literal", + raw: "'Hello '", + value: "Hello ", + + range: [147, 155], + loc: { + start: { column: 11, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + operator: "+", + right: Identifier { + type: "Identifier", + name: "name", + + range: [158, 162], + loc: { + start: { column: 22, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + + range: [147, 162], + loc: { + start: { column: 11, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + operator: "+", + right: Literal { + type: "Literal", + raw: "'!'", + value: "!", + + range: [165, 168], + loc: { + start: { column: 29, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + + range: [147, 168], + loc: { + start: { column: 11, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + + range: [140, 169], + loc: { + start: { column: 4, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + ], + + range: [134, 173], + loc: { + start: { column: 39, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "required", + + range: [111, 119], + loc: { + start: { column: 16, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [110, 119], + loc: { + start: { column: 15, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + ], + name: "name", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [126, 132], + loc: { + start: { column: 31, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + + range: [124, 132], + loc: { + start: { column: 29, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + + range: [120, 132], + loc: { + start: { column: 25, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + ], + + range: [109, 173], + loc: { + start: { column: 14, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [97, 173], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + ], + + range: [93, 175], + loc: { + start: { column: 20, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "StaticGreeter", + + range: [79, 92], + loc: { + start: { column: 6, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + superClass: null, + + range: [73, 175], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 176], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..f9990e5f313b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,226 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-static-member TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "StaticGreeter", + + range: [79, 92], + loc: { + start: { column: 6, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [97, 103], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "greet", + + range: [104, 109], + loc: { + start: { column: 9, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [109, 110], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [110, 111], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "required", + + range: [111, 119], + loc: { + start: { column: 16, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "name", + + range: [120, 124], + loc: { + start: { column: 25, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [124, 125], + loc: { + start: { column: 29, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [126, 132], + loc: { + start: { column: 31, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [132, 133], + loc: { + start: { column: 37, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [134, 135], + loc: { + start: { column: 39, line: 4 }, + end: { column: 40, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [140, 146], + loc: { + start: { column: 4, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + String { + type: "String", + value: "'Hello '", + + range: [147, 155], + loc: { + start: { column: 11, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "+", + + range: [156, 157], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "name", + + range: [158, 162], + loc: { + start: { column: 22, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "+", + + range: [163, 164], + loc: { + start: { column: 27, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + String { + type: "String", + value: "'!'", + + range: [165, 168], + loc: { + start: { column: 29, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [168, 169], + loc: { + start: { column: 32, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [172, 173], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [174, 175], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..7db0f3ebff6e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/3-Babel-AST.shot @@ -0,0 +1,205 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-static-member Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "greet", + + range: [104, 109], + loc: { + start: { column: 9, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + kind: "method", + static: true, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: BinaryExpression { + type: "BinaryExpression", + left: BinaryExpression { + type: "BinaryExpression", + left: Literal { + type: "Literal", + raw: "'Hello '", + value: "Hello ", + + range: [147, 155], + loc: { + start: { column: 11, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + operator: "+", + right: Identifier { + type: "Identifier", + name: "name", + + range: [158, 162], + loc: { + start: { column: 22, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + + range: [147, 162], + loc: { + start: { column: 11, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + operator: "+", + right: Literal { + type: "Literal", + raw: "'!'", + value: "!", + + range: [165, 168], + loc: { + start: { column: 29, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + + range: [147, 168], + loc: { + start: { column: 11, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + + range: [140, 169], + loc: { + start: { column: 4, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + ], + + range: [134, 173], + loc: { + start: { column: 39, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "required", + + range: [111, 119], + loc: { + start: { column: 16, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [110, 119], + loc: { + start: { column: 15, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + ], + name: "name", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [126, 132], + loc: { + start: { column: 31, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + + range: [124, 132], + loc: { + start: { column: 29, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + + range: [120, 132], + loc: { + start: { column: 25, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + ], + + range: [109, 173], + loc: { + start: { column: 14, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [97, 173], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + ], + + range: [93, 175], + loc: { + start: { column: 20, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "StaticGreeter", + + range: [79, 92], + loc: { + start: { column: 6, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + superClass: null, + + range: [73, 175], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 176], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..39fddcb82066 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,226 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-static-member Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "StaticGreeter", + + range: [79, 92], + loc: { + start: { column: 6, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [97, 103], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "greet", + + range: [104, 109], + loc: { + start: { column: 9, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [109, 110], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [110, 111], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "required", + + range: [111, 119], + loc: { + start: { column: 16, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "name", + + range: [120, 124], + loc: { + start: { column: 25, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [124, 125], + loc: { + start: { column: 29, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [126, 132], + loc: { + start: { column: 31, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [132, 133], + loc: { + start: { column: 37, line: 4 }, + end: { column: 38, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [134, 135], + loc: { + start: { column: 39, line: 4 }, + end: { column: 40, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [140, 146], + loc: { + start: { column: 4, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + String { + type: "String", + value: "'Hello '", + + range: [147, 155], + loc: { + start: { column: 11, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "+", + + range: [156, 157], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "name", + + range: [158, 162], + loc: { + start: { column: 22, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "+", + + range: [163, 164], + loc: { + start: { column: 27, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + String { + type: "String", + value: "'!'", + + range: [165, 168], + loc: { + start: { column: 29, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [168, 169], + loc: { + start: { column: 32, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [172, 173], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [174, 175], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..ba29c4e732b6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,210 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-static-member AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'greet', + + range: [104, 109], + loc: { + start: { column: 9, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + kind: 'method', +- override: false, + static: true, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: BinaryExpression { + type: 'BinaryExpression', + left: BinaryExpression { + type: 'BinaryExpression', + left: Literal { + type: 'Literal', + raw: '\\\\'Hello \\\\'', + value: 'Hello ', + + range: [147, 155], + loc: { + start: { column: 11, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + operator: '+', + right: Identifier { + type: 'Identifier', + name: 'name', + + range: [158, 162], + loc: { + start: { column: 22, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + + range: [147, 162], + loc: { + start: { column: 11, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + operator: '+', + right: Literal { + type: 'Literal', + raw: '\\\\'!\\\\'', + value: '!', + + range: [165, 168], + loc: { + start: { column: 29, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + + range: [147, 168], + loc: { + start: { column: 11, line: 5 }, + end: { column: 32, line: 5 }, + }, + }, + + range: [140, 169], + loc: { + start: { column: 4, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + ], + + range: [134, 173], + loc: { + start: { column: 39, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: 'Identifier', + decorators: Array [ + Decorator { + type: 'Decorator', + expression: Identifier { + type: 'Identifier', + name: 'required', + + range: [111, 119], + loc: { + start: { column: 16, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [110, 119], + loc: { + start: { column: 15, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + ], + name: 'name', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [126, 132], + loc: { + start: { column: 31, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + + range: [124, 132], + loc: { + start: { column: 29, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + + range: [120, 132], + loc: { + start: { column: 25, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + ], + + range: [109, 173], + loc: { + start: { column: 14, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [97, 173], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + ], + + range: [93, 175], + loc: { + start: { column: 20, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'StaticGreeter', + + range: [79, 92], + loc: { + start: { column: 6, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + superClass: null, + + range: [73, 175], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 176], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..52a669eeb2c8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-static-member AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/fixture.ts b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/fixture.ts new file mode 100644 index 000000000000..535d376239ac --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Foo { + bar(@special(true) { bar }: any) {} +} diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..c99dd3f4cbe1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,201 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-object-pattern-decorator TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [87, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [120, 122], + loc: { + start: { column: 35, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + ObjectPattern { + type: "ObjectPattern", + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Literal { + type: "Literal", + raw: "true", + value: true, + + range: [100, 104], + loc: { + start: { column: 15, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "special", + + range: [92, 99], + loc: { + start: { column: 7, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + optional: false, + + range: [92, 105], + loc: { + start: { column: 7, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [91, 105], + loc: { + start: { column: 6, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [108, 111], + loc: { + start: { column: 23, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + kind: "init", + method: false, + shorthand: true, + value: Identifier { + type: "Identifier", + name: "bar", + + range: [108, 111], + loc: { + start: { column: 23, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + + range: [108, 111], + loc: { + start: { column: 23, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [115, 118], + loc: { + start: { column: 30, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [113, 118], + loc: { + start: { column: 28, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [106, 118], + loc: { + start: { column: 21, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + + range: [90, 122], + loc: { + start: { column: 5, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + + range: [87, 122], + loc: { + start: { column: 2, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + ], + + range: [83, 124], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 124], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 125], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..a953ec70926d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,196 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-object-pattern-decorator TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [87, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [90, 91], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [91, 92], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "special", + + range: [92, 99], + loc: { + start: { column: 7, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [99, 100], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Boolean { + type: "Boolean", + value: "true", + + range: [100, 104], + loc: { + start: { column: 15, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [104, 105], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [106, 107], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [108, 111], + loc: { + start: { column: 23, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [112, 113], + loc: { + start: { column: 27, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [113, 114], + loc: { + start: { column: 28, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [115, 118], + loc: { + start: { column: 30, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [118, 119], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [120, 121], + loc: { + start: { column: 35, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [121, 122], + loc: { + start: { column: 36, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [123, 124], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..d572a736609d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/3-Babel-AST.shot @@ -0,0 +1,200 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-object-pattern-decorator Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [87, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [120, 122], + loc: { + start: { column: 35, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + ObjectPattern { + type: "ObjectPattern", + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Literal { + type: "Literal", + raw: "true", + value: true, + + range: [100, 104], + loc: { + start: { column: 15, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "special", + + range: [92, 99], + loc: { + start: { column: 7, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + optional: false, + + range: [92, 105], + loc: { + start: { column: 7, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [91, 105], + loc: { + start: { column: 6, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "bar", + + range: [108, 111], + loc: { + start: { column: 23, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + kind: "init", + method: false, + shorthand: true, + value: Identifier { + type: "Identifier", + name: "bar", + + range: [108, 111], + loc: { + start: { column: 23, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + + range: [108, 111], + loc: { + start: { column: 23, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [115, 118], + loc: { + start: { column: 30, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [113, 118], + loc: { + start: { column: 28, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [106, 118], + loc: { + start: { column: 21, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + + range: [90, 122], + loc: { + start: { column: 5, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + + range: [87, 122], + loc: { + start: { column: 2, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + ], + + range: [83, 124], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 124], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 125], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..9bce1d3a49b8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,196 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-object-pattern-decorator Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [87, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [90, 91], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [91, 92], + loc: { + start: { column: 6, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "special", + + range: [92, 99], + loc: { + start: { column: 7, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [99, 100], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Boolean { + type: "Boolean", + value: "true", + + range: [100, 104], + loc: { + start: { column: 15, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [104, 105], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [106, 107], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [108, 111], + loc: { + start: { column: 23, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [112, 113], + loc: { + start: { column: 27, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [113, 114], + loc: { + start: { column: 28, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [115, 118], + loc: { + start: { column: 30, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [118, 119], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [120, 121], + loc: { + start: { column: 35, line: 4 }, + end: { column: 36, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [121, 122], + loc: { + start: { column: 36, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [123, 124], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..95cc2b085793 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,205 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-object-pattern-decorator AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'bar', + + range: [87, 90], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [120, 122], + loc: { + start: { column: 35, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + ObjectPattern { + type: 'ObjectPattern', + decorators: Array [ + Decorator { + type: 'Decorator', + expression: CallExpression { + type: 'CallExpression', + arguments: Array [ + Literal { + type: 'Literal', + raw: 'true', + value: true, + + range: [100, 104], + loc: { + start: { column: 15, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + ], + callee: Identifier { + type: 'Identifier', + name: 'special', + + range: [92, 99], + loc: { + start: { column: 7, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + optional: false, + + range: [92, 105], + loc: { + start: { column: 7, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [91, 105], + loc: { + start: { column: 6, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + properties: Array [ + Property { + type: 'Property', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'bar', + + range: [108, 111], + loc: { + start: { column: 23, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + kind: 'init', + method: false, + shorthand: true, + value: Identifier { + type: 'Identifier', + name: 'bar', + + range: [108, 111], + loc: { + start: { column: 23, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + + range: [108, 111], + loc: { + start: { column: 23, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSAnyKeyword { + type: 'TSAnyKeyword', + + range: [115, 118], + loc: { + start: { column: 30, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [113, 118], + loc: { + start: { column: 28, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [106, 118], + loc: { + start: { column: 21, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + + range: [90, 122], + loc: { + start: { column: 5, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + + range: [87, 122], + loc: { + start: { column: 2, line: 4 }, + end: { column: 37, line: 4 }, + }, + }, + ], + + range: [83, 124], + loc: { + start: { column: 10, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [79, 82], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [73, 124], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 125], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..fd03c3ab8a37 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-object-pattern-decorator AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/fixture.ts b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/fixture.ts new file mode 100644 index 000000000000..47cb6acda81b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/fixture.ts @@ -0,0 +1,7 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class SomeComponent { + @Input() data; + @Output() + click = new EventEmitter(); +} diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..ab8352e9521b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,178 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-factory-instance-member TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "Input", + + range: [98, 103], + loc: { + start: { column: 3, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + optional: false, + + range: [98, 105], + loc: { + start: { column: 3, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [97, 105], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "data", + + range: [106, 110], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + override: false, + static: false, + value: null, + + range: [97, 111], + loc: { + start: { column: 2, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "Output", + + range: [115, 121], + loc: { + start: { column: 3, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + optional: false, + + range: [115, 123], + loc: { + start: { column: 3, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [114, 123], + loc: { + start: { column: 2, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "click", + + range: [126, 131], + loc: { + start: { column: 2, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + override: false, + static: false, + value: NewExpression { + type: "NewExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "EventEmitter", + + range: [138, 150], + loc: { + start: { column: 14, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + + range: [134, 152], + loc: { + start: { column: 10, line: 6 }, + end: { column: 28, line: 6 }, + }, + }, + + range: [114, 153], + loc: { + start: { column: 2, line: 5 }, + end: { column: 29, line: 6 }, + }, + }, + ], + + range: [93, 155], + loc: { + start: { column: 20, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "SomeComponent", + + range: [79, 92], + loc: { + start: { column: 6, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + superClass: null, + + range: [73, 155], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 156], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..e025b79485f4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,216 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-factory-instance-member TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "SomeComponent", + + range: [79, 92], + loc: { + start: { column: 6, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [97, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Input", + + range: [98, 103], + loc: { + start: { column: 3, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [103, 104], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [104, 105], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "data", + + range: [106, 110], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [110, 111], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [114, 115], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "Output", + + range: [115, 121], + loc: { + start: { column: 3, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [121, 122], + loc: { + start: { column: 9, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [122, 123], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "click", + + range: [126, 131], + loc: { + start: { column: 2, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [132, 133], + loc: { + start: { column: 8, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [134, 137], + loc: { + start: { column: 10, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "EventEmitter", + + range: [138, 150], + loc: { + start: { column: 14, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [150, 151], + loc: { + start: { column: 26, line: 6 }, + end: { column: 27, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [151, 152], + loc: { + start: { column: 27, line: 6 }, + end: { column: 28, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [152, 153], + loc: { + start: { column: 28, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [154, 155], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..9bbe009d87b3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/3-Babel-AST.shot @@ -0,0 +1,174 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-factory-instance-member Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "Input", + + range: [98, 103], + loc: { + start: { column: 3, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + optional: false, + + range: [98, 105], + loc: { + start: { column: 3, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [97, 105], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "data", + + range: [106, 110], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + static: false, + value: null, + + range: [97, 111], + loc: { + start: { column: 2, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "Output", + + range: [115, 121], + loc: { + start: { column: 3, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + optional: false, + + range: [115, 123], + loc: { + start: { column: 3, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [114, 123], + loc: { + start: { column: 2, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "click", + + range: [126, 131], + loc: { + start: { column: 2, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + static: false, + value: NewExpression { + type: "NewExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "EventEmitter", + + range: [138, 150], + loc: { + start: { column: 14, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + + range: [134, 152], + loc: { + start: { column: 10, line: 6 }, + end: { column: 28, line: 6 }, + }, + }, + + range: [114, 153], + loc: { + start: { column: 2, line: 5 }, + end: { column: 29, line: 6 }, + }, + }, + ], + + range: [93, 155], + loc: { + start: { column: 20, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "SomeComponent", + + range: [79, 92], + loc: { + start: { column: 6, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + superClass: null, + + range: [73, 155], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 156], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..e367175331eb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,216 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-factory-instance-member Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "SomeComponent", + + range: [79, 92], + loc: { + start: { column: 6, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [97, 98], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Input", + + range: [98, 103], + loc: { + start: { column: 3, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [103, 104], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [104, 105], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "data", + + range: [106, 110], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [110, 111], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [114, 115], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "Output", + + range: [115, 121], + loc: { + start: { column: 3, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [121, 122], + loc: { + start: { column: 9, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [122, 123], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "click", + + range: [126, 131], + loc: { + start: { column: 2, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [132, 133], + loc: { + start: { column: 8, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [134, 137], + loc: { + start: { column: 10, line: 6 }, + end: { column: 13, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "EventEmitter", + + range: [138, 150], + loc: { + start: { column: 14, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [150, 151], + loc: { + start: { column: 26, line: 6 }, + end: { column: 27, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [151, 152], + loc: { + start: { column: 27, line: 6 }, + end: { column: 28, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [152, 153], + loc: { + start: { column: 28, line: 6 }, + end: { column: 29, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [154, 155], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..2190670be4d9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,182 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-factory-instance-member AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + decorators: Array [ + Decorator { + type: 'Decorator', + expression: CallExpression { + type: 'CallExpression', + arguments: Array [], + callee: Identifier { + type: 'Identifier', + name: 'Input', + + range: [98, 103], + loc: { + start: { column: 3, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + optional: false, + + range: [98, 105], + loc: { + start: { column: 3, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [97, 105], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + ], + key: Identifier { + type: 'Identifier', + name: 'data', + + range: [106, 110], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, +- override: false, + static: false, + value: null, + + range: [97, 111], + loc: { + start: { column: 2, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + decorators: Array [ + Decorator { + type: 'Decorator', + expression: CallExpression { + type: 'CallExpression', + arguments: Array [], + callee: Identifier { + type: 'Identifier', + name: 'Output', + + range: [115, 121], + loc: { + start: { column: 3, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + optional: false, + + range: [115, 123], + loc: { + start: { column: 3, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + + range: [114, 123], + loc: { + start: { column: 2, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + ], + key: Identifier { + type: 'Identifier', + name: 'click', + + range: [126, 131], + loc: { + start: { column: 2, line: 6 }, + end: { column: 7, line: 6 }, + }, + }, +- override: false, + static: false, + value: NewExpression { + type: 'NewExpression', + arguments: Array [], + callee: Identifier { + type: 'Identifier', + name: 'EventEmitter', + + range: [138, 150], + loc: { + start: { column: 14, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + + range: [134, 152], + loc: { + start: { column: 10, line: 6 }, + end: { column: 28, line: 6 }, + }, + }, + + range: [114, 153], + loc: { + start: { column: 2, line: 5 }, + end: { column: 29, line: 6 }, + }, + }, + ], + + range: [93, 155], + loc: { + start: { column: 20, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'SomeComponent', + + range: [79, 92], + loc: { + start: { column: 6, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + superClass: null, + + range: [73, 155], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 156], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..afa8eb26ec4e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-factory-instance-member AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/fixture.ts b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/fixture.ts new file mode 100644 index 000000000000..945fac8ab15d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/fixture.ts @@ -0,0 +1,8 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class A { + @configurable(true) static prop1; + + @configurable(false) + static prop2; +} diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..8f8fb3fb6c47 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,183 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-factory-static-member TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Literal { + type: "Literal", + raw: "true", + value: true, + + range: [99, 103], + loc: { + start: { column: 16, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "configurable", + + range: [86, 98], + loc: { + start: { column: 3, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + optional: false, + + range: [86, 104], + loc: { + start: { column: 3, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [85, 104], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "prop1", + + range: [112, 117], + loc: { + start: { column: 29, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + override: false, + static: true, + value: null, + + range: [85, 118], + loc: { + start: { column: 2, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Literal { + type: "Literal", + raw: "false", + value: false, + + range: [136, 141], + loc: { + start: { column: 16, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "configurable", + + range: [123, 135], + loc: { + start: { column: 3, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + optional: false, + + range: [123, 142], + loc: { + start: { column: 3, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, + + range: [122, 142], + loc: { + start: { column: 2, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "prop2", + + range: [152, 157], + loc: { + start: { column: 9, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + override: false, + static: true, + value: null, + + range: [122, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 15, line: 7 }, + }, + }, + ], + + range: [81, 160], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "A", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 160], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], + sourceType: "script", + + range: [73, 161], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..a35bcf0e7fa8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,206 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-factory-static-member TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [85, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "configurable", + + range: [86, 98], + loc: { + start: { column: 3, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [98, 99], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Boolean { + type: "Boolean", + value: "true", + + range: [99, 103], + loc: { + start: { column: 16, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [103, 104], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [105, 111], + loc: { + start: { column: 22, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop1", + + range: [112, 117], + loc: { + start: { column: 29, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [117, 118], + loc: { + start: { column: 34, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [122, 123], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "configurable", + + range: [123, 135], + loc: { + start: { column: 3, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [135, 136], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Boolean { + type: "Boolean", + value: "false", + + range: [136, 141], + loc: { + start: { column: 16, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [141, 142], + loc: { + start: { column: 21, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [145, 151], + loc: { + start: { column: 2, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop2", + + range: [152, 157], + loc: { + start: { column: 9, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [157, 158], + loc: { + start: { column: 14, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [159, 160], + loc: { + start: { column: 0, line: 8 }, + end: { column: 1, line: 8 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..ab07dcffcbe2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/3-Babel-AST.shot @@ -0,0 +1,179 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-factory-static-member Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Literal { + type: "Literal", + raw: "true", + value: true, + + range: [99, 103], + loc: { + start: { column: 16, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "configurable", + + range: [86, 98], + loc: { + start: { column: 3, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + optional: false, + + range: [86, 104], + loc: { + start: { column: 3, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [85, 104], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "prop1", + + range: [112, 117], + loc: { + start: { column: 29, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + static: true, + value: null, + + range: [85, 118], + loc: { + start: { column: 2, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: CallExpression { + type: "CallExpression", + arguments: Array [ + Literal { + type: "Literal", + raw: "false", + value: false, + + range: [136, 141], + loc: { + start: { column: 16, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, + ], + callee: Identifier { + type: "Identifier", + name: "configurable", + + range: [123, 135], + loc: { + start: { column: 3, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + optional: false, + + range: [123, 142], + loc: { + start: { column: 3, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, + + range: [122, 142], + loc: { + start: { column: 2, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "prop2", + + range: [152, 157], + loc: { + start: { column: 9, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + static: true, + value: null, + + range: [122, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 15, line: 7 }, + }, + }, + ], + + range: [81, 160], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "A", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 160], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], + sourceType: "script", + + range: [73, 161], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..30814bcf07f8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,206 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-factory-static-member Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [85, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "configurable", + + range: [86, 98], + loc: { + start: { column: 3, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [98, 99], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Boolean { + type: "Boolean", + value: "true", + + range: [99, 103], + loc: { + start: { column: 16, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [103, 104], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [105, 111], + loc: { + start: { column: 22, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop1", + + range: [112, 117], + loc: { + start: { column: 29, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [117, 118], + loc: { + start: { column: 34, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [122, 123], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "configurable", + + range: [123, 135], + loc: { + start: { column: 3, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [135, 136], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Boolean { + type: "Boolean", + value: "false", + + range: [136, 141], + loc: { + start: { column: 16, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [141, 142], + loc: { + start: { column: 21, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [145, 151], + loc: { + start: { column: 2, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop2", + + range: [152, 157], + loc: { + start: { column: 9, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [157, 158], + loc: { + start: { column: 14, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [159, 160], + loc: { + start: { column: 0, line: 8 }, + end: { column: 1, line: 8 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..600f2728babb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,187 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-factory-static-member AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + decorators: Array [ + Decorator { + type: 'Decorator', + expression: CallExpression { + type: 'CallExpression', + arguments: Array [ + Literal { + type: 'Literal', + raw: 'true', + value: true, + + range: [99, 103], + loc: { + start: { column: 16, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + callee: Identifier { + type: 'Identifier', + name: 'configurable', + + range: [86, 98], + loc: { + start: { column: 3, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + optional: false, + + range: [86, 104], + loc: { + start: { column: 3, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [85, 104], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + ], + key: Identifier { + type: 'Identifier', + name: 'prop1', + + range: [112, 117], + loc: { + start: { column: 29, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, +- override: false, + static: true, + value: null, + + range: [85, 118], + loc: { + start: { column: 2, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + decorators: Array [ + Decorator { + type: 'Decorator', + expression: CallExpression { + type: 'CallExpression', + arguments: Array [ + Literal { + type: 'Literal', + raw: 'false', + value: false, + + range: [136, 141], + loc: { + start: { column: 16, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, + ], + callee: Identifier { + type: 'Identifier', + name: 'configurable', + + range: [123, 135], + loc: { + start: { column: 3, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + optional: false, + + range: [123, 142], + loc: { + start: { column: 3, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, + + range: [122, 142], + loc: { + start: { column: 2, line: 6 }, + end: { column: 22, line: 6 }, + }, + }, + ], + key: Identifier { + type: 'Identifier', + name: 'prop2', + + range: [152, 157], + loc: { + start: { column: 9, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, +- override: false, + static: true, + value: null, + + range: [122, 158], + loc: { + start: { column: 2, line: 6 }, + end: { column: 15, line: 7 }, + }, + }, + ], + + range: [81, 160], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'A', + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 160], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 8 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 161], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 9 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..49c8023f74d7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-factory-static-member AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/fixture.ts b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/fixture.ts new file mode 100644 index 000000000000..0b6cc5ab757a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/fixture.ts @@ -0,0 +1,7 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class B { + @foo x; + @bar + y; +} diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..8c553fa54dcb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,137 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-instance-member TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "foo", + + range: [86, 89], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + + range: [85, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "x", + + range: [90, 91], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + override: false, + static: false, + value: null, + + range: [85, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "bar", + + range: [96, 99], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + + range: [95, 99], + loc: { + start: { column: 2, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "y", + + range: [102, 103], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + override: false, + static: false, + value: null, + + range: [95, 104], + loc: { + start: { column: 2, line: 5 }, + end: { column: 4, line: 6 }, + }, + }, + ], + + range: [81, 106], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "B", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..b95a5753e4bc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-instance-member TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [85, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [86, 89], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [90, 91], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [91, 92], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [95, 96], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [96, 99], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "y", + + range: [102, 103], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [103, 104], + loc: { + start: { column: 3, line: 6 }, + end: { column: 4, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [105, 106], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..13515331c766 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/3-Babel-AST.shot @@ -0,0 +1,133 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-instance-member Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "foo", + + range: [86, 89], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + + range: [85, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "x", + + range: [90, 91], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + static: false, + value: null, + + range: [85, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "bar", + + range: [96, 99], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + + range: [95, 99], + loc: { + start: { column: 2, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "y", + + range: [102, 103], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + static: false, + value: null, + + range: [95, 104], + loc: { + start: { column: 2, line: 5 }, + end: { column: 4, line: 6 }, + }, + }, + ], + + range: [81, 106], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "B", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..65a0bb9965e1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-instance-member Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [85, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [86, 89], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [90, 91], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [91, 92], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [95, 96], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [96, 99], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "y", + + range: [102, 103], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [103, 104], + loc: { + start: { column: 3, line: 6 }, + end: { column: 4, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [105, 106], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..01d21db7abad --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,141 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-instance-member AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + decorators: Array [ + Decorator { + type: 'Decorator', + expression: Identifier { + type: 'Identifier', + name: 'foo', + + range: [86, 89], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + + range: [85, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + ], + key: Identifier { + type: 'Identifier', + name: 'x', + + range: [90, 91], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, +- override: false, + static: false, + value: null, + + range: [85, 92], + loc: { + start: { column: 2, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + decorators: Array [ + Decorator { + type: 'Decorator', + expression: Identifier { + type: 'Identifier', + name: 'bar', + + range: [96, 99], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + + range: [95, 99], + loc: { + start: { column: 2, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + ], + key: Identifier { + type: 'Identifier', + name: 'y', + + range: [102, 103], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, +- override: false, + static: false, + value: null, + + range: [95, 104], + loc: { + start: { column: 2, line: 5 }, + end: { column: 4, line: 6 }, + }, + }, + ], + + range: [81, 106], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'B', + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 107], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..c89896ed424d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-instance-member AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/fixture.ts b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/fixture.ts new file mode 100644 index 000000000000..9deaf8d07cbd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/fixture.ts @@ -0,0 +1,7 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class C { + @baz static a; + @qux + static b; +} diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..747ae05d1e84 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,137 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-static-member TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "baz", + + range: [86, 89], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + + range: [85, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "a", + + range: [97, 98], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + override: false, + static: true, + value: null, + + range: [85, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + declare: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "qux", + + range: [103, 106], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + + range: [102, 106], + loc: { + start: { column: 2, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "b", + + range: [116, 117], + loc: { + start: { column: 9, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + override: false, + static: true, + value: null, + + range: [102, 118], + loc: { + start: { column: 2, line: 5 }, + end: { column: 11, line: 6 }, + }, + }, + ], + + range: [81, 120], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "C", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 120], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..4656944d0606 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-static-member TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [85, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [86, 89], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [90, 96], + loc: { + start: { column: 7, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [97, 98], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [98, 99], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [102, 103], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "qux", + + range: [103, 106], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [109, 115], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [116, 117], + loc: { + start: { column: 9, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [117, 118], + loc: { + start: { column: 10, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [119, 120], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..e9566ee72efc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/3-Babel-AST.shot @@ -0,0 +1,133 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-static-member Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "baz", + + range: [86, 89], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + + range: [85, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "a", + + range: [97, 98], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + static: true, + value: null, + + range: [85, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + PropertyDefinition { + type: "PropertyDefinition", + computed: false, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "qux", + + range: [103, 106], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + + range: [102, 106], + loc: { + start: { column: 2, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + ], + key: Identifier { + type: "Identifier", + name: "b", + + range: [116, 117], + loc: { + start: { column: 9, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + static: true, + value: null, + + range: [102, 118], + loc: { + start: { column: 2, line: 5 }, + end: { column: 11, line: 6 }, + }, + }, + ], + + range: [81, 120], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "C", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 120], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..814edd131c44 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-static-member Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [85, 86], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [86, 89], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [90, 96], + loc: { + start: { column: 7, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [97, 98], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [98, 99], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [102, 103], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "qux", + + range: [103, 106], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [109, 115], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [116, 117], + loc: { + start: { column: 9, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [117, 118], + loc: { + start: { column: 10, line: 6 }, + end: { column: 11, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [119, 120], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..8e633925fae0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,141 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-static-member AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + decorators: Array [ + Decorator { + type: 'Decorator', + expression: Identifier { + type: 'Identifier', + name: 'baz', + + range: [86, 89], + loc: { + start: { column: 3, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + + range: [85, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + ], + key: Identifier { + type: 'Identifier', + name: 'a', + + range: [97, 98], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, +- override: false, + static: true, + value: null, + + range: [85, 99], + loc: { + start: { column: 2, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + PropertyDefinition { + type: 'PropertyDefinition', + computed: false, +- declare: false, + decorators: Array [ + Decorator { + type: 'Decorator', + expression: Identifier { + type: 'Identifier', + name: 'qux', + + range: [103, 106], + loc: { + start: { column: 3, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + + range: [102, 106], + loc: { + start: { column: 2, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + ], + key: Identifier { + type: 'Identifier', + name: 'b', + + range: [116, 117], + loc: { + start: { column: 9, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, +- override: false, + static: true, + value: null, + + range: [102, 118], + loc: { + start: { column: 2, line: 5 }, + end: { column: 11, line: 6 }, + }, + }, + ], + + range: [81, 120], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'C', + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 120], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..f45f82743557 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-static-member AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/fixture.ts new file mode 100644 index 000000000000..9ccc00008f3a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Foo = string[]; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..cc32cb09d97a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,53 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types array-type TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSArrayType { + type: "TSArrayType", + elementType: TSStringKeyword { + type: "TSStringKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [84, 92], + loc: { + start: { column: 11, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..c91357a624d1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types array-type TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..7d37fee24ea7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/3-Babel-AST.shot @@ -0,0 +1,53 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types array-type Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSArrayType { + type: "TSArrayType", + elementType: TSStringKeyword { + type: "TSStringKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [84, 92], + loc: { + start: { column: 11, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [73, 93], + loc: { + start: { column: 0, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..bd7873afde21 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types array-type Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..66962c9338cf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types array-type AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..8089cae4efe8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types array-type AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/fixture.ts new file mode 100644 index 000000000000..b4dda92d2ba0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/fixture.ts @@ -0,0 +1,9 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Unpacked = T extends (infer U)[] + ? U + : T extends infer U + ? U + : T extends Promise + ? U + : T; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..9bffe5d67176 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,356 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer-nested TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Unpacked", + + range: [78, 86], + loc: { + start: { column: 5, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + typeAnnotation: TSConditionalType { + type: "TSConditionalType", + checkType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + extendsType: TSArrayType { + type: "TSArrayType", + elementType: TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "U", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + out: false, + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + + range: [103, 110], + loc: { + start: { column: 30, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + + range: [102, 113], + loc: { + start: { column: 29, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + falseType: TSConditionalType { + type: "TSConditionalType", + checkType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [124, 125], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + + range: [124, 125], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + extendsType: TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "U", + + range: [140, 141], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + out: false, + + range: [140, 141], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + + range: [134, 141], + loc: { + start: { column: 14, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + falseType: TSConditionalType { + type: "TSConditionalType", + checkType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [152, 153], + loc: { + start: { column: 4, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + + range: [152, 153], + loc: { + start: { column: 4, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + extendsType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Promise", + + range: [162, 169], + loc: { + start: { column: 14, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "U", + + range: [176, 177], + loc: { + start: { column: 28, line: 7 }, + end: { column: 29, line: 7 }, + }, + }, + out: false, + + range: [176, 177], + loc: { + start: { column: 28, line: 7 }, + end: { column: 29, line: 7 }, + }, + }, + + range: [170, 177], + loc: { + start: { column: 22, line: 7 }, + end: { column: 29, line: 7 }, + }, + }, + ], + + range: [169, 178], + loc: { + start: { column: 21, line: 7 }, + end: { column: 30, line: 7 }, + }, + }, + + range: [162, 178], + loc: { + start: { column: 14, line: 7 }, + end: { column: 30, line: 7 }, + }, + }, + falseType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [189, 190], + loc: { + start: { column: 4, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + + range: [189, 190], + loc: { + start: { column: 4, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + trueType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [183, 184], + loc: { + start: { column: 4, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + + range: [183, 184], + loc: { + start: { column: 4, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + + range: [152, 190], + loc: { + start: { column: 4, line: 7 }, + end: { column: 5, line: 9 }, + }, + }, + trueType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [146, 147], + loc: { + start: { column: 4, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + + range: [146, 147], + loc: { + start: { column: 4, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + + range: [124, 190], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 9 }, + }, + }, + trueType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [118, 119], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + + range: [118, 119], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + + range: [92, 190], + loc: { + start: { column: 19, line: 3 }, + end: { column: 5, line: 9 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + out: false, + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [73, 191], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 9 }, + }, + }, + ], + sourceType: "script", + + range: [73, 192], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 10 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..0d0c01c9b039 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,366 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer-nested TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Unpacked", + + range: [78, 86], + loc: { + start: { column: 5, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [94, 101], + loc: { + start: { column: 21, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [103, 108], + loc: { + start: { column: 30, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [116, 117], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [118, 119], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [122, 123], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [124, 125], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [126, 133], + loc: { + start: { column: 6, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [134, 139], + loc: { + start: { column: 14, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [140, 141], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [144, 145], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [146, 147], + loc: { + start: { column: 4, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [150, 151], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [152, 153], + loc: { + start: { column: 4, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [154, 161], + loc: { + start: { column: 6, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "Promise", + + range: [162, 169], + loc: { + start: { column: 14, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [169, 170], + loc: { + start: { column: 21, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [170, 175], + loc: { + start: { column: 22, line: 7 }, + end: { column: 27, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [176, 177], + loc: { + start: { column: 28, line: 7 }, + end: { column: 29, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [177, 178], + loc: { + start: { column: 29, line: 7 }, + end: { column: 30, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [181, 182], + loc: { + start: { column: 2, line: 8 }, + end: { column: 3, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [183, 184], + loc: { + start: { column: 4, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [187, 188], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [189, 190], + loc: { + start: { column: 4, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [190, 191], + loc: { + start: { column: 5, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..3b698a334893 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/3-Babel-AST.shot @@ -0,0 +1,321 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer-nested Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Unpacked", + + range: [78, 86], + loc: { + start: { column: 5, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + typeAnnotation: TSConditionalType { + type: "TSConditionalType", + checkType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + extendsType: TSArrayType { + type: "TSArrayType", + elementType: TSParenthesizedType { + type: "TSParenthesizedType", + typeAnnotation: TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + name: "U", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + + range: [103, 110], + loc: { + start: { column: 30, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + + range: [102, 111], + loc: { + start: { column: 29, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [102, 113], + loc: { + start: { column: 29, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + falseType: TSConditionalType { + type: "TSConditionalType", + checkType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [124, 125], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + + range: [124, 125], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + extendsType: TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + name: "U", + + range: [140, 141], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + + range: [134, 141], + loc: { + start: { column: 14, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + falseType: TSConditionalType { + type: "TSConditionalType", + checkType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [152, 153], + loc: { + start: { column: 4, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + + range: [152, 153], + loc: { + start: { column: 4, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + extendsType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Promise", + + range: [162, 169], + loc: { + start: { column: 14, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + name: "U", + + range: [176, 177], + loc: { + start: { column: 28, line: 7 }, + end: { column: 29, line: 7 }, + }, + }, + + range: [170, 177], + loc: { + start: { column: 22, line: 7 }, + end: { column: 29, line: 7 }, + }, + }, + ], + + range: [169, 178], + loc: { + start: { column: 21, line: 7 }, + end: { column: 30, line: 7 }, + }, + }, + + range: [162, 178], + loc: { + start: { column: 14, line: 7 }, + end: { column: 30, line: 7 }, + }, + }, + falseType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [189, 190], + loc: { + start: { column: 4, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + + range: [189, 190], + loc: { + start: { column: 4, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + trueType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [183, 184], + loc: { + start: { column: 4, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + + range: [183, 184], + loc: { + start: { column: 4, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + + range: [152, 190], + loc: { + start: { column: 4, line: 7 }, + end: { column: 5, line: 9 }, + }, + }, + trueType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [146, 147], + loc: { + start: { column: 4, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + + range: [146, 147], + loc: { + start: { column: 4, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + + range: [124, 190], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 9 }, + }, + }, + trueType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [118, 119], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + + range: [118, 119], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + + range: [92, 190], + loc: { + start: { column: 19, line: 3 }, + end: { column: 5, line: 9 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [73, 191], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 9 }, + }, + }, + ], + sourceType: "script", + + range: [73, 192], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 10 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..a76304ead586 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,366 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer-nested Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Unpacked", + + range: [78, 86], + loc: { + start: { column: 5, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [94, 101], + loc: { + start: { column: 21, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [103, 108], + loc: { + start: { column: 30, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [116, 117], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [118, 119], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [122, 123], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [124, 125], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [126, 133], + loc: { + start: { column: 6, line: 5 }, + end: { column: 13, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [134, 139], + loc: { + start: { column: 14, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [140, 141], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [144, 145], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [146, 147], + loc: { + start: { column: 4, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [150, 151], + loc: { + start: { column: 2, line: 7 }, + end: { column: 3, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [152, 153], + loc: { + start: { column: 4, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [154, 161], + loc: { + start: { column: 6, line: 7 }, + end: { column: 13, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "Promise", + + range: [162, 169], + loc: { + start: { column: 14, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [169, 170], + loc: { + start: { column: 21, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [170, 175], + loc: { + start: { column: 22, line: 7 }, + end: { column: 27, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [176, 177], + loc: { + start: { column: 28, line: 7 }, + end: { column: 29, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [177, 178], + loc: { + start: { column: 29, line: 7 }, + end: { column: 30, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [181, 182], + loc: { + start: { column: 2, line: 8 }, + end: { column: 3, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [183, 184], + loc: { + start: { column: 4, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [187, 188], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [189, 190], + loc: { + start: { column: 4, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [190, 191], + loc: { + start: { column: 5, line: 9 }, + end: { column: 6, line: 9 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..390ac4c254d3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,374 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'Unpacked', + + range: [78, 86], + loc: { + start: { column: 5, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + typeAnnotation: TSConditionalType { + type: 'TSConditionalType', + checkType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + extendsType: TSArrayType { + type: 'TSArrayType', +- elementType: TSInferType { +- type: 'TSInferType', +- typeParameter: TSTypeParameter { +- type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', ++ elementType: TSParenthesizedType { ++ type: 'TSParenthesizedType', ++ typeAnnotation: TSInferType { ++ type: 'TSInferType', ++ typeParameter: TSTypeParameter { ++ type: 'TSTypeParameter', + name: 'U', + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, +- out: false, + +- range: [109, 110], ++ range: [103, 110], + loc: { +- start: { column: 36, line: 3 }, ++ start: { column: 30, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + +- range: [103, 110], ++ range: [102, 111], + loc: { +- start: { column: 30, line: 3 }, +- end: { column: 37, line: 3 }, ++ start: { column: 29, line: 3 }, ++ end: { column: 38, line: 3 }, + }, + }, + + range: [102, 113], + loc: { + start: { column: 29, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + falseType: TSConditionalType { + type: 'TSConditionalType', + checkType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [124, 125], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + + range: [124, 125], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + extendsType: TSInferType { + type: 'TSInferType', + typeParameter: TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'U', +- +- range: [140, 141], +- loc: { +- start: { column: 20, line: 5 }, +- end: { column: 21, line: 5 }, +- }, +- }, +- out: false, ++ name: 'U', + + range: [140, 141], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + + range: [134, 141], + loc: { + start: { column: 14, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + falseType: TSConditionalType { + type: 'TSConditionalType', + checkType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [152, 153], + loc: { + start: { column: 4, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + + range: [152, 153], + loc: { + start: { column: 4, line: 7 }, + end: { column: 5, line: 7 }, + }, + }, + extendsType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'Promise', + + range: [162, 169], + loc: { + start: { column: 14, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSInferType { + type: 'TSInferType', + typeParameter: TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'U', +- +- range: [176, 177], +- loc: { +- start: { column: 28, line: 7 }, +- end: { column: 29, line: 7 }, +- }, +- }, +- out: false, ++ name: 'U', + + range: [176, 177], + loc: { + start: { column: 28, line: 7 }, + end: { column: 29, line: 7 }, + }, + }, + + range: [170, 177], + loc: { + start: { column: 22, line: 7 }, + end: { column: 29, line: 7 }, + }, + }, + ], + + range: [169, 178], + loc: { + start: { column: 21, line: 7 }, + end: { column: 30, line: 7 }, + }, + }, + + range: [162, 178], + loc: { + start: { column: 14, line: 7 }, + end: { column: 30, line: 7 }, + }, + }, + falseType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [189, 190], + loc: { + start: { column: 4, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + + range: [189, 190], + loc: { + start: { column: 4, line: 9 }, + end: { column: 5, line: 9 }, + }, + }, + trueType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'U', + + range: [183, 184], + loc: { + start: { column: 4, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + + range: [183, 184], + loc: { + start: { column: 4, line: 8 }, + end: { column: 5, line: 8 }, + }, + }, + + range: [152, 190], + loc: { + start: { column: 4, line: 7 }, + end: { column: 5, line: 9 }, + }, + }, + trueType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'U', + + range: [146, 147], + loc: { + start: { column: 4, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + + range: [146, 147], + loc: { + start: { column: 4, line: 6 }, + end: { column: 5, line: 6 }, + }, + }, + + range: [124, 190], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 9 }, + }, + }, + trueType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'U', + + range: [118, 119], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + + range: [118, 119], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + + range: [92, 190], + loc: { + start: { column: 19, line: 3 }, + end: { column: 5, line: 9 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [87, 88], +- loc: { +- start: { column: 14, line: 3 }, +- end: { column: 15, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + + range: [73, 191], + loc: { + start: { column: 0, line: 3 }, + end: { column: 6, line: 9 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 192], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 10 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..b3033fb01e56 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/fixture.ts new file mode 100644 index 000000000000..6a613ee3a466 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Foo = T extends { a: infer U; b: infer U } ? U : never; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..a8b7cf3db2ff --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,252 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer-simple TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSConditionalType { + type: "TSConditionalType", + checkType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + extendsType: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "a", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "U", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + out: false, + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [102, 109], + loc: { + start: { column: 29, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [100, 109], + loc: { + start: { column: 27, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [99, 110], + loc: { + start: { column: 26, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "b", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "U", + + range: [120, 121], + loc: { + start: { column: 47, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + out: false, + + range: [120, 121], + loc: { + start: { column: 47, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + + range: [114, 121], + loc: { + start: { column: 41, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + + range: [112, 121], + loc: { + start: { column: 39, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + + range: [111, 121], + loc: { + start: { column: 38, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + ], + + range: [97, 123], + loc: { + start: { column: 24, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + falseType: TSNeverKeyword { + type: "TSNeverKeyword", + + range: [130, 135], + loc: { + start: { column: 57, line: 3 }, + end: { column: 62, line: 3 }, + }, + }, + trueType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [126, 127], + loc: { + start: { column: 53, line: 3 }, + end: { column: 54, line: 3 }, + }, + }, + + range: [126, 127], + loc: { + start: { column: 53, line: 3 }, + end: { column: 54, line: 3 }, + }, + }, + + range: [87, 135], + loc: { + start: { column: 14, line: 3 }, + end: { column: 62, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + out: false, + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + ], + + range: [81, 84], + loc: { + start: { column: 8, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [73, 136], + loc: { + start: { column: 0, line: 3 }, + end: { column: 63, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 137], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..a81808a72b07 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,246 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer-simple TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [89, 96], + loc: { + start: { column: 16, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [102, 107], + loc: { + start: { column: 29, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [114, 119], + loc: { + start: { column: 41, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [120, 121], + loc: { + start: { column: 47, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [122, 123], + loc: { + start: { column: 49, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [124, 125], + loc: { + start: { column: 51, line: 3 }, + end: { column: 52, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [126, 127], + loc: { + start: { column: 53, line: 3 }, + end: { column: 54, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [128, 129], + loc: { + start: { column: 55, line: 3 }, + end: { column: 56, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "never", + + range: [130, 135], + loc: { + start: { column: 57, line: 3 }, + end: { column: 62, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [135, 136], + loc: { + start: { column: 62, line: 3 }, + end: { column: 63, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..8ce395793ea2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/3-Babel-AST.shot @@ -0,0 +1,219 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer-simple Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSConditionalType { + type: "TSConditionalType", + checkType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + extendsType: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "a", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + name: "U", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [102, 109], + loc: { + start: { column: 29, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [100, 109], + loc: { + start: { column: 27, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [99, 110], + loc: { + start: { column: 26, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "b", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + name: "U", + + range: [120, 121], + loc: { + start: { column: 47, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + + range: [114, 121], + loc: { + start: { column: 41, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + + range: [112, 121], + loc: { + start: { column: 39, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + + range: [111, 121], + loc: { + start: { column: 38, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + ], + + range: [97, 123], + loc: { + start: { column: 24, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + falseType: TSNeverKeyword { + type: "TSNeverKeyword", + + range: [130, 135], + loc: { + start: { column: 57, line: 3 }, + end: { column: 62, line: 3 }, + }, + }, + trueType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [126, 127], + loc: { + start: { column: 53, line: 3 }, + end: { column: 54, line: 3 }, + }, + }, + + range: [126, 127], + loc: { + start: { column: 53, line: 3 }, + end: { column: 54, line: 3 }, + }, + }, + + range: [87, 135], + loc: { + start: { column: 14, line: 3 }, + end: { column: 62, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + ], + + range: [81, 84], + loc: { + start: { column: 8, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [73, 136], + loc: { + start: { column: 0, line: 3 }, + end: { column: 63, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 137], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..2225197d7442 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,246 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer-simple Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [89, 96], + loc: { + start: { column: 16, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [102, 107], + loc: { + start: { column: 29, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [114, 119], + loc: { + start: { column: 41, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [120, 121], + loc: { + start: { column: 47, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [122, 123], + loc: { + start: { column: 49, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [124, 125], + loc: { + start: { column: 51, line: 3 }, + end: { column: 52, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [126, 127], + loc: { + start: { column: 53, line: 3 }, + end: { column: 54, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [128, 129], + loc: { + start: { column: 55, line: 3 }, + end: { column: 56, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "never", + + range: [130, 135], + loc: { + start: { column: 57, line: 3 }, + end: { column: 62, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [135, 136], + loc: { + start: { column: 62, line: 3 }, + end: { column: 63, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..a4c653aa539c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,259 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer-simple AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSConditionalType { + type: 'TSConditionalType', + checkType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + extendsType: TSTypeLiteral { + type: 'TSTypeLiteral', + members: Array [ + TSPropertySignature { + type: 'TSPropertySignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'a', + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSInferType { + type: 'TSInferType', + typeParameter: TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'U', +- +- range: [108, 109], +- loc: { +- start: { column: 35, line: 3 }, +- end: { column: 36, line: 3 }, +- }, +- }, +- out: false, ++ name: 'U', + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [102, 109], + loc: { + start: { column: 29, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [100, 109], + loc: { + start: { column: 27, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [99, 110], + loc: { + start: { column: 26, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + TSPropertySignature { + type: 'TSPropertySignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'b', + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSInferType { + type: 'TSInferType', + typeParameter: TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'U', +- +- range: [120, 121], +- loc: { +- start: { column: 47, line: 3 }, +- end: { column: 48, line: 3 }, +- }, +- }, +- out: false, ++ name: 'U', + + range: [120, 121], + loc: { + start: { column: 47, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + + range: [114, 121], + loc: { + start: { column: 41, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + + range: [112, 121], + loc: { + start: { column: 39, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + + range: [111, 121], + loc: { + start: { column: 38, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + ], + + range: [97, 123], + loc: { + start: { column: 24, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + falseType: TSNeverKeyword { + type: 'TSNeverKeyword', + + range: [130, 135], + loc: { + start: { column: 57, line: 3 }, + end: { column: 62, line: 3 }, + }, + }, + trueType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'U', + + range: [126, 127], + loc: { + start: { column: 53, line: 3 }, + end: { column: 54, line: 3 }, + }, + }, + + range: [126, 127], + loc: { + start: { column: 53, line: 3 }, + end: { column: 54, line: 3 }, + }, + }, + + range: [87, 135], + loc: { + start: { column: 14, line: 3 }, + end: { column: 62, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [82, 83], +- loc: { +- start: { column: 9, line: 3 }, +- end: { column: 10, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + ], + + range: [81, 84], + loc: { + start: { column: 8, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [73, 136], + loc: { + start: { column: 0, line: 3 }, + end: { column: 63, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 137], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..9b8d03a0f437 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer-simple AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/fixture.ts new file mode 100644 index 000000000000..4bea2236667f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/fixture.ts @@ -0,0 +1,15 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type X3 = T extends [infer U extends number] ? MustBeNumber : never; +type X4 = T extends [infer U extends number, infer U extends number] + ? MustBeNumber + : never; +type X5 = T extends [infer U extends number, infer U] + ? MustBeNumber + : never; +type X6 = T extends [infer U, infer U extends number] + ? MustBeNumber + : never; +type X7 = T extends [infer U extends string, infer U extends number] + ? U + : never; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..f63f70371c8c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,1059 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "X3", + + range: [78, 80], + loc: { + start: { column: 5, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + typeAnnotation: TSConditionalType { + type: "TSConditionalType", + checkType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + extendsType: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [113, 119], + loc: { + start: { column: 40, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "U", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + out: false, + + range: [103, 119], + loc: { + start: { column: 30, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [97, 119], + loc: { + start: { column: 24, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + ], + + range: [96, 120], + loc: { + start: { column: 23, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + falseType: TSNeverKeyword { + type: "TSNeverKeyword", + + range: [141, 146], + loc: { + start: { column: 68, line: 3 }, + end: { column: 73, line: 3 }, + }, + }, + trueType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "MustBeNumber", + + range: [123, 135], + loc: { + start: { column: 50, line: 3 }, + end: { column: 62, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [136, 137], + loc: { + start: { column: 63, line: 3 }, + end: { column: 64, line: 3 }, + }, + }, + + range: [136, 137], + loc: { + start: { column: 63, line: 3 }, + end: { column: 64, line: 3 }, + }, + }, + ], + + range: [135, 138], + loc: { + start: { column: 62, line: 3 }, + end: { column: 65, line: 3 }, + }, + }, + + range: [123, 138], + loc: { + start: { column: 50, line: 3 }, + end: { column: 65, line: 3 }, + }, + }, + + range: [86, 146], + loc: { + start: { column: 13, line: 3 }, + end: { column: 73, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + out: false, + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + ], + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + + range: [73, 147], + loc: { + start: { column: 0, line: 3 }, + end: { column: 74, line: 3 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "X4", + + range: [153, 155], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + typeAnnotation: TSConditionalType { + type: "TSConditionalType", + checkType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [161, 162], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + + range: [161, 162], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + extendsType: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [188, 194], + loc: { + start: { column: 40, line: 4 }, + end: { column: 46, line: 4 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "U", + + range: [178, 179], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + out: false, + + range: [178, 194], + loc: { + start: { column: 30, line: 4 }, + end: { column: 46, line: 4 }, + }, + }, + + range: [172, 194], + loc: { + start: { column: 24, line: 4 }, + end: { column: 46, line: 4 }, + }, + }, + TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [212, 218], + loc: { + start: { column: 64, line: 4 }, + end: { column: 70, line: 4 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "U", + + range: [202, 203], + loc: { + start: { column: 54, line: 4 }, + end: { column: 55, line: 4 }, + }, + }, + out: false, + + range: [202, 218], + loc: { + start: { column: 54, line: 4 }, + end: { column: 70, line: 4 }, + }, + }, + + range: [196, 218], + loc: { + start: { column: 48, line: 4 }, + end: { column: 70, line: 4 }, + }, + }, + ], + + range: [171, 219], + loc: { + start: { column: 23, line: 4 }, + end: { column: 71, line: 4 }, + }, + }, + falseType: TSNeverKeyword { + type: "TSNeverKeyword", + + range: [244, 249], + loc: { + start: { column: 4, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + trueType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "MustBeNumber", + + range: [224, 236], + loc: { + start: { column: 4, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [237, 238], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + + range: [237, 238], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + ], + + range: [236, 239], + loc: { + start: { column: 16, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + + range: [224, 239], + loc: { + start: { column: 4, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + + range: [161, 249], + loc: { + start: { column: 13, line: 4 }, + end: { column: 9, line: 6 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [156, 157], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + out: false, + + range: [156, 157], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + ], + + range: [155, 158], + loc: { + start: { column: 7, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [148, 250], + loc: { + start: { column: 0, line: 4 }, + end: { column: 10, line: 6 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "X5", + + range: [256, 258], + loc: { + start: { column: 5, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + typeAnnotation: TSConditionalType { + type: "TSConditionalType", + checkType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [264, 265], + loc: { + start: { column: 13, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + + range: [264, 265], + loc: { + start: { column: 13, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + extendsType: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [291, 297], + loc: { + start: { column: 40, line: 7 }, + end: { column: 46, line: 7 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "U", + + range: [281, 282], + loc: { + start: { column: 30, line: 7 }, + end: { column: 31, line: 7 }, + }, + }, + out: false, + + range: [281, 297], + loc: { + start: { column: 30, line: 7 }, + end: { column: 46, line: 7 }, + }, + }, + + range: [275, 297], + loc: { + start: { column: 24, line: 7 }, + end: { column: 46, line: 7 }, + }, + }, + TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "U", + + range: [305, 306], + loc: { + start: { column: 54, line: 7 }, + end: { column: 55, line: 7 }, + }, + }, + out: false, + + range: [305, 306], + loc: { + start: { column: 54, line: 7 }, + end: { column: 55, line: 7 }, + }, + }, + + range: [299, 306], + loc: { + start: { column: 48, line: 7 }, + end: { column: 55, line: 7 }, + }, + }, + ], + + range: [274, 307], + loc: { + start: { column: 23, line: 7 }, + end: { column: 56, line: 7 }, + }, + }, + falseType: TSNeverKeyword { + type: "TSNeverKeyword", + + range: [332, 337], + loc: { + start: { column: 4, line: 9 }, + end: { column: 9, line: 9 }, + }, + }, + trueType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "MustBeNumber", + + range: [312, 324], + loc: { + start: { column: 4, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [325, 326], + loc: { + start: { column: 17, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + + range: [325, 326], + loc: { + start: { column: 17, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + ], + + range: [324, 327], + loc: { + start: { column: 16, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + + range: [312, 327], + loc: { + start: { column: 4, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + + range: [264, 337], + loc: { + start: { column: 13, line: 7 }, + end: { column: 9, line: 9 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [259, 260], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + out: false, + + range: [259, 260], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + ], + + range: [258, 261], + loc: { + start: { column: 7, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + + range: [251, 338], + loc: { + start: { column: 0, line: 7 }, + end: { column: 10, line: 9 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "X6", + + range: [344, 346], + loc: { + start: { column: 5, line: 10 }, + end: { column: 7, line: 10 }, + }, + }, + typeAnnotation: TSConditionalType { + type: "TSConditionalType", + checkType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [352, 353], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + + range: [352, 353], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + extendsType: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "U", + + range: [369, 370], + loc: { + start: { column: 30, line: 10 }, + end: { column: 31, line: 10 }, + }, + }, + out: false, + + range: [369, 370], + loc: { + start: { column: 30, line: 10 }, + end: { column: 31, line: 10 }, + }, + }, + + range: [363, 370], + loc: { + start: { column: 24, line: 10 }, + end: { column: 31, line: 10 }, + }, + }, + TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [388, 394], + loc: { + start: { column: 49, line: 10 }, + end: { column: 55, line: 10 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "U", + + range: [378, 379], + loc: { + start: { column: 39, line: 10 }, + end: { column: 40, line: 10 }, + }, + }, + out: false, + + range: [378, 394], + loc: { + start: { column: 39, line: 10 }, + end: { column: 55, line: 10 }, + }, + }, + + range: [372, 394], + loc: { + start: { column: 33, line: 10 }, + end: { column: 55, line: 10 }, + }, + }, + ], + + range: [362, 395], + loc: { + start: { column: 23, line: 10 }, + end: { column: 56, line: 10 }, + }, + }, + falseType: TSNeverKeyword { + type: "TSNeverKeyword", + + range: [420, 425], + loc: { + start: { column: 4, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + trueType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "MustBeNumber", + + range: [400, 412], + loc: { + start: { column: 4, line: 11 }, + end: { column: 16, line: 11 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [413, 414], + loc: { + start: { column: 17, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + + range: [413, 414], + loc: { + start: { column: 17, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + ], + + range: [412, 415], + loc: { + start: { column: 16, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + + range: [400, 415], + loc: { + start: { column: 4, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + + range: [352, 425], + loc: { + start: { column: 13, line: 10 }, + end: { column: 9, line: 12 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [347, 348], + loc: { + start: { column: 8, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + out: false, + + range: [347, 348], + loc: { + start: { column: 8, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + ], + + range: [346, 349], + loc: { + start: { column: 7, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + + range: [339, 426], + loc: { + start: { column: 0, line: 10 }, + end: { column: 10, line: 12 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "X7", + + range: [432, 434], + loc: { + start: { column: 5, line: 13 }, + end: { column: 7, line: 13 }, + }, + }, + typeAnnotation: TSConditionalType { + type: "TSConditionalType", + checkType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [440, 441], + loc: { + start: { column: 13, line: 13 }, + end: { column: 14, line: 13 }, + }, + }, + + range: [440, 441], + loc: { + start: { column: 13, line: 13 }, + end: { column: 14, line: 13 }, + }, + }, + extendsType: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSStringKeyword { + type: "TSStringKeyword", + + range: [467, 473], + loc: { + start: { column: 40, line: 13 }, + end: { column: 46, line: 13 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "U", + + range: [457, 458], + loc: { + start: { column: 30, line: 13 }, + end: { column: 31, line: 13 }, + }, + }, + out: false, + + range: [457, 473], + loc: { + start: { column: 30, line: 13 }, + end: { column: 46, line: 13 }, + }, + }, + + range: [451, 473], + loc: { + start: { column: 24, line: 13 }, + end: { column: 46, line: 13 }, + }, + }, + TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [491, 497], + loc: { + start: { column: 64, line: 13 }, + end: { column: 70, line: 13 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "U", + + range: [481, 482], + loc: { + start: { column: 54, line: 13 }, + end: { column: 55, line: 13 }, + }, + }, + out: false, + + range: [481, 497], + loc: { + start: { column: 54, line: 13 }, + end: { column: 70, line: 13 }, + }, + }, + + range: [475, 497], + loc: { + start: { column: 48, line: 13 }, + end: { column: 70, line: 13 }, + }, + }, + ], + + range: [450, 498], + loc: { + start: { column: 23, line: 13 }, + end: { column: 71, line: 13 }, + }, + }, + falseType: TSNeverKeyword { + type: "TSNeverKeyword", + + range: [509, 514], + loc: { + start: { column: 4, line: 15 }, + end: { column: 9, line: 15 }, + }, + }, + trueType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [503, 504], + loc: { + start: { column: 4, line: 14 }, + end: { column: 5, line: 14 }, + }, + }, + + range: [503, 504], + loc: { + start: { column: 4, line: 14 }, + end: { column: 5, line: 14 }, + }, + }, + + range: [440, 514], + loc: { + start: { column: 13, line: 13 }, + end: { column: 9, line: 15 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [435, 436], + loc: { + start: { column: 8, line: 13 }, + end: { column: 9, line: 13 }, + }, + }, + out: false, + + range: [435, 436], + loc: { + start: { column: 8, line: 13 }, + end: { column: 9, line: 13 }, + }, + }, + ], + + range: [434, 437], + loc: { + start: { column: 7, line: 13 }, + end: { column: 10, line: 13 }, + }, + }, + + range: [427, 515], + loc: { + start: { column: 0, line: 13 }, + end: { column: 10, line: 15 }, + }, + }, + ], + sourceType: "script", + + range: [73, 516], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 16 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..39e473b45515 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,1236 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X3", + + range: [78, 80], + loc: { + start: { column: 5, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [88, 95], + loc: { + start: { column: 15, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [97, 102], + loc: { + start: { column: 24, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [105, 112], + loc: { + start: { column: 32, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [113, 119], + loc: { + start: { column: 40, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [121, 122], + loc: { + start: { column: 48, line: 3 }, + end: { column: 49, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "MustBeNumber", + + range: [123, 135], + loc: { + start: { column: 50, line: 3 }, + end: { column: 62, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [135, 136], + loc: { + start: { column: 62, line: 3 }, + end: { column: 63, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [136, 137], + loc: { + start: { column: 63, line: 3 }, + end: { column: 64, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [137, 138], + loc: { + start: { column: 64, line: 3 }, + end: { column: 65, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [139, 140], + loc: { + start: { column: 66, line: 3 }, + end: { column: 67, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "never", + + range: [141, 146], + loc: { + start: { column: 68, line: 3 }, + end: { column: 73, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [146, 147], + loc: { + start: { column: 73, line: 3 }, + end: { column: 74, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [148, 152], + loc: { + start: { column: 0, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "X4", + + range: [153, 155], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [155, 156], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [156, 157], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [157, 158], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [159, 160], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [161, 162], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [163, 170], + loc: { + start: { column: 15, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [171, 172], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [172, 177], + loc: { + start: { column: 24, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [178, 179], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [180, 187], + loc: { + start: { column: 32, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [188, 194], + loc: { + start: { column: 40, line: 4 }, + end: { column: 46, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [194, 195], + loc: { + start: { column: 46, line: 4 }, + end: { column: 47, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [196, 201], + loc: { + start: { column: 48, line: 4 }, + end: { column: 53, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [202, 203], + loc: { + start: { column: 54, line: 4 }, + end: { column: 55, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [204, 211], + loc: { + start: { column: 56, line: 4 }, + end: { column: 63, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [212, 218], + loc: { + start: { column: 64, line: 4 }, + end: { column: 70, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [218, 219], + loc: { + start: { column: 70, line: 4 }, + end: { column: 71, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [222, 223], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "MustBeNumber", + + range: [224, 236], + loc: { + start: { column: 4, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [236, 237], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [237, 238], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [238, 239], + loc: { + start: { column: 18, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [242, 243], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "never", + + range: [244, 249], + loc: { + start: { column: 4, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [249, 250], + loc: { + start: { column: 9, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [251, 255], + loc: { + start: { column: 0, line: 7 }, + end: { column: 4, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "X5", + + range: [256, 258], + loc: { + start: { column: 5, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [258, 259], + loc: { + start: { column: 7, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [259, 260], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [260, 261], + loc: { + start: { column: 9, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [262, 263], + loc: { + start: { column: 11, line: 7 }, + end: { column: 12, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [264, 265], + loc: { + start: { column: 13, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [266, 273], + loc: { + start: { column: 15, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [274, 275], + loc: { + start: { column: 23, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [275, 280], + loc: { + start: { column: 24, line: 7 }, + end: { column: 29, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [281, 282], + loc: { + start: { column: 30, line: 7 }, + end: { column: 31, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [283, 290], + loc: { + start: { column: 32, line: 7 }, + end: { column: 39, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [291, 297], + loc: { + start: { column: 40, line: 7 }, + end: { column: 46, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [297, 298], + loc: { + start: { column: 46, line: 7 }, + end: { column: 47, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [299, 304], + loc: { + start: { column: 48, line: 7 }, + end: { column: 53, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [305, 306], + loc: { + start: { column: 54, line: 7 }, + end: { column: 55, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [306, 307], + loc: { + start: { column: 55, line: 7 }, + end: { column: 56, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [310, 311], + loc: { + start: { column: 2, line: 8 }, + end: { column: 3, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "MustBeNumber", + + range: [312, 324], + loc: { + start: { column: 4, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [324, 325], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [325, 326], + loc: { + start: { column: 17, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [326, 327], + loc: { + start: { column: 18, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [330, 331], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "never", + + range: [332, 337], + loc: { + start: { column: 4, line: 9 }, + end: { column: 9, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [337, 338], + loc: { + start: { column: 9, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [339, 343], + loc: { + start: { column: 0, line: 10 }, + end: { column: 4, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "X6", + + range: [344, 346], + loc: { + start: { column: 5, line: 10 }, + end: { column: 7, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [346, 347], + loc: { + start: { column: 7, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [347, 348], + loc: { + start: { column: 8, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [348, 349], + loc: { + start: { column: 9, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [350, 351], + loc: { + start: { column: 11, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [352, 353], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [354, 361], + loc: { + start: { column: 15, line: 10 }, + end: { column: 22, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [362, 363], + loc: { + start: { column: 23, line: 10 }, + end: { column: 24, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [363, 368], + loc: { + start: { column: 24, line: 10 }, + end: { column: 29, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [369, 370], + loc: { + start: { column: 30, line: 10 }, + end: { column: 31, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [370, 371], + loc: { + start: { column: 31, line: 10 }, + end: { column: 32, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [372, 377], + loc: { + start: { column: 33, line: 10 }, + end: { column: 38, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [378, 379], + loc: { + start: { column: 39, line: 10 }, + end: { column: 40, line: 10 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [380, 387], + loc: { + start: { column: 41, line: 10 }, + end: { column: 48, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [388, 394], + loc: { + start: { column: 49, line: 10 }, + end: { column: 55, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [394, 395], + loc: { + start: { column: 55, line: 10 }, + end: { column: 56, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [398, 399], + loc: { + start: { column: 2, line: 11 }, + end: { column: 3, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "MustBeNumber", + + range: [400, 412], + loc: { + start: { column: 4, line: 11 }, + end: { column: 16, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [412, 413], + loc: { + start: { column: 16, line: 11 }, + end: { column: 17, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [413, 414], + loc: { + start: { column: 17, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [414, 415], + loc: { + start: { column: 18, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [418, 419], + loc: { + start: { column: 2, line: 12 }, + end: { column: 3, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + value: "never", + + range: [420, 425], + loc: { + start: { column: 4, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [425, 426], + loc: { + start: { column: 9, line: 12 }, + end: { column: 10, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [427, 431], + loc: { + start: { column: 0, line: 13 }, + end: { column: 4, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "X7", + + range: [432, 434], + loc: { + start: { column: 5, line: 13 }, + end: { column: 7, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [434, 435], + loc: { + start: { column: 7, line: 13 }, + end: { column: 8, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [435, 436], + loc: { + start: { column: 8, line: 13 }, + end: { column: 9, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [436, 437], + loc: { + start: { column: 9, line: 13 }, + end: { column: 10, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [438, 439], + loc: { + start: { column: 11, line: 13 }, + end: { column: 12, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [440, 441], + loc: { + start: { column: 13, line: 13 }, + end: { column: 14, line: 13 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [442, 449], + loc: { + start: { column: 15, line: 13 }, + end: { column: 22, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [450, 451], + loc: { + start: { column: 23, line: 13 }, + end: { column: 24, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [451, 456], + loc: { + start: { column: 24, line: 13 }, + end: { column: 29, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [457, 458], + loc: { + start: { column: 30, line: 13 }, + end: { column: 31, line: 13 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [459, 466], + loc: { + start: { column: 32, line: 13 }, + end: { column: 39, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [467, 473], + loc: { + start: { column: 40, line: 13 }, + end: { column: 46, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [473, 474], + loc: { + start: { column: 46, line: 13 }, + end: { column: 47, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [475, 480], + loc: { + start: { column: 48, line: 13 }, + end: { column: 53, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [481, 482], + loc: { + start: { column: 54, line: 13 }, + end: { column: 55, line: 13 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [483, 490], + loc: { + start: { column: 56, line: 13 }, + end: { column: 63, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [491, 497], + loc: { + start: { column: 64, line: 13 }, + end: { column: 70, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [497, 498], + loc: { + start: { column: 70, line: 13 }, + end: { column: 71, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [501, 502], + loc: { + start: { column: 2, line: 14 }, + end: { column: 3, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [503, 504], + loc: { + start: { column: 4, line: 14 }, + end: { column: 5, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [507, 508], + loc: { + start: { column: 2, line: 15 }, + end: { column: 3, line: 15 }, + }, + }, + Identifier { + type: "Identifier", + value: "never", + + range: [509, 514], + loc: { + start: { column: 4, line: 15 }, + end: { column: 9, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [514, 515], + loc: { + start: { column: 9, line: 15 }, + end: { column: 10, line: 15 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..f2bddd4af9c7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/3-Babel-AST.shot @@ -0,0 +1,905 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "X3", + + range: [78, 80], + loc: { + start: { column: 5, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + typeAnnotation: TSConditionalType { + type: "TSConditionalType", + checkType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + extendsType: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [113, 119], + loc: { + start: { column: 40, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + name: "U", + + range: [103, 119], + loc: { + start: { column: 30, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [97, 119], + loc: { + start: { column: 24, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + ], + + range: [96, 120], + loc: { + start: { column: 23, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + falseType: TSNeverKeyword { + type: "TSNeverKeyword", + + range: [141, 146], + loc: { + start: { column: 68, line: 3 }, + end: { column: 73, line: 3 }, + }, + }, + trueType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "MustBeNumber", + + range: [123, 135], + loc: { + start: { column: 50, line: 3 }, + end: { column: 62, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [136, 137], + loc: { + start: { column: 63, line: 3 }, + end: { column: 64, line: 3 }, + }, + }, + + range: [136, 137], + loc: { + start: { column: 63, line: 3 }, + end: { column: 64, line: 3 }, + }, + }, + ], + + range: [135, 138], + loc: { + start: { column: 62, line: 3 }, + end: { column: 65, line: 3 }, + }, + }, + + range: [123, 138], + loc: { + start: { column: 50, line: 3 }, + end: { column: 65, line: 3 }, + }, + }, + + range: [86, 146], + loc: { + start: { column: 13, line: 3 }, + end: { column: 73, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + ], + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + + range: [73, 147], + loc: { + start: { column: 0, line: 3 }, + end: { column: 74, line: 3 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "X4", + + range: [153, 155], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + typeAnnotation: TSConditionalType { + type: "TSConditionalType", + checkType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [161, 162], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + + range: [161, 162], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + extendsType: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [188, 194], + loc: { + start: { column: 40, line: 4 }, + end: { column: 46, line: 4 }, + }, + }, + name: "U", + + range: [178, 194], + loc: { + start: { column: 30, line: 4 }, + end: { column: 46, line: 4 }, + }, + }, + + range: [172, 194], + loc: { + start: { column: 24, line: 4 }, + end: { column: 46, line: 4 }, + }, + }, + TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [212, 218], + loc: { + start: { column: 64, line: 4 }, + end: { column: 70, line: 4 }, + }, + }, + name: "U", + + range: [202, 218], + loc: { + start: { column: 54, line: 4 }, + end: { column: 70, line: 4 }, + }, + }, + + range: [196, 218], + loc: { + start: { column: 48, line: 4 }, + end: { column: 70, line: 4 }, + }, + }, + ], + + range: [171, 219], + loc: { + start: { column: 23, line: 4 }, + end: { column: 71, line: 4 }, + }, + }, + falseType: TSNeverKeyword { + type: "TSNeverKeyword", + + range: [244, 249], + loc: { + start: { column: 4, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + trueType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "MustBeNumber", + + range: [224, 236], + loc: { + start: { column: 4, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [237, 238], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + + range: [237, 238], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + ], + + range: [236, 239], + loc: { + start: { column: 16, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + + range: [224, 239], + loc: { + start: { column: 4, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + + range: [161, 249], + loc: { + start: { column: 13, line: 4 }, + end: { column: 9, line: 6 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [156, 157], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + ], + + range: [155, 158], + loc: { + start: { column: 7, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [148, 250], + loc: { + start: { column: 0, line: 4 }, + end: { column: 10, line: 6 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "X5", + + range: [256, 258], + loc: { + start: { column: 5, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + typeAnnotation: TSConditionalType { + type: "TSConditionalType", + checkType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [264, 265], + loc: { + start: { column: 13, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + + range: [264, 265], + loc: { + start: { column: 13, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + extendsType: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [291, 297], + loc: { + start: { column: 40, line: 7 }, + end: { column: 46, line: 7 }, + }, + }, + name: "U", + + range: [281, 297], + loc: { + start: { column: 30, line: 7 }, + end: { column: 46, line: 7 }, + }, + }, + + range: [275, 297], + loc: { + start: { column: 24, line: 7 }, + end: { column: 46, line: 7 }, + }, + }, + TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + name: "U", + + range: [305, 306], + loc: { + start: { column: 54, line: 7 }, + end: { column: 55, line: 7 }, + }, + }, + + range: [299, 306], + loc: { + start: { column: 48, line: 7 }, + end: { column: 55, line: 7 }, + }, + }, + ], + + range: [274, 307], + loc: { + start: { column: 23, line: 7 }, + end: { column: 56, line: 7 }, + }, + }, + falseType: TSNeverKeyword { + type: "TSNeverKeyword", + + range: [332, 337], + loc: { + start: { column: 4, line: 9 }, + end: { column: 9, line: 9 }, + }, + }, + trueType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "MustBeNumber", + + range: [312, 324], + loc: { + start: { column: 4, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [325, 326], + loc: { + start: { column: 17, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + + range: [325, 326], + loc: { + start: { column: 17, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + ], + + range: [324, 327], + loc: { + start: { column: 16, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + + range: [312, 327], + loc: { + start: { column: 4, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + + range: [264, 337], + loc: { + start: { column: 13, line: 7 }, + end: { column: 9, line: 9 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [259, 260], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + ], + + range: [258, 261], + loc: { + start: { column: 7, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + + range: [251, 338], + loc: { + start: { column: 0, line: 7 }, + end: { column: 10, line: 9 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "X6", + + range: [344, 346], + loc: { + start: { column: 5, line: 10 }, + end: { column: 7, line: 10 }, + }, + }, + typeAnnotation: TSConditionalType { + type: "TSConditionalType", + checkType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [352, 353], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + + range: [352, 353], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + extendsType: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + name: "U", + + range: [369, 370], + loc: { + start: { column: 30, line: 10 }, + end: { column: 31, line: 10 }, + }, + }, + + range: [363, 370], + loc: { + start: { column: 24, line: 10 }, + end: { column: 31, line: 10 }, + }, + }, + TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [388, 394], + loc: { + start: { column: 49, line: 10 }, + end: { column: 55, line: 10 }, + }, + }, + name: "U", + + range: [378, 394], + loc: { + start: { column: 39, line: 10 }, + end: { column: 55, line: 10 }, + }, + }, + + range: [372, 394], + loc: { + start: { column: 33, line: 10 }, + end: { column: 55, line: 10 }, + }, + }, + ], + + range: [362, 395], + loc: { + start: { column: 23, line: 10 }, + end: { column: 56, line: 10 }, + }, + }, + falseType: TSNeverKeyword { + type: "TSNeverKeyword", + + range: [420, 425], + loc: { + start: { column: 4, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + trueType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "MustBeNumber", + + range: [400, 412], + loc: { + start: { column: 4, line: 11 }, + end: { column: 16, line: 11 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [413, 414], + loc: { + start: { column: 17, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + + range: [413, 414], + loc: { + start: { column: 17, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + ], + + range: [412, 415], + loc: { + start: { column: 16, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + + range: [400, 415], + loc: { + start: { column: 4, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + + range: [352, 425], + loc: { + start: { column: 13, line: 10 }, + end: { column: 9, line: 12 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [347, 348], + loc: { + start: { column: 8, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + ], + + range: [346, 349], + loc: { + start: { column: 7, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + + range: [339, 426], + loc: { + start: { column: 0, line: 10 }, + end: { column: 10, line: 12 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "X7", + + range: [432, 434], + loc: { + start: { column: 5, line: 13 }, + end: { column: 7, line: 13 }, + }, + }, + typeAnnotation: TSConditionalType { + type: "TSConditionalType", + checkType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [440, 441], + loc: { + start: { column: 13, line: 13 }, + end: { column: 14, line: 13 }, + }, + }, + + range: [440, 441], + loc: { + start: { column: 13, line: 13 }, + end: { column: 14, line: 13 }, + }, + }, + extendsType: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSStringKeyword { + type: "TSStringKeyword", + + range: [467, 473], + loc: { + start: { column: 40, line: 13 }, + end: { column: 46, line: 13 }, + }, + }, + name: "U", + + range: [457, 473], + loc: { + start: { column: 30, line: 13 }, + end: { column: 46, line: 13 }, + }, + }, + + range: [451, 473], + loc: { + start: { column: 24, line: 13 }, + end: { column: 46, line: 13 }, + }, + }, + TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [491, 497], + loc: { + start: { column: 64, line: 13 }, + end: { column: 70, line: 13 }, + }, + }, + name: "U", + + range: [481, 497], + loc: { + start: { column: 54, line: 13 }, + end: { column: 70, line: 13 }, + }, + }, + + range: [475, 497], + loc: { + start: { column: 48, line: 13 }, + end: { column: 70, line: 13 }, + }, + }, + ], + + range: [450, 498], + loc: { + start: { column: 23, line: 13 }, + end: { column: 71, line: 13 }, + }, + }, + falseType: TSNeverKeyword { + type: "TSNeverKeyword", + + range: [509, 514], + loc: { + start: { column: 4, line: 15 }, + end: { column: 9, line: 15 }, + }, + }, + trueType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [503, 504], + loc: { + start: { column: 4, line: 14 }, + end: { column: 5, line: 14 }, + }, + }, + + range: [503, 504], + loc: { + start: { column: 4, line: 14 }, + end: { column: 5, line: 14 }, + }, + }, + + range: [440, 514], + loc: { + start: { column: 13, line: 13 }, + end: { column: 9, line: 15 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [435, 436], + loc: { + start: { column: 8, line: 13 }, + end: { column: 9, line: 13 }, + }, + }, + ], + + range: [434, 437], + loc: { + start: { column: 7, line: 13 }, + end: { column: 10, line: 13 }, + }, + }, + + range: [427, 515], + loc: { + start: { column: 0, line: 13 }, + end: { column: 10, line: 15 }, + }, + }, + ], + sourceType: "script", + + range: [73, 516], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 16 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..1933e1029186 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,1236 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "X3", + + range: [78, 80], + loc: { + start: { column: 5, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [88, 95], + loc: { + start: { column: 15, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [97, 102], + loc: { + start: { column: 24, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [105, 112], + loc: { + start: { column: 32, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [113, 119], + loc: { + start: { column: 40, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [121, 122], + loc: { + start: { column: 48, line: 3 }, + end: { column: 49, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "MustBeNumber", + + range: [123, 135], + loc: { + start: { column: 50, line: 3 }, + end: { column: 62, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [135, 136], + loc: { + start: { column: 62, line: 3 }, + end: { column: 63, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [136, 137], + loc: { + start: { column: 63, line: 3 }, + end: { column: 64, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [137, 138], + loc: { + start: { column: 64, line: 3 }, + end: { column: 65, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [139, 140], + loc: { + start: { column: 66, line: 3 }, + end: { column: 67, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "never", + + range: [141, 146], + loc: { + start: { column: 68, line: 3 }, + end: { column: 73, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [146, 147], + loc: { + start: { column: 73, line: 3 }, + end: { column: 74, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [148, 152], + loc: { + start: { column: 0, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "X4", + + range: [153, 155], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [155, 156], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [156, 157], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [157, 158], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [159, 160], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [161, 162], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [163, 170], + loc: { + start: { column: 15, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [171, 172], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [172, 177], + loc: { + start: { column: 24, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [178, 179], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [180, 187], + loc: { + start: { column: 32, line: 4 }, + end: { column: 39, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [188, 194], + loc: { + start: { column: 40, line: 4 }, + end: { column: 46, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [194, 195], + loc: { + start: { column: 46, line: 4 }, + end: { column: 47, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [196, 201], + loc: { + start: { column: 48, line: 4 }, + end: { column: 53, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [202, 203], + loc: { + start: { column: 54, line: 4 }, + end: { column: 55, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [204, 211], + loc: { + start: { column: 56, line: 4 }, + end: { column: 63, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [212, 218], + loc: { + start: { column: 64, line: 4 }, + end: { column: 70, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [218, 219], + loc: { + start: { column: 70, line: 4 }, + end: { column: 71, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [222, 223], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "MustBeNumber", + + range: [224, 236], + loc: { + start: { column: 4, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [236, 237], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [237, 238], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [238, 239], + loc: { + start: { column: 18, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [242, 243], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "never", + + range: [244, 249], + loc: { + start: { column: 4, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [249, 250], + loc: { + start: { column: 9, line: 6 }, + end: { column: 10, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [251, 255], + loc: { + start: { column: 0, line: 7 }, + end: { column: 4, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "X5", + + range: [256, 258], + loc: { + start: { column: 5, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [258, 259], + loc: { + start: { column: 7, line: 7 }, + end: { column: 8, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [259, 260], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [260, 261], + loc: { + start: { column: 9, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [262, 263], + loc: { + start: { column: 11, line: 7 }, + end: { column: 12, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [264, 265], + loc: { + start: { column: 13, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [266, 273], + loc: { + start: { column: 15, line: 7 }, + end: { column: 22, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [274, 275], + loc: { + start: { column: 23, line: 7 }, + end: { column: 24, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [275, 280], + loc: { + start: { column: 24, line: 7 }, + end: { column: 29, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [281, 282], + loc: { + start: { column: 30, line: 7 }, + end: { column: 31, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [283, 290], + loc: { + start: { column: 32, line: 7 }, + end: { column: 39, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [291, 297], + loc: { + start: { column: 40, line: 7 }, + end: { column: 46, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [297, 298], + loc: { + start: { column: 46, line: 7 }, + end: { column: 47, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [299, 304], + loc: { + start: { column: 48, line: 7 }, + end: { column: 53, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [305, 306], + loc: { + start: { column: 54, line: 7 }, + end: { column: 55, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [306, 307], + loc: { + start: { column: 55, line: 7 }, + end: { column: 56, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [310, 311], + loc: { + start: { column: 2, line: 8 }, + end: { column: 3, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "MustBeNumber", + + range: [312, 324], + loc: { + start: { column: 4, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [324, 325], + loc: { + start: { column: 16, line: 8 }, + end: { column: 17, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [325, 326], + loc: { + start: { column: 17, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [326, 327], + loc: { + start: { column: 18, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [330, 331], + loc: { + start: { column: 2, line: 9 }, + end: { column: 3, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "never", + + range: [332, 337], + loc: { + start: { column: 4, line: 9 }, + end: { column: 9, line: 9 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [337, 338], + loc: { + start: { column: 9, line: 9 }, + end: { column: 10, line: 9 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [339, 343], + loc: { + start: { column: 0, line: 10 }, + end: { column: 4, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "X6", + + range: [344, 346], + loc: { + start: { column: 5, line: 10 }, + end: { column: 7, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [346, 347], + loc: { + start: { column: 7, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [347, 348], + loc: { + start: { column: 8, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [348, 349], + loc: { + start: { column: 9, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [350, 351], + loc: { + start: { column: 11, line: 10 }, + end: { column: 12, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [352, 353], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [354, 361], + loc: { + start: { column: 15, line: 10 }, + end: { column: 22, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [362, 363], + loc: { + start: { column: 23, line: 10 }, + end: { column: 24, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [363, 368], + loc: { + start: { column: 24, line: 10 }, + end: { column: 29, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [369, 370], + loc: { + start: { column: 30, line: 10 }, + end: { column: 31, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [370, 371], + loc: { + start: { column: 31, line: 10 }, + end: { column: 32, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [372, 377], + loc: { + start: { column: 33, line: 10 }, + end: { column: 38, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [378, 379], + loc: { + start: { column: 39, line: 10 }, + end: { column: 40, line: 10 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [380, 387], + loc: { + start: { column: 41, line: 10 }, + end: { column: 48, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [388, 394], + loc: { + start: { column: 49, line: 10 }, + end: { column: 55, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [394, 395], + loc: { + start: { column: 55, line: 10 }, + end: { column: 56, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [398, 399], + loc: { + start: { column: 2, line: 11 }, + end: { column: 3, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "MustBeNumber", + + range: [400, 412], + loc: { + start: { column: 4, line: 11 }, + end: { column: 16, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [412, 413], + loc: { + start: { column: 16, line: 11 }, + end: { column: 17, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [413, 414], + loc: { + start: { column: 17, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [414, 415], + loc: { + start: { column: 18, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [418, 419], + loc: { + start: { column: 2, line: 12 }, + end: { column: 3, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + value: "never", + + range: [420, 425], + loc: { + start: { column: 4, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [425, 426], + loc: { + start: { column: 9, line: 12 }, + end: { column: 10, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [427, 431], + loc: { + start: { column: 0, line: 13 }, + end: { column: 4, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "X7", + + range: [432, 434], + loc: { + start: { column: 5, line: 13 }, + end: { column: 7, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [434, 435], + loc: { + start: { column: 7, line: 13 }, + end: { column: 8, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [435, 436], + loc: { + start: { column: 8, line: 13 }, + end: { column: 9, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [436, 437], + loc: { + start: { column: 9, line: 13 }, + end: { column: 10, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [438, 439], + loc: { + start: { column: 11, line: 13 }, + end: { column: 12, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [440, 441], + loc: { + start: { column: 13, line: 13 }, + end: { column: 14, line: 13 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [442, 449], + loc: { + start: { column: 15, line: 13 }, + end: { column: 22, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [450, 451], + loc: { + start: { column: 23, line: 13 }, + end: { column: 24, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [451, 456], + loc: { + start: { column: 24, line: 13 }, + end: { column: 29, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [457, 458], + loc: { + start: { column: 30, line: 13 }, + end: { column: 31, line: 13 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [459, 466], + loc: { + start: { column: 32, line: 13 }, + end: { column: 39, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [467, 473], + loc: { + start: { column: 40, line: 13 }, + end: { column: 46, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [473, 474], + loc: { + start: { column: 46, line: 13 }, + end: { column: 47, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [475, 480], + loc: { + start: { column: 48, line: 13 }, + end: { column: 53, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [481, 482], + loc: { + start: { column: 54, line: 13 }, + end: { column: 55, line: 13 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [483, 490], + loc: { + start: { column: 56, line: 13 }, + end: { column: 63, line: 13 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [491, 497], + loc: { + start: { column: 64, line: 13 }, + end: { column: 70, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [497, 498], + loc: { + start: { column: 70, line: 13 }, + end: { column: 71, line: 13 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [501, 502], + loc: { + start: { column: 2, line: 14 }, + end: { column: 3, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [503, 504], + loc: { + start: { column: 4, line: 14 }, + end: { column: 5, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [507, 508], + loc: { + start: { column: 2, line: 15 }, + end: { column: 3, line: 15 }, + }, + }, + Identifier { + type: "Identifier", + value: "never", + + range: [509, 514], + loc: { + start: { column: 4, line: 15 }, + end: { column: 9, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [514, 515], + loc: { + start: { column: 9, line: 15 }, + end: { column: 10, line: 15 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..5ae5b0f49662 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,1077 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'X3', + + range: [78, 80], + loc: { + start: { column: 5, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + typeAnnotation: TSConditionalType { + type: 'TSConditionalType', + checkType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + extendsType: TSTupleType { + type: 'TSTupleType', + elementTypes: Array [ + TSInferType { + type: 'TSInferType', + typeParameter: TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [113, 119], + loc: { + start: { column: 40, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'U', +- +- range: [103, 104], +- loc: { +- start: { column: 30, line: 3 }, +- end: { column: 31, line: 3 }, +- }, +- }, +- out: false, ++ name: 'U', + + range: [103, 119], + loc: { + start: { column: 30, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [97, 119], + loc: { + start: { column: 24, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + ], + + range: [96, 120], + loc: { + start: { column: 23, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + falseType: TSNeverKeyword { + type: 'TSNeverKeyword', + + range: [141, 146], + loc: { + start: { column: 68, line: 3 }, + end: { column: 73, line: 3 }, + }, + }, + trueType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'MustBeNumber', + + range: [123, 135], + loc: { + start: { column: 50, line: 3 }, + end: { column: 62, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'U', + + range: [136, 137], + loc: { + start: { column: 63, line: 3 }, + end: { column: 64, line: 3 }, + }, + }, + + range: [136, 137], + loc: { + start: { column: 63, line: 3 }, + end: { column: 64, line: 3 }, + }, + }, + ], + + range: [135, 138], + loc: { + start: { column: 62, line: 3 }, + end: { column: 65, line: 3 }, + }, + }, + + range: [123, 138], + loc: { + start: { column: 50, line: 3 }, + end: { column: 65, line: 3 }, + }, + }, + + range: [86, 146], + loc: { + start: { column: 13, line: 3 }, + end: { column: 73, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [81, 82], +- loc: { +- start: { column: 8, line: 3 }, +- end: { column: 9, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + ], + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + + range: [73, 147], + loc: { + start: { column: 0, line: 3 }, + end: { column: 74, line: 3 }, + }, + }, + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'X4', + + range: [153, 155], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + typeAnnotation: TSConditionalType { + type: 'TSConditionalType', + checkType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [161, 162], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + + range: [161, 162], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + extendsType: TSTupleType { + type: 'TSTupleType', + elementTypes: Array [ + TSInferType { + type: 'TSInferType', + typeParameter: TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [188, 194], + loc: { + start: { column: 40, line: 4 }, + end: { column: 46, line: 4 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'U', +- +- range: [178, 179], +- loc: { +- start: { column: 30, line: 4 }, +- end: { column: 31, line: 4 }, +- }, +- }, +- out: false, ++ name: 'U', + + range: [178, 194], + loc: { + start: { column: 30, line: 4 }, + end: { column: 46, line: 4 }, + }, + }, + + range: [172, 194], + loc: { + start: { column: 24, line: 4 }, + end: { column: 46, line: 4 }, + }, + }, + TSInferType { + type: 'TSInferType', + typeParameter: TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [212, 218], + loc: { + start: { column: 64, line: 4 }, + end: { column: 70, line: 4 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'U', +- +- range: [202, 203], +- loc: { +- start: { column: 54, line: 4 }, +- end: { column: 55, line: 4 }, +- }, +- }, +- out: false, ++ name: 'U', + + range: [202, 218], + loc: { + start: { column: 54, line: 4 }, + end: { column: 70, line: 4 }, + }, + }, + + range: [196, 218], + loc: { + start: { column: 48, line: 4 }, + end: { column: 70, line: 4 }, + }, + }, + ], + + range: [171, 219], + loc: { + start: { column: 23, line: 4 }, + end: { column: 71, line: 4 }, + }, + }, + falseType: TSNeverKeyword { + type: 'TSNeverKeyword', + + range: [244, 249], + loc: { + start: { column: 4, line: 6 }, + end: { column: 9, line: 6 }, + }, + }, + trueType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'MustBeNumber', + + range: [224, 236], + loc: { + start: { column: 4, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'U', + + range: [237, 238], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + + range: [237, 238], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + ], + + range: [236, 239], + loc: { + start: { column: 16, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + + range: [224, 239], + loc: { + start: { column: 4, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + + range: [161, 249], + loc: { + start: { column: 13, line: 4 }, + end: { column: 9, line: 6 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [156, 157], +- loc: { +- start: { column: 8, line: 4 }, +- end: { column: 9, line: 4 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [156, 157], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + ], + + range: [155, 158], + loc: { + start: { column: 7, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + + range: [148, 250], + loc: { + start: { column: 0, line: 4 }, + end: { column: 10, line: 6 }, + }, + }, + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'X5', + + range: [256, 258], + loc: { + start: { column: 5, line: 7 }, + end: { column: 7, line: 7 }, + }, + }, + typeAnnotation: TSConditionalType { + type: 'TSConditionalType', + checkType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [264, 265], + loc: { + start: { column: 13, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + + range: [264, 265], + loc: { + start: { column: 13, line: 7 }, + end: { column: 14, line: 7 }, + }, + }, + extendsType: TSTupleType { + type: 'TSTupleType', + elementTypes: Array [ + TSInferType { + type: 'TSInferType', + typeParameter: TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [291, 297], + loc: { + start: { column: 40, line: 7 }, + end: { column: 46, line: 7 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'U', +- +- range: [281, 282], +- loc: { +- start: { column: 30, line: 7 }, +- end: { column: 31, line: 7 }, +- }, +- }, +- out: false, ++ name: 'U', + + range: [281, 297], + loc: { + start: { column: 30, line: 7 }, + end: { column: 46, line: 7 }, + }, + }, + + range: [275, 297], + loc: { + start: { column: 24, line: 7 }, + end: { column: 46, line: 7 }, + }, + }, + TSInferType { + type: 'TSInferType', + typeParameter: TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'U', +- +- range: [305, 306], +- loc: { +- start: { column: 54, line: 7 }, +- end: { column: 55, line: 7 }, +- }, +- }, +- out: false, ++ name: 'U', + + range: [305, 306], + loc: { + start: { column: 54, line: 7 }, + end: { column: 55, line: 7 }, + }, + }, + + range: [299, 306], + loc: { + start: { column: 48, line: 7 }, + end: { column: 55, line: 7 }, + }, + }, + ], + + range: [274, 307], + loc: { + start: { column: 23, line: 7 }, + end: { column: 56, line: 7 }, + }, + }, + falseType: TSNeverKeyword { + type: 'TSNeverKeyword', + + range: [332, 337], + loc: { + start: { column: 4, line: 9 }, + end: { column: 9, line: 9 }, + }, + }, + trueType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'MustBeNumber', + + range: [312, 324], + loc: { + start: { column: 4, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'U', + + range: [325, 326], + loc: { + start: { column: 17, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + + range: [325, 326], + loc: { + start: { column: 17, line: 8 }, + end: { column: 18, line: 8 }, + }, + }, + ], + + range: [324, 327], + loc: { + start: { column: 16, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + + range: [312, 327], + loc: { + start: { column: 4, line: 8 }, + end: { column: 19, line: 8 }, + }, + }, + + range: [264, 337], + loc: { + start: { column: 13, line: 7 }, + end: { column: 9, line: 9 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [259, 260], +- loc: { +- start: { column: 8, line: 7 }, +- end: { column: 9, line: 7 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [259, 260], + loc: { + start: { column: 8, line: 7 }, + end: { column: 9, line: 7 }, + }, + }, + ], + + range: [258, 261], + loc: { + start: { column: 7, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + + range: [251, 338], + loc: { + start: { column: 0, line: 7 }, + end: { column: 10, line: 9 }, + }, + }, + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'X6', + + range: [344, 346], + loc: { + start: { column: 5, line: 10 }, + end: { column: 7, line: 10 }, + }, + }, + typeAnnotation: TSConditionalType { + type: 'TSConditionalType', + checkType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [352, 353], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + + range: [352, 353], + loc: { + start: { column: 13, line: 10 }, + end: { column: 14, line: 10 }, + }, + }, + extendsType: TSTupleType { + type: 'TSTupleType', + elementTypes: Array [ + TSInferType { + type: 'TSInferType', + typeParameter: TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'U', +- +- range: [369, 370], +- loc: { +- start: { column: 30, line: 10 }, +- end: { column: 31, line: 10 }, +- }, +- }, +- out: false, ++ name: 'U', + + range: [369, 370], + loc: { + start: { column: 30, line: 10 }, + end: { column: 31, line: 10 }, + }, + }, + + range: [363, 370], + loc: { + start: { column: 24, line: 10 }, + end: { column: 31, line: 10 }, + }, + }, + TSInferType { + type: 'TSInferType', + typeParameter: TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [388, 394], + loc: { + start: { column: 49, line: 10 }, + end: { column: 55, line: 10 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'U', +- +- range: [378, 379], +- loc: { +- start: { column: 39, line: 10 }, +- end: { column: 40, line: 10 }, +- }, +- }, +- out: false, ++ name: 'U', + + range: [378, 394], + loc: { + start: { column: 39, line: 10 }, + end: { column: 55, line: 10 }, + }, + }, + + range: [372, 394], + loc: { + start: { column: 33, line: 10 }, + end: { column: 55, line: 10 }, + }, + }, + ], + + range: [362, 395], + loc: { + start: { column: 23, line: 10 }, + end: { column: 56, line: 10 }, + }, + }, + falseType: TSNeverKeyword { + type: 'TSNeverKeyword', + + range: [420, 425], + loc: { + start: { column: 4, line: 12 }, + end: { column: 9, line: 12 }, + }, + }, + trueType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'MustBeNumber', + + range: [400, 412], + loc: { + start: { column: 4, line: 11 }, + end: { column: 16, line: 11 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'U', + + range: [413, 414], + loc: { + start: { column: 17, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + + range: [413, 414], + loc: { + start: { column: 17, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + ], + + range: [412, 415], + loc: { + start: { column: 16, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + + range: [400, 415], + loc: { + start: { column: 4, line: 11 }, + end: { column: 19, line: 11 }, + }, + }, + + range: [352, 425], + loc: { + start: { column: 13, line: 10 }, + end: { column: 9, line: 12 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [347, 348], +- loc: { +- start: { column: 8, line: 10 }, +- end: { column: 9, line: 10 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [347, 348], + loc: { + start: { column: 8, line: 10 }, + end: { column: 9, line: 10 }, + }, + }, + ], + + range: [346, 349], + loc: { + start: { column: 7, line: 10 }, + end: { column: 10, line: 10 }, + }, + }, + + range: [339, 426], + loc: { + start: { column: 0, line: 10 }, + end: { column: 10, line: 12 }, + }, + }, + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'X7', + + range: [432, 434], + loc: { + start: { column: 5, line: 13 }, + end: { column: 7, line: 13 }, + }, + }, + typeAnnotation: TSConditionalType { + type: 'TSConditionalType', + checkType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [440, 441], + loc: { + start: { column: 13, line: 13 }, + end: { column: 14, line: 13 }, + }, + }, + + range: [440, 441], + loc: { + start: { column: 13, line: 13 }, + end: { column: 14, line: 13 }, + }, + }, + extendsType: TSTupleType { + type: 'TSTupleType', + elementTypes: Array [ + TSInferType { + type: 'TSInferType', + typeParameter: TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSStringKeyword { + type: 'TSStringKeyword', + + range: [467, 473], + loc: { + start: { column: 40, line: 13 }, + end: { column: 46, line: 13 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'U', +- +- range: [457, 458], +- loc: { +- start: { column: 30, line: 13 }, +- end: { column: 31, line: 13 }, +- }, +- }, +- out: false, ++ name: 'U', + + range: [457, 473], + loc: { + start: { column: 30, line: 13 }, + end: { column: 46, line: 13 }, + }, + }, + + range: [451, 473], + loc: { + start: { column: 24, line: 13 }, + end: { column: 46, line: 13 }, + }, + }, + TSInferType { + type: 'TSInferType', + typeParameter: TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [491, 497], + loc: { + start: { column: 64, line: 13 }, + end: { column: 70, line: 13 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'U', ++ name: 'U', + +- range: [481, 482], +- loc: { +- start: { column: 54, line: 13 }, +- end: { column: 55, line: 13 }, +- }, +- }, +- out: false, +- + range: [481, 497], + loc: { + start: { column: 54, line: 13 }, + end: { column: 70, line: 13 }, + }, + }, + + range: [475, 497], + loc: { + start: { column: 48, line: 13 }, + end: { column: 70, line: 13 }, + }, + }, + ], + + range: [450, 498], + loc: { + start: { column: 23, line: 13 }, + end: { column: 71, line: 13 }, + }, + }, + falseType: TSNeverKeyword { + type: 'TSNeverKeyword', + + range: [509, 514], + loc: { + start: { column: 4, line: 15 }, + end: { column: 9, line: 15 }, + }, + }, + trueType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'U', + + range: [503, 504], + loc: { + start: { column: 4, line: 14 }, + end: { column: 5, line: 14 }, + }, + }, + + range: [503, 504], + loc: { + start: { column: 4, line: 14 }, + end: { column: 5, line: 14 }, + }, + }, + + range: [440, 514], + loc: { + start: { column: 13, line: 13 }, + end: { column: 9, line: 15 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [435, 436], +- loc: { +- start: { column: 8, line: 13 }, +- end: { column: 9, line: 13 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [435, 436], + loc: { + start: { column: 8, line: 13 }, + end: { column: 9, line: 13 }, + }, + }, + ], + + range: [434, 437], + loc: { + start: { column: 7, line: 13 }, + end: { column: 10, line: 13 }, + }, + }, + + range: [427, 515], + loc: { + start: { column: 0, line: 13 }, + end: { column: 10, line: 15 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 516], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 16 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..705c948d7f7c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/fixture.ts new file mode 100644 index 000000000000..69f7ae41eab9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Element = T extends (infer U)[] ? U : T; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..908466c31fdb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,172 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Element", + + range: [78, 85], + loc: { + start: { column: 5, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeAnnotation: TSConditionalType { + type: "TSConditionalType", + checkType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + extendsType: TSArrayType { + type: "TSArrayType", + elementType: TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "U", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + out: false, + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [102, 109], + loc: { + start: { column: 29, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [101, 112], + loc: { + start: { column: 28, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + falseType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + trueType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + + range: [91, 120], + loc: { + start: { column: 18, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + out: false, + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ], + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..8836fca5c95b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,196 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Element", + + range: [78, 85], + loc: { + start: { column: 5, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [93, 100], + loc: { + start: { column: 20, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [102, 107], + loc: { + start: { column: 29, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [113, 114], + loc: { + start: { column: 40, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [120, 121], + loc: { + start: { column: 47, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..52e7262ca188 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/3-Babel-AST.shot @@ -0,0 +1,159 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Element", + + range: [78, 85], + loc: { + start: { column: 5, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeAnnotation: TSConditionalType { + type: "TSConditionalType", + checkType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + extendsType: TSArrayType { + type: "TSArrayType", + elementType: TSParenthesizedType { + type: "TSParenthesizedType", + typeAnnotation: TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + name: "U", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [102, 109], + loc: { + start: { column: 29, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [101, 110], + loc: { + start: { column: 28, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + + range: [101, 112], + loc: { + start: { column: 28, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + falseType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + trueType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + + range: [91, 120], + loc: { + start: { column: 18, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ], + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..9ce8b2c732ad --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,196 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Element", + + range: [78, 85], + loc: { + start: { column: 5, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [93, 100], + loc: { + start: { column: 20, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "infer", + + range: [102, 107], + loc: { + start: { column: 29, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [113, 114], + loc: { + start: { column: 40, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [120, 121], + loc: { + start: { column: 47, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..285e659b66b6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,188 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'Element', + + range: [78, 85], + loc: { + start: { column: 5, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeAnnotation: TSConditionalType { + type: 'TSConditionalType', + checkType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + extendsType: TSArrayType { + type: 'TSArrayType', +- elementType: TSInferType { +- type: 'TSInferType', +- typeParameter: TSTypeParameter { +- type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', ++ elementType: TSParenthesizedType { ++ type: 'TSParenthesizedType', ++ typeAnnotation: TSInferType { ++ type: 'TSInferType', ++ typeParameter: TSTypeParameter { ++ type: 'TSTypeParameter', + name: 'U', + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, +- out: false, + +- range: [108, 109], ++ range: [102, 109], + loc: { +- start: { column: 35, line: 3 }, ++ start: { column: 29, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + +- range: [102, 109], ++ range: [101, 110], + loc: { +- start: { column: 29, line: 3 }, +- end: { column: 36, line: 3 }, ++ start: { column: 28, line: 3 }, ++ end: { column: 37, line: 3 }, + }, + }, + + range: [101, 112], + loc: { + start: { column: 28, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + falseType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + trueType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'U', + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + + range: [91, 120], + loc: { + start: { column: 18, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [86, 87], +- loc: { +- start: { column: 13, line: 3 }, +- end: { column: 14, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ], + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..a43f782cc8cc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-infer AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/fixture.ts new file mode 100644 index 000000000000..8c2c483d4278 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let x: number extends string ? boolean : null; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..e7d19856275e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,102 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-with-null TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSConditionalType { + type: "TSConditionalType", + checkType: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + extendsType: TSStringKeyword { + type: "TSStringKeyword", + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + falseType: TSNullKeyword { + type: "TSNullKeyword", + + range: [114, 118], + loc: { + start: { column: 41, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + trueType: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [104, 111], + loc: { + start: { column: 31, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [80, 118], + loc: { + start: { column: 7, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + + range: [78, 118], + loc: { + start: { column: 5, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + + range: [77, 118], + loc: { + start: { column: 4, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + init: null, + + range: [77, 118], + loc: { + start: { column: 4, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 119], + loc: { + start: { column: 0, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 120], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..73f37eb82e4c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-with-null TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [87, 94], + loc: { + start: { column: 14, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [104, 111], + loc: { + start: { column: 31, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "null", + + range: [114, 118], + loc: { + start: { column: 41, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [118, 119], + loc: { + start: { column: 45, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..9593b5fb2c05 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/3-Babel-AST.shot @@ -0,0 +1,102 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-with-null Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSConditionalType { + type: "TSConditionalType", + checkType: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + extendsType: TSStringKeyword { + type: "TSStringKeyword", + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + falseType: TSNullKeyword { + type: "TSNullKeyword", + + range: [114, 118], + loc: { + start: { column: 41, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + trueType: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [104, 111], + loc: { + start: { column: 31, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [80, 118], + loc: { + start: { column: 7, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + + range: [78, 118], + loc: { + start: { column: 5, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + + range: [77, 118], + loc: { + start: { column: 4, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + init: null, + + range: [77, 118], + loc: { + start: { column: 4, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 119], + loc: { + start: { column: 0, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 120], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..9cb32bb42d47 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-with-null Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [87, 94], + loc: { + start: { column: 14, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [104, 111], + loc: { + start: { column: 31, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Null { + type: "Null", + value: "null", + + range: [114, 118], + loc: { + start: { column: 41, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [118, 119], + loc: { + start: { column: 45, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..be2ad0cc13c7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-with-null AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..6ae754cf57b4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,124 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional-with-null AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'extends', + + range: [87, 94], + loc: { + start: { column: 14, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'boolean', + + range: [104, 111], + loc: { + start: { column: 31, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Null { ++ type: 'Null', + value: 'null', + + range: [114, 118], + loc: { + start: { column: 41, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [118, 119], + loc: { + start: { column: 45, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/fixture.ts new file mode 100644 index 000000000000..74f9fb91cba4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let x: number extends string ? boolean : string; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..49da7018a3f3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,102 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSConditionalType { + type: "TSConditionalType", + checkType: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + extendsType: TSStringKeyword { + type: "TSStringKeyword", + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + falseType: TSStringKeyword { + type: "TSStringKeyword", + + range: [114, 120], + loc: { + start: { column: 41, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + trueType: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [104, 111], + loc: { + start: { column: 31, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [80, 120], + loc: { + start: { column: 7, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + + range: [78, 120], + loc: { + start: { column: 5, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + + range: [77, 120], + loc: { + start: { column: 4, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + init: null, + + range: [77, 120], + loc: { + start: { column: 4, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..8005029de90c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [87, 94], + loc: { + start: { column: 14, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [104, 111], + loc: { + start: { column: 31, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [114, 120], + loc: { + start: { column: 41, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [120, 121], + loc: { + start: { column: 47, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..14884b0de3c8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/3-Babel-AST.shot @@ -0,0 +1,102 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSConditionalType { + type: "TSConditionalType", + checkType: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + extendsType: TSStringKeyword { + type: "TSStringKeyword", + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + falseType: TSStringKeyword { + type: "TSStringKeyword", + + range: [114, 120], + loc: { + start: { column: 41, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + trueType: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [104, 111], + loc: { + start: { column: 31, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [80, 120], + loc: { + start: { column: 7, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + + range: [78, 120], + loc: { + start: { column: 5, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + + range: [77, 120], + loc: { + start: { column: 4, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + init: null, + + range: [77, 120], + loc: { + start: { column: 4, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..0faa2500484a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [87, 94], + loc: { + start: { column: 14, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [104, 111], + loc: { + start: { column: 31, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [114, 120], + loc: { + start: { column: 41, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [120, 121], + loc: { + start: { column: 47, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..f451cd316293 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..70e3e8c8170b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,122 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types conditional AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'extends', + + range: [87, 94], + loc: { + start: { column: 14, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'boolean', + + range: [104, 111], + loc: { + start: { column: 31, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [114, 120], + loc: { + start: { column: 41, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [120, 121], + loc: { + start: { column: 47, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/fixture.ts new file mode 100644 index 000000000000..c40a51b2f08f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +var x: abstract new () => void; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..1b948a21b47c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-abstract TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSConstructorType { + type: "TSConstructorType", + abstract: true, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [99, 103], + loc: { + start: { column: 26, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [96, 103], + loc: { + start: { column: 23, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [80, 103], + loc: { + start: { column: 7, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [78, 103], + loc: { + start: { column: 5, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [77, 103], + loc: { + start: { column: 4, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + init: null, + + range: [77, 103], + loc: { + start: { column: 4, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + kind: "var", + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..b71cb9dd1f8f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-abstract TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "var", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [80, 88], + loc: { + start: { column: 7, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [89, 92], + loc: { + start: { column: 16, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [96, 98], + loc: { + start: { column: 23, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [99, 103], + loc: { + start: { column: 26, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..4494b2231000 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/3-Babel-AST.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-abstract Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSConstructorType { + type: "TSConstructorType", + abstract: true, + parameters: Array [], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [99, 103], + loc: { + start: { column: 26, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [96, 103], + loc: { + start: { column: 23, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [80, 103], + loc: { + start: { column: 7, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [78, 103], + loc: { + start: { column: 5, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [77, 103], + loc: { + start: { column: 4, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + init: null, + + range: [77, 103], + loc: { + start: { column: 4, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + kind: "var", + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..fe543a963c56 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-abstract Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "var", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [80, 88], + loc: { + start: { column: 7, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [89, 92], + loc: { + start: { column: 16, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [96, 98], + loc: { + start: { column: 23, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [99, 103], + loc: { + start: { column: 26, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..18d7b8a9fb1c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,92 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-abstract AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'x', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSConstructorType { + type: 'TSConstructorType', + abstract: true, +- params: Array [], +- returnType: TSTypeAnnotation { ++ parameters: Array [], ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSVoidKeyword { + type: 'TSVoidKeyword', + + range: [99, 103], + loc: { + start: { column: 26, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [96, 103], + loc: { + start: { column: 23, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [80, 103], + loc: { + start: { column: 7, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [78, 103], + loc: { + start: { column: 5, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [77, 103], + loc: { + start: { column: 4, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + init: null, + + range: [77, 103], + loc: { + start: { column: 4, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + kind: 'var', + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..bef4d01b41cb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-abstract AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/fixture.ts new file mode 100644 index 000000000000..2810884d71d3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +var x: new () => void; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..97094ac255f7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-empty TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSConstructorType { + type: "TSConstructorType", + abstract: false, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [90, 94], + loc: { + start: { column: 17, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [87, 94], + loc: { + start: { column: 14, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [80, 94], + loc: { + start: { column: 7, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [78, 94], + loc: { + start: { column: 5, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [77, 94], + loc: { + start: { column: 4, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + init: null, + + range: [77, 94], + loc: { + start: { column: 4, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + kind: "var", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 96], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..3bca13e45f99 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-empty TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "var", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [87, 89], + loc: { + start: { column: 14, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [90, 94], + loc: { + start: { column: 17, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..d4a581866891 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/3-Babel-AST.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-empty Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSConstructorType { + type: "TSConstructorType", + abstract: false, + parameters: Array [], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [90, 94], + loc: { + start: { column: 17, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [87, 94], + loc: { + start: { column: 14, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [80, 94], + loc: { + start: { column: 7, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [78, 94], + loc: { + start: { column: 5, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [77, 94], + loc: { + start: { column: 4, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + init: null, + + range: [77, 94], + loc: { + start: { column: 4, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + kind: "var", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 96], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..560b0d6459ce --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-empty Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "var", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [87, 89], + loc: { + start: { column: 14, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [90, 94], + loc: { + start: { column: 17, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..06360892a57d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,92 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-empty AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'x', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSConstructorType { + type: 'TSConstructorType', + abstract: false, +- params: Array [], +- returnType: TSTypeAnnotation { ++ parameters: Array [], ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSVoidKeyword { + type: 'TSVoidKeyword', + + range: [90, 94], + loc: { + start: { column: 17, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [87, 94], + loc: { + start: { column: 14, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [80, 94], + loc: { + start: { column: 7, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [78, 94], + loc: { + start: { column: 5, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [77, 94], + loc: { + start: { column: 4, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + init: null, + + range: [77, 94], + loc: { + start: { column: 4, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + kind: 'var', + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 96], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..6e23ee1ca7e5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-empty AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/fixture.ts new file mode 100644 index 000000000000..48be2e143874 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let f: new (a: T) => T; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..37e9d21a8b9e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,167 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-generic TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "f", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSConstructorType { + type: "TSConstructorType", + abstract: false, + params: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [89, 92], + loc: { + start: { column: 16, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [88, 92], + loc: { + start: { column: 15, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [94, 98], + loc: { + start: { column: 21, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + out: false, + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + ], + + range: [84, 87], + loc: { + start: { column: 11, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [80, 98], + loc: { + start: { column: 7, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [78, 98], + loc: { + start: { column: 5, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [77, 98], + loc: { + start: { column: 4, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + init: null, + + range: [77, 98], + loc: { + start: { column: 4, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 99], + loc: { + start: { column: 0, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..785e9709024a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-generic TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [94, 96], + loc: { + start: { column: 21, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..8c13525e41f6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/3-Babel-AST.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-generic Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "f", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSConstructorType { + type: "TSConstructorType", + abstract: false, + parameters: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [89, 92], + loc: { + start: { column: 16, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [88, 92], + loc: { + start: { column: 15, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [94, 98], + loc: { + start: { column: 21, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + ], + + range: [84, 87], + loc: { + start: { column: 11, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [80, 98], + loc: { + start: { column: 7, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [78, 98], + loc: { + start: { column: 5, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [77, 98], + loc: { + start: { column: 4, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + init: null, + + range: [77, 98], + loc: { + start: { column: 4, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 99], + loc: { + start: { column: 0, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..cec725353581 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-generic Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [94, 96], + loc: { + start: { column: 21, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..fb218b26aa37 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,174 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-generic AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'f', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSConstructorType { + type: 'TSConstructorType', + abstract: false, +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'a', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [89, 92], + loc: { + start: { column: 16, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [88, 92], + loc: { + start: { column: 15, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [94, 98], + loc: { + start: { column: 21, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [85, 86], +- loc: { +- start: { column: 12, line: 3 }, +- end: { column: 13, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + ], + + range: [84, 87], + loc: { + start: { column: 11, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [80, 98], + loc: { + start: { column: 7, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [78, 98], + loc: { + start: { column: 5, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [77, 98], + loc: { + start: { column: 4, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + init: null, + + range: [77, 98], + loc: { + start: { column: 4, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + ], + kind: 'let', + + range: [73, 99], + loc: { + start: { column: 0, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..113cd920e663 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,162 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-generic AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'f', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'new', + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'a', + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=>', + + range: [94, 96], + loc: { + start: { column: 21, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/fixture.ts new file mode 100644 index 000000000000..c75f3cd3aa8b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let x: Array string>; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..9178ec23de8c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-in-generic TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Array", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSConstructorType { + type: "TSConstructorType", + abstract: false, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [93, 102], + loc: { + start: { column: 20, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [86, 102], + loc: { + start: { column: 13, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + + range: [85, 103], + loc: { + start: { column: 12, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [80, 103], + loc: { + start: { column: 7, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [78, 103], + loc: { + start: { column: 5, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [77, 103], + loc: { + start: { column: 4, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + init: null, + + range: [77, 103], + loc: { + start: { column: 4, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..3a59b96dc1a2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-in-generic TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Array", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [93, 95], + loc: { + start: { column: 20, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..d4ce469e976d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/3-Babel-AST.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-in-generic Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Array", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSConstructorType { + type: "TSConstructorType", + abstract: false, + parameters: Array [], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [93, 102], + loc: { + start: { column: 20, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [86, 102], + loc: { + start: { column: 13, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + + range: [85, 103], + loc: { + start: { column: 12, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [80, 103], + loc: { + start: { column: 7, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [78, 103], + loc: { + start: { column: 5, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [77, 103], + loc: { + start: { column: 4, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + init: null, + + range: [77, 103], + loc: { + start: { column: 4, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..02e2a1e44747 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-in-generic Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Array", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [93, 95], + loc: { + start: { column: 20, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..322828642b24 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,122 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-in-generic AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'x', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'Array', + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSConstructorType { + type: 'TSConstructorType', + abstract: false, +- params: Array [], +- returnType: TSTypeAnnotation { ++ parameters: Array [], ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [93, 102], + loc: { + start: { column: 20, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [86, 102], + loc: { + start: { column: 13, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + + range: [85, 103], + loc: { + start: { column: 12, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [80, 103], + loc: { + start: { column: 7, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [78, 103], + loc: { + start: { column: 5, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [77, 103], + loc: { + start: { column: 4, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + init: null, + + range: [77, 103], + loc: { + start: { column: 4, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + kind: 'let', + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..d714965015e6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,132 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-in-generic AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Array', + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'new', + + range: [86, 89], + loc: { + start: { column: 13, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=>', + + range: [93, 95], + loc: { + start: { column: 20, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/fixture.ts new file mode 100644 index 000000000000..4ff3ba07178d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let f: new (...a: number[]) => void; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..f64c601255bb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,133 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-with-rest TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "f", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSConstructorType { + type: "TSConstructorType", + abstract: false, + params: Array [ + RestElement { + type: "RestElement", + argument: Identifier { + type: "Identifier", + name: "a", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSArrayType { + type: "TSArrayType", + elementType: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [91, 97], + loc: { + start: { column: 18, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [91, 99], + loc: { + start: { column: 18, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [89, 99], + loc: { + start: { column: 16, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [85, 99], + loc: { + start: { column: 12, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [104, 108], + loc: { + start: { column: 31, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + + range: [101, 108], + loc: { + start: { column: 28, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + + range: [80, 108], + loc: { + start: { column: 7, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + + range: [78, 108], + loc: { + start: { column: 5, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + + range: [77, 108], + loc: { + start: { column: 4, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + init: null, + + range: [77, 108], + loc: { + start: { column: 4, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..95af4af85adb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-with-rest TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "...", + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [91, 97], + loc: { + start: { column: 18, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [101, 103], + loc: { + start: { column: 28, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [104, 108], + loc: { + start: { column: 31, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..38eca71ac7d8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/3-Babel-AST.shot @@ -0,0 +1,133 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-with-rest Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "f", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSConstructorType { + type: "TSConstructorType", + abstract: false, + parameters: Array [ + RestElement { + type: "RestElement", + argument: Identifier { + type: "Identifier", + name: "a", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSArrayType { + type: "TSArrayType", + elementType: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [91, 97], + loc: { + start: { column: 18, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [91, 99], + loc: { + start: { column: 18, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [89, 99], + loc: { + start: { column: 16, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [85, 99], + loc: { + start: { column: 12, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [104, 108], + loc: { + start: { column: 31, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + + range: [101, 108], + loc: { + start: { column: 28, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + + range: [80, 108], + loc: { + start: { column: 7, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + + range: [78, 108], + loc: { + start: { column: 5, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + + range: [77, 108], + loc: { + start: { column: 4, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + init: null, + + range: [77, 108], + loc: { + start: { column: 4, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..2947223e8a9b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-with-rest Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "...", + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [91, 97], + loc: { + start: { column: 18, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [101, 103], + loc: { + start: { column: 28, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [104, 108], + loc: { + start: { column: 31, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..7dd96ce1e6af --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,139 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-with-rest AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'f', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSConstructorType { + type: 'TSConstructorType', + abstract: false, +- params: Array [ ++ parameters: Array [ + RestElement { + type: 'RestElement', + argument: Identifier { + type: 'Identifier', + name: 'a', + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSArrayType { + type: 'TSArrayType', + elementType: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [91, 97], + loc: { + start: { column: 18, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [91, 99], + loc: { + start: { column: 18, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [89, 99], + loc: { + start: { column: 16, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [85, 99], + loc: { + start: { column: 12, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSVoidKeyword { + type: 'TSVoidKeyword', + + range: [104, 108], + loc: { + start: { column: 31, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + + range: [101, 108], + loc: { + start: { column: 28, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + + range: [80, 108], + loc: { + start: { column: 7, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + + range: [78, 108], + loc: { + start: { column: 5, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + + range: [77, 108], + loc: { + start: { column: 4, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + init: null, + + range: [77, 108], + loc: { + start: { column: 4, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + ], + kind: 'let', + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..f64ecd096e44 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,162 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor-with-rest AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'f', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'new', + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '...', + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'a', + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [91, 97], + loc: { + start: { column: 18, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=>', + + range: [101, 103], + loc: { + start: { column: 28, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'void', + + range: [104, 108], + loc: { + start: { column: 31, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/fixture.ts new file mode 100644 index 000000000000..b5cf5abac075 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let f: new (a: number, b?: number) => void; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..b4d3ef6fec77 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,144 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "f", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSConstructorType { + type: "TSConstructorType", + abstract: false, + params: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [88, 94], + loc: { + start: { column: 15, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [86, 94], + loc: { + start: { column: 13, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [85, 94], + loc: { + start: { column: 12, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + name: "b", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [98, 106], + loc: { + start: { column: 25, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [96, 106], + loc: { + start: { column: 23, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [111, 115], + loc: { + start: { column: 38, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + + range: [108, 115], + loc: { + start: { column: 35, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + + range: [80, 115], + loc: { + start: { column: 7, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + + range: [78, 115], + loc: { + start: { column: 5, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + + range: [77, 115], + loc: { + start: { column: 4, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + init: null, + + range: [77, 115], + loc: { + start: { column: 4, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 116], + loc: { + start: { column: 0, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 117], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..0901a5f1ee72 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [88, 94], + loc: { + start: { column: 15, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [108, 110], + loc: { + start: { column: 35, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [111, 115], + loc: { + start: { column: 38, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..0dfd10835134 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/3-Babel-AST.shot @@ -0,0 +1,144 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "f", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSConstructorType { + type: "TSConstructorType", + abstract: false, + parameters: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [88, 94], + loc: { + start: { column: 15, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [86, 94], + loc: { + start: { column: 13, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [85, 94], + loc: { + start: { column: 12, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + name: "b", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [98, 106], + loc: { + start: { column: 25, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [96, 106], + loc: { + start: { column: 23, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [111, 115], + loc: { + start: { column: 38, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + + range: [108, 115], + loc: { + start: { column: 35, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + + range: [80, 115], + loc: { + start: { column: 7, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + + range: [78, 115], + loc: { + start: { column: 5, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + + range: [77, 115], + loc: { + start: { column: 4, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + init: null, + + range: [77, 115], + loc: { + start: { column: 4, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 116], + loc: { + start: { column: 0, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 117], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..cb98a14c7264 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "new", + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [88, 94], + loc: { + start: { column: 15, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [108, 110], + loc: { + start: { column: 35, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [111, 115], + loc: { + start: { column: 38, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..c5fe0cca283a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,150 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'f', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSConstructorType { + type: 'TSConstructorType', + abstract: false, +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'a', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [88, 94], + loc: { + start: { column: 15, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [86, 94], + loc: { + start: { column: 13, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [85, 94], + loc: { + start: { column: 12, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + name: 'b', + optional: true, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [98, 106], + loc: { + start: { column: 25, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [96, 106], + loc: { + start: { column: 23, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSVoidKeyword { + type: 'TSVoidKeyword', + + range: [111, 115], + loc: { + start: { column: 38, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + + range: [108, 115], + loc: { + start: { column: 35, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + + range: [80, 115], + loc: { + start: { column: 7, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + + range: [78, 115], + loc: { + start: { column: 5, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + + range: [77, 115], + loc: { + start: { column: 4, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + init: null, + + range: [77, 115], + loc: { + start: { column: 4, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + ], + kind: 'let', + + range: [73, 116], + loc: { + start: { column: 0, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 117], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..4cac7673c8a7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,182 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types constructor AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'f', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'new', + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'a', + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [88, 94], + loc: { + start: { column: 15, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'b', + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=>', + + range: [108, 110], + loc: { + start: { column: 35, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'void', + + range: [111, 115], + loc: { + start: { column: 38, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/fixture.ts new file mode 100644 index 000000000000..afb9ca17a32d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let f: (a: T) => T; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..a2a6283fff86 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-generic TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "f", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + params: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [84, 88], + loc: { + start: { column: 11, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [90, 94], + loc: { + start: { column: 17, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + out: false, + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + ], + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + + range: [80, 94], + loc: { + start: { column: 7, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [78, 94], + loc: { + start: { column: 5, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [77, 94], + loc: { + start: { column: 4, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + init: null, + + range: [77, 94], + loc: { + start: { column: 4, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 96], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..886955b1b831 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-generic TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [90, 92], + loc: { + start: { column: 17, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..d96054c8727c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/3-Babel-AST.shot @@ -0,0 +1,155 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-generic Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "f", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + parameters: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [84, 88], + loc: { + start: { column: 11, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [90, 94], + loc: { + start: { column: 17, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + ], + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + + range: [80, 94], + loc: { + start: { column: 7, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [78, 94], + loc: { + start: { column: 5, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [77, 94], + loc: { + start: { column: 4, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + init: null, + + range: [77, 94], + loc: { + start: { column: 4, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 96], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..05ec45050054 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-generic Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [90, 92], + loc: { + start: { column: 17, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..a8213dcf5ab1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,173 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-generic AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'f', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSFunctionType { + type: 'TSFunctionType', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'a', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [85, 88], + loc: { + start: { column: 12, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [84, 88], + loc: { + start: { column: 11, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [90, 94], + loc: { + start: { column: 17, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [81, 82], +- loc: { +- start: { column: 8, line: 3 }, +- end: { column: 9, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + ], + + range: [80, 83], + loc: { + start: { column: 7, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + + range: [80, 94], + loc: { + start: { column: 7, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [78, 94], + loc: { + start: { column: 5, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [77, 94], + loc: { + start: { column: 4, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + init: null, + + range: [77, 94], + loc: { + start: { column: 4, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + kind: 'let', + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 96], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..e693f40823de --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,152 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-generic AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'f', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'a', + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=>', + + range: [90, 92], + loc: { + start: { column: 17, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/fixture.ts new file mode 100644 index 000000000000..8e2e2d2c0d64 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let x: Array<() => void>; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..ff04b86962ae --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,115 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-in-generic TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Array", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSFunctionType { + type: "TSFunctionType", + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [92, 96], + loc: { + start: { column: 19, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [89, 96], + loc: { + start: { column: 16, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [86, 96], + loc: { + start: { column: 13, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + + range: [85, 97], + loc: { + start: { column: 12, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [80, 97], + loc: { + start: { column: 7, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [78, 97], + loc: { + start: { column: 5, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [77, 97], + loc: { + start: { column: 4, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + init: null, + + range: [77, 97], + loc: { + start: { column: 4, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 99], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..8964bca233cf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-in-generic TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Array", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [89, 91], + loc: { + start: { column: 16, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [92, 96], + loc: { + start: { column: 19, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..acc21c81409f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/3-Babel-AST.shot @@ -0,0 +1,115 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-in-generic Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Array", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSFunctionType { + type: "TSFunctionType", + parameters: Array [], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [92, 96], + loc: { + start: { column: 19, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [89, 96], + loc: { + start: { column: 16, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [86, 96], + loc: { + start: { column: 13, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + + range: [85, 97], + loc: { + start: { column: 12, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [80, 97], + loc: { + start: { column: 7, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [78, 97], + loc: { + start: { column: 5, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [77, 97], + loc: { + start: { column: 4, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + init: null, + + range: [77, 97], + loc: { + start: { column: 4, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 99], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..f0e2d6e8ec8c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-in-generic Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Array", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [89, 91], + loc: { + start: { column: 16, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [92, 96], + loc: { + start: { column: 19, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..98ba2c71171c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,121 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-in-generic AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'x', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'Array', + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSFunctionType { + type: 'TSFunctionType', +- params: Array [], +- returnType: TSTypeAnnotation { ++ parameters: Array [], ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSVoidKeyword { + type: 'TSVoidKeyword', + + range: [92, 96], + loc: { + start: { column: 19, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [89, 96], + loc: { + start: { column: 16, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [86, 96], + loc: { + start: { column: 13, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + + range: [85, 97], + loc: { + start: { column: 12, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [80, 97], + loc: { + start: { column: 7, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [78, 97], + loc: { + start: { column: 5, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [77, 97], + loc: { + start: { column: 4, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + init: null, + + range: [77, 97], + loc: { + start: { column: 4, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + kind: 'let', + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 99], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..a968daee0f5e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,122 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-in-generic AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Array', + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=>', + + range: [89, 91], + loc: { + start: { column: 16, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'void', + + range: [92, 96], + loc: { + start: { column: 19, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/fixture.ts new file mode 100644 index 000000000000..e2f3564e8bf8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type foo = ([a]: any) => any; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..072e8d0b4a7c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,103 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-array-destruction TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + params: Array [ + ArrayPattern { + type: "ArrayPattern", + elements: Array [ + Identifier { + type: "Identifier", + name: "a", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [88, 93], + loc: { + start: { column: 15, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [84, 101], + loc: { + start: { column: 11, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..89a057e6c0e3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-array-destruction TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [95, 97], + loc: { + start: { column: 22, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..abaccbf7bc3d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/3-Babel-AST.shot @@ -0,0 +1,103 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-array-destruction Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + parameters: Array [ + ArrayPattern { + type: "ArrayPattern", + elements: Array [ + Identifier { + type: "Identifier", + name: "a", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [88, 93], + loc: { + start: { column: 15, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [84, 101], + loc: { + start: { column: 11, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..3ed1b433c157 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-array-destruction Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [95, 97], + loc: { + start: { column: 22, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..a786bec4d073 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,109 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-array-destruction AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'foo', + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSFunctionType { + type: 'TSFunctionType', +- params: Array [ ++ parameters: Array [ + ArrayPattern { + type: 'ArrayPattern', + elements: Array [ + Identifier { + type: 'Identifier', + name: 'a', + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSAnyKeyword { + type: 'TSAnyKeyword', + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [88, 93], + loc: { + start: { column: 15, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSAnyKeyword { + type: 'TSAnyKeyword', + + range: [98, 101], + loc: { + start: { column: 25, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [84, 101], + loc: { + start: { column: 11, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..5bc987029652 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-array-destruction AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/fixture.ts new file mode 100644 index 000000000000..411b4dcb56e3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type foo = ({ a }: any) => any; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..be8e8b7979ff --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-object-destruction TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + params: Array [ + ObjectPattern { + type: "ObjectPattern", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "a", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + kind: "init", + method: false, + shorthand: true, + value: Identifier { + type: "Identifier", + name: "a", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [90, 95], + loc: { + start: { column: 17, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [85, 95], + loc: { + start: { column: 12, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [100, 103], + loc: { + start: { column: 27, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [97, 103], + loc: { + start: { column: 24, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [84, 103], + loc: { + start: { column: 11, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..db870fae35d2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-object-destruction TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [97, 99], + loc: { + start: { column: 24, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [100, 103], + loc: { + start: { column: 27, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..d963a4348ba7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/3-Babel-AST.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-object-destruction Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + parameters: Array [ + ObjectPattern { + type: "ObjectPattern", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "a", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + kind: "init", + method: false, + shorthand: true, + value: Identifier { + type: "Identifier", + name: "a", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [90, 95], + loc: { + start: { column: 17, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [85, 95], + loc: { + start: { column: 12, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [100, 103], + loc: { + start: { column: 27, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [97, 103], + loc: { + start: { column: 24, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [84, 103], + loc: { + start: { column: 11, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..f6b5757296f4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-object-destruction Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [97, 99], + loc: { + start: { column: 24, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [100, 103], + loc: { + start: { column: 27, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..2f06b281d400 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,132 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-object-destruction AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'foo', + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSFunctionType { + type: 'TSFunctionType', +- params: Array [ ++ parameters: Array [ + ObjectPattern { + type: 'ObjectPattern', + properties: Array [ + Property { + type: 'Property', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'a', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + kind: 'init', + method: false, + shorthand: true, + value: Identifier { + type: 'Identifier', + name: 'a', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSAnyKeyword { + type: 'TSAnyKeyword', + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [90, 95], + loc: { + start: { column: 17, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [85, 95], + loc: { + start: { column: 12, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSAnyKeyword { + type: 'TSAnyKeyword', + + range: [100, 103], + loc: { + start: { column: 27, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [97, 103], + loc: { + start: { column: 24, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [84, 103], + loc: { + start: { column: 11, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..712c3b089ffc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-object-destruction AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/fixture.ts new file mode 100644 index 000000000000..29cf10419867 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let f: (...a: number[]) => void; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..02d79101ce85 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,132 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-rest TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "f", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + params: Array [ + RestElement { + type: "RestElement", + argument: Identifier { + type: "Identifier", + name: "a", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSArrayType { + type: "TSArrayType", + elementType: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [87, 93], + loc: { + start: { column: 14, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [87, 95], + loc: { + start: { column: 14, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [85, 95], + loc: { + start: { column: 12, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [81, 95], + loc: { + start: { column: 8, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [100, 104], + loc: { + start: { column: 27, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [97, 104], + loc: { + start: { column: 24, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [80, 104], + loc: { + start: { column: 7, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [78, 104], + loc: { + start: { column: 5, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [77, 104], + loc: { + start: { column: 4, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + init: null, + + range: [77, 104], + loc: { + start: { column: 4, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..7e5dd9b0d702 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-rest TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "...", + + range: [81, 84], + loc: { + start: { column: 8, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [87, 93], + loc: { + start: { column: 14, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [97, 99], + loc: { + start: { column: 24, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [100, 104], + loc: { + start: { column: 27, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..302c9a5af5e9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/3-Babel-AST.shot @@ -0,0 +1,132 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-rest Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "f", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + parameters: Array [ + RestElement { + type: "RestElement", + argument: Identifier { + type: "Identifier", + name: "a", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSArrayType { + type: "TSArrayType", + elementType: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [87, 93], + loc: { + start: { column: 14, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [87, 95], + loc: { + start: { column: 14, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [85, 95], + loc: { + start: { column: 12, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [81, 95], + loc: { + start: { column: 8, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [100, 104], + loc: { + start: { column: 27, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [97, 104], + loc: { + start: { column: 24, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [80, 104], + loc: { + start: { column: 7, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [78, 104], + loc: { + start: { column: 5, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [77, 104], + loc: { + start: { column: 4, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + init: null, + + range: [77, 104], + loc: { + start: { column: 4, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..f875b9200481 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-rest Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "...", + + range: [81, 84], + loc: { + start: { column: 8, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [87, 93], + loc: { + start: { column: 14, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [97, 99], + loc: { + start: { column: 24, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [100, 104], + loc: { + start: { column: 27, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..7a302d9a4188 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,138 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-rest AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'f', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSFunctionType { + type: 'TSFunctionType', +- params: Array [ ++ parameters: Array [ + RestElement { + type: 'RestElement', + argument: Identifier { + type: 'Identifier', + name: 'a', + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSArrayType { + type: 'TSArrayType', + elementType: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [87, 93], + loc: { + start: { column: 14, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [87, 95], + loc: { + start: { column: 14, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [85, 95], + loc: { + start: { column: 12, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [81, 95], + loc: { + start: { column: 8, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSVoidKeyword { + type: 'TSVoidKeyword', + + range: [100, 104], + loc: { + start: { column: 27, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [97, 104], + loc: { + start: { column: 24, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [80, 104], + loc: { + start: { column: 7, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [78, 104], + loc: { + start: { column: 5, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [77, 104], + loc: { + start: { column: 4, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + init: null, + + range: [77, 104], + loc: { + start: { column: 4, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + kind: 'let', + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..2d1af890f175 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,152 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-rest AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'f', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '...', + + range: [81, 84], + loc: { + start: { column: 8, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'a', + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [87, 93], + loc: { + start: { column: 14, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=>', + + range: [97, 99], + loc: { + start: { column: 24, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'void', + + range: [100, 104], + loc: { + start: { column: 27, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/fixture.ts new file mode 100644 index 000000000000..23fd8b26aeef --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let f: (this: number) => void; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..01c4c33b0b9c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,114 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-this TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "f", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + params: Array [ + Identifier { + type: "Identifier", + name: "this", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [87, 93], + loc: { + start: { column: 14, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [81, 93], + loc: { + start: { column: 8, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [98, 102], + loc: { + start: { column: 25, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [95, 102], + loc: { + start: { column: 22, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [80, 102], + loc: { + start: { column: 7, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [78, 102], + loc: { + start: { column: 5, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [77, 102], + loc: { + start: { column: 4, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + init: null, + + range: [77, 102], + loc: { + start: { column: 4, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..484748d787d7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-this TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [81, 85], + loc: { + start: { column: 8, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [87, 93], + loc: { + start: { column: 14, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [95, 97], + loc: { + start: { column: 22, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [98, 102], + loc: { + start: { column: 25, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..149856a56597 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/3-Babel-AST.shot @@ -0,0 +1,114 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-this Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "f", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + parameters: Array [ + Identifier { + type: "Identifier", + name: "this", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [87, 93], + loc: { + start: { column: 14, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [81, 93], + loc: { + start: { column: 8, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [98, 102], + loc: { + start: { column: 25, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [95, 102], + loc: { + start: { column: 22, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [80, 102], + loc: { + start: { column: 7, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [78, 102], + loc: { + start: { column: 5, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [77, 102], + loc: { + start: { column: 4, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + init: null, + + range: [77, 102], + loc: { + start: { column: 4, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..f22a3e12fd19 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-this Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "this", + + range: [81, 85], + loc: { + start: { column: 8, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [87, 93], + loc: { + start: { column: 14, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [95, 97], + loc: { + start: { column: 22, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [98, 102], + loc: { + start: { column: 25, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..6687e26e8c88 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,120 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-this AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'f', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSFunctionType { + type: 'TSFunctionType', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'this', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [87, 93], + loc: { + start: { column: 14, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [81, 93], + loc: { + start: { column: 8, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSVoidKeyword { + type: 'TSVoidKeyword', + + range: [98, 102], + loc: { + start: { column: 25, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [95, 102], + loc: { + start: { column: 22, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [80, 102], + loc: { + start: { column: 7, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [78, 102], + loc: { + start: { column: 5, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [77, 102], + loc: { + start: { column: 4, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + init: null, + + range: [77, 102], + loc: { + start: { column: 4, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + kind: 'let', + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..128cb88e8ff4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,124 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function-with-this AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'f', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'this', + + range: [81, 85], + loc: { + start: { column: 8, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [87, 93], + loc: { + start: { column: 14, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=>', + + range: [95, 97], + loc: { + start: { column: 22, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'void', + + range: [98, 102], + loc: { + start: { column: 25, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/fixture.ts new file mode 100644 index 000000000000..cd2f5c1b1a0c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let f: (a: number, b?: number) => void; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..d9cfb96a334a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,143 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "f", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + params: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [82, 90], + loc: { + start: { column: 9, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [81, 90], + loc: { + start: { column: 8, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + name: "b", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [94, 102], + loc: { + start: { column: 21, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [92, 102], + loc: { + start: { column: 19, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [107, 111], + loc: { + start: { column: 34, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [104, 111], + loc: { + start: { column: 31, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [80, 111], + loc: { + start: { column: 7, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [78, 111], + loc: { + start: { column: 5, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [77, 111], + loc: { + start: { column: 4, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + init: null, + + range: [77, 111], + loc: { + start: { column: 4, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..c42ddc740a46 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [104, 106], + loc: { + start: { column: 31, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [107, 111], + loc: { + start: { column: 34, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..07eda5852fe1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/3-Babel-AST.shot @@ -0,0 +1,143 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "f", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + parameters: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [82, 90], + loc: { + start: { column: 9, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [81, 90], + loc: { + start: { column: 8, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + name: "b", + optional: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [94, 102], + loc: { + start: { column: 21, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [92, 102], + loc: { + start: { column: 19, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [107, 111], + loc: { + start: { column: 34, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [104, 111], + loc: { + start: { column: 31, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [80, 111], + loc: { + start: { column: 7, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [78, 111], + loc: { + start: { column: 5, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [77, 111], + loc: { + start: { column: 4, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + init: null, + + range: [77, 111], + loc: { + start: { column: 4, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..7acd90305c79 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "f", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [104, 106], + loc: { + start: { column: 31, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [107, 111], + loc: { + start: { column: 34, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..41bd32adba56 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,149 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'f', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSFunctionType { + type: 'TSFunctionType', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'a', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [82, 90], + loc: { + start: { column: 9, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [81, 90], + loc: { + start: { column: 8, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + name: 'b', + optional: true, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [94, 102], + loc: { + start: { column: 21, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + + range: [92, 102], + loc: { + start: { column: 19, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSVoidKeyword { + type: 'TSVoidKeyword', + + range: [107, 111], + loc: { + start: { column: 34, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [104, 111], + loc: { + start: { column: 31, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [80, 111], + loc: { + start: { column: 7, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [78, 111], + loc: { + start: { column: 5, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [77, 111], + loc: { + start: { column: 4, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + init: null, + + range: [77, 111], + loc: { + start: { column: 4, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + ], + kind: 'let', + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..a4d0b1ccfb1f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,172 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types function AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'f', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'a', + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'b', + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=>', + + range: [104, 106], + loc: { + start: { column: 31, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'void', + + range: [107, 111], + loc: { + start: { column: 34, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/fixture.ts new file mode 100644 index 000000000000..6a9ae79cc1c9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type foo = { + readonly [key: number]: number; +}; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..a3a48e3bbab5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,104 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types index-signature-readonly TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSIndexSignature { + type: "TSIndexSignature", + parameters: Array [ + Identifier { + type: "Identifier", + name: "key", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [103, 109], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [101, 109], + loc: { + start: { column: 15, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [98, 109], + loc: { + start: { column: 12, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + ], + readonly: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [112, 118], + loc: { + start: { column: 26, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + + range: [110, 118], + loc: { + start: { column: 24, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + + range: [88, 119], + loc: { + start: { column: 2, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + + range: [84, 121], + loc: { + start: { column: 11, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..b22a5a2ff61b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types index-signature-readonly TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [88, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [97, 98], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "key", + + range: [98, 101], + loc: { + start: { column: 12, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [101, 102], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [103, 109], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [109, 110], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [110, 111], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [112, 118], + loc: { + start: { column: 26, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [118, 119], + loc: { + start: { column: 32, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [120, 121], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [121, 122], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..cbd8ee009201 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/3-Babel-AST.shot @@ -0,0 +1,104 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types index-signature-readonly Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSIndexSignature { + type: "TSIndexSignature", + parameters: Array [ + Identifier { + type: "Identifier", + name: "key", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [103, 109], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [101, 109], + loc: { + start: { column: 15, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + + range: [98, 109], + loc: { + start: { column: 12, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + ], + readonly: true, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [112, 118], + loc: { + start: { column: 26, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + + range: [110, 118], + loc: { + start: { column: 24, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + + range: [88, 119], + loc: { + start: { column: 2, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + + range: [84, 121], + loc: { + start: { column: 11, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..433a62f2b6b6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types index-signature-readonly Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [88, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [97, 98], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "key", + + range: [98, 101], + loc: { + start: { column: 12, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [101, 102], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [103, 109], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [109, 110], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [110, 111], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [112, 118], + loc: { + start: { column: 26, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [118, 119], + loc: { + start: { column: 32, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [120, 121], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [121, 122], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..0500b9d57fb8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types index-signature-readonly AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..c696b00bc3b1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types index-signature-readonly AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/fixture.ts new file mode 100644 index 000000000000..92683f916762 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type foo = { + [a: string]; +}; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..1251a19e63b6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,85 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types index-signature-without-type TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSIndexSignature { + type: "TSIndexSignature", + parameters: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [92, 98], + loc: { + start: { column: 6, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + + range: [90, 98], + loc: { + start: { column: 4, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + + range: [89, 98], + loc: { + start: { column: 3, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + ], + + range: [88, 100], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + ], + + range: [84, 102], + loc: { + start: { column: 11, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..c33024097ec6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types index-signature-without-type TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [88, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [89, 90], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [90, 91], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [92, 98], + loc: { + start: { column: 6, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [98, 99], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [99, 100], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [101, 102], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [102, 103], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..1047a0934e48 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/3-Babel-AST.shot @@ -0,0 +1,85 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types index-signature-without-type Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSIndexSignature { + type: "TSIndexSignature", + parameters: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [92, 98], + loc: { + start: { column: 6, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + + range: [90, 98], + loc: { + start: { column: 4, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + + range: [89, 98], + loc: { + start: { column: 3, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + ], + + range: [88, 100], + loc: { + start: { column: 2, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + ], + + range: [84, 102], + loc: { + start: { column: 11, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..4a109485c1d9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types index-signature-without-type Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [88, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [89, 90], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [90, 91], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [92, 98], + loc: { + start: { column: 6, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [98, 99], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [99, 100], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [101, 102], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [102, 103], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..5f1910026682 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types index-signature-without-type AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..fb238b6a0326 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types index-signature-without-type AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/fixture.ts new file mode 100644 index 000000000000..1e0f4b1c57b3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type foo = { + [a: string]: string; +}; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..1ab68c70a72f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,103 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types index-signature TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSIndexSignature { + type: "TSIndexSignature", + parameters: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [92, 98], + loc: { + start: { column: 6, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + + range: [90, 98], + loc: { + start: { column: 4, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + + range: [89, 98], + loc: { + start: { column: 3, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [101, 107], + loc: { + start: { column: 15, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [99, 107], + loc: { + start: { column: 13, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [88, 108], + loc: { + start: { column: 2, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + ], + + range: [84, 110], + loc: { + start: { column: 11, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + + range: [73, 111], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..baa531baa8d4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types index-signature TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [88, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [89, 90], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [90, 91], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [92, 98], + loc: { + start: { column: 6, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [98, 99], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [99, 100], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [101, 107], + loc: { + start: { column: 15, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [107, 108], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [109, 110], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [110, 111], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..3c6adfa38394 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/3-Babel-AST.shot @@ -0,0 +1,103 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types index-signature Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSIndexSignature { + type: "TSIndexSignature", + parameters: Array [ + Identifier { + type: "Identifier", + name: "a", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [92, 98], + loc: { + start: { column: 6, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + + range: [90, 98], + loc: { + start: { column: 4, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + + range: [89, 98], + loc: { + start: { column: 3, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [101, 107], + loc: { + start: { column: 15, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [99, 107], + loc: { + start: { column: 13, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [88, 108], + loc: { + start: { column: 2, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + ], + + range: [84, 110], + loc: { + start: { column: 11, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + + range: [73, 111], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..8934428ebbe5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types index-signature Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [88, 89], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [89, 90], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [90, 91], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [92, 98], + loc: { + start: { column: 6, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [98, 99], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [99, 100], + loc: { + start: { column: 13, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [101, 107], + loc: { + start: { column: 15, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [107, 108], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [109, 110], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [110, 111], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..4382f42ebd50 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types index-signature AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..148bf0909d32 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types index-signature AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/fixture.ts new file mode 100644 index 000000000000..8e44e58857d3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let x: T[K]; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..5081b669353c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,104 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types indexed TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSIndexedAccessType { + type: "TSIndexedAccessType", + indexType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "K", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + objectType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [78, 84], + loc: { + start: { column: 5, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [77, 84], + loc: { + start: { column: 4, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + init: null, + + range: [77, 84], + loc: { + start: { column: 4, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 85], + loc: { + start: { column: 0, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 86], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..fa36492de873 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types indexed TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "K", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..824d7144dcb7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/3-Babel-AST.shot @@ -0,0 +1,104 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types indexed Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSIndexedAccessType { + type: "TSIndexedAccessType", + indexType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "K", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + objectType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [80, 84], + loc: { + start: { column: 7, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [78, 84], + loc: { + start: { column: 5, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + + range: [77, 84], + loc: { + start: { column: 4, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + init: null, + + range: [77, 84], + loc: { + start: { column: 4, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 85], + loc: { + start: { column: 0, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 86], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..3e08160596ea --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types indexed Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "K", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..cebd390f70d8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types indexed AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..ce1b10e758d7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,92 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types indexed AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'K', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/fixture.ts new file mode 100644 index 000000000000..abe411b3eba1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +interface Thing { + get size(): number; + set size(value: number | string | boolean); +} diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..91fce2f91415 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types interface-with-accessors TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "size", + + range: [97, 101], + loc: { + start: { column: 6, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + kind: "get", + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [105, 111], + loc: { + start: { column: 14, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [103, 111], + loc: { + start: { column: 12, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [93, 112], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "size", + + range: [119, 123], + loc: { + start: { column: 6, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + kind: "set", + params: Array [ + Identifier { + type: "Identifier", + name: "value", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [131, 137], + loc: { + start: { column: 18, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + TSStringKeyword { + type: "TSStringKeyword", + + range: [140, 146], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [149, 156], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + ], + + range: [131, 156], + loc: { + start: { column: 18, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + + range: [129, 156], + loc: { + start: { column: 16, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + + range: [124, 156], + loc: { + start: { column: 11, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + ], + + range: [115, 158], + loc: { + start: { column: 2, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + ], + + range: [89, 160], + loc: { + start: { column: 16, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Thing", + + range: [83, 88], + loc: { + start: { column: 10, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [73, 160], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 161], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..df66c0ef9648 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,236 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types interface-with-accessors TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Thing", + + range: [83, 88], + loc: { + start: { column: 10, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "get", + + range: [93, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "size", + + range: [97, 101], + loc: { + start: { column: 6, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [101, 102], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [102, 103], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [103, 104], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [105, 111], + loc: { + start: { column: 14, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [111, 112], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "set", + + range: [115, 118], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "size", + + range: [119, 123], + loc: { + start: { column: 6, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [123, 124], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "value", + + range: [124, 129], + loc: { + start: { column: 11, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [129, 130], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [131, 137], + loc: { + start: { column: 18, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [138, 139], + loc: { + start: { column: 25, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [140, 146], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [147, 148], + loc: { + start: { column: 34, line: 5 }, + end: { column: 35, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [149, 156], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [156, 157], + loc: { + start: { column: 43, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [157, 158], + loc: { + start: { column: 44, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [159, 160], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..dab68818dc44 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/3-Babel-AST.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types interface-with-accessors Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [ + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "size", + + range: [97, 101], + loc: { + start: { column: 6, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + kind: "get", + parameters: Array [], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [105, 111], + loc: { + start: { column: 14, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [103, 111], + loc: { + start: { column: 12, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [93, 112], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "size", + + range: [119, 123], + loc: { + start: { column: 6, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + kind: "set", + parameters: Array [ + Identifier { + type: "Identifier", + name: "value", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [131, 137], + loc: { + start: { column: 18, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + TSStringKeyword { + type: "TSStringKeyword", + + range: [140, 146], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [149, 156], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + ], + + range: [131, 156], + loc: { + start: { column: 18, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + + range: [129, 156], + loc: { + start: { column: 16, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + + range: [124, 156], + loc: { + start: { column: 11, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + ], + + range: [115, 158], + loc: { + start: { column: 2, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + ], + + range: [89, 160], + loc: { + start: { column: 16, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Thing", + + range: [83, 88], + loc: { + start: { column: 10, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [73, 160], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 161], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..e6702e33df83 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,236 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types interface-with-accessors Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "interface", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Thing", + + range: [83, 88], + loc: { + start: { column: 10, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "get", + + range: [93, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "size", + + range: [97, 101], + loc: { + start: { column: 6, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [101, 102], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [102, 103], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [103, 104], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [105, 111], + loc: { + start: { column: 14, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [111, 112], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "set", + + range: [115, 118], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "size", + + range: [119, 123], + loc: { + start: { column: 6, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [123, 124], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "value", + + range: [124, 129], + loc: { + start: { column: 11, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [129, 130], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [131, 137], + loc: { + start: { column: 18, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [138, 139], + loc: { + start: { column: 25, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [140, 146], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [147, 148], + loc: { + start: { column: 34, line: 5 }, + end: { column: 35, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [149, 156], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [156, 157], + loc: { + start: { column: 43, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [157, 158], + loc: { + start: { column: 44, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [159, 160], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..385e910cd900 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,173 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types interface-with-accessors AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [ + TSMethodSignature { + type: 'TSMethodSignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'size', + + range: [97, 101], + loc: { + start: { column: 6, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + kind: 'get', +- params: Array [], +- returnType: TSTypeAnnotation { ++ parameters: Array [], ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [105, 111], + loc: { + start: { column: 14, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [103, 111], + loc: { + start: { column: 12, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [93, 112], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + TSMethodSignature { + type: 'TSMethodSignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'size', + + range: [119, 123], + loc: { + start: { column: 6, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + kind: 'set', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'value', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSUnionType { + type: 'TSUnionType', + types: Array [ + TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [131, 137], + loc: { + start: { column: 18, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + TSStringKeyword { + type: 'TSStringKeyword', + + range: [140, 146], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + TSBooleanKeyword { + type: 'TSBooleanKeyword', + + range: [149, 156], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + ], + + range: [131, 156], + loc: { + start: { column: 18, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + + range: [129, 156], + loc: { + start: { column: 16, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + + range: [124, 156], + loc: { + start: { column: 11, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + ], + + range: [115, 158], + loc: { + start: { column: 2, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + ], + + range: [89, 160], + loc: { + start: { column: 16, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Thing', + + range: [83, 88], + loc: { + start: { column: 10, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + + range: [73, 160], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 161], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..598f260f1364 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,242 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types interface-with-accessors AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Thing', + + range: [83, 88], + loc: { + start: { column: 10, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'get', + + range: [93, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'size', + + range: [97, 101], + loc: { + start: { column: 6, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [101, 102], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [102, 103], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [103, 104], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [105, 111], + loc: { + start: { column: 14, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [111, 112], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'set', + + range: [115, 118], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'size', + + range: [119, 123], + loc: { + start: { column: 6, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [123, 124], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'value', + + range: [124, 129], + loc: { + start: { column: 11, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [129, 130], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [131, 137], + loc: { + start: { column: 18, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '|', + + range: [138, 139], + loc: { + start: { column: 25, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [140, 146], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '|', + + range: [147, 148], + loc: { + start: { column: 34, line: 5 }, + end: { column: 35, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'boolean', + + range: [149, 156], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [156, 157], + loc: { + start: { column: 43, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [157, 158], + loc: { + start: { column: 44, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [159, 160], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/fixture.ts new file mode 100644 index 000000000000..dccaf02d0b09 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type LinkedList = T & { next: LinkedList }; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..de7addfe3963 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,186 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types intersection-type TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "LinkedList", + + range: [78, 88], + loc: { + start: { column: 5, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + typeAnnotation: TSIntersectionType { + type: "TSIntersectionType", + types: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "next", + + range: [100, 104], + loc: { + start: { column: 27, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "LinkedList", + + range: [106, 116], + loc: { + start: { column: 33, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + ], + + range: [116, 119], + loc: { + start: { column: 43, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [106, 119], + loc: { + start: { column: 33, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [104, 119], + loc: { + start: { column: 31, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [100, 119], + loc: { + start: { column: 27, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + ], + + range: [98, 121], + loc: { + start: { column: 25, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + ], + + range: [94, 121], + loc: { + start: { column: 21, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + out: false, + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ], + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 49, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..8051da1b30fd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types intersection-type TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "LinkedList", + + range: [78, 88], + loc: { + start: { column: 5, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "next", + + range: [100, 104], + loc: { + start: { column: 27, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "LinkedList", + + range: [106, 116], + loc: { + start: { column: 33, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [118, 119], + loc: { + start: { column: 45, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [120, 121], + loc: { + start: { column: 47, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [121, 122], + loc: { + start: { column: 48, line: 3 }, + end: { column: 49, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..c08c632eb855 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/3-Babel-AST.shot @@ -0,0 +1,175 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types intersection-type Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "LinkedList", + + range: [78, 88], + loc: { + start: { column: 5, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + typeAnnotation: TSIntersectionType { + type: "TSIntersectionType", + types: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "next", + + range: [100, 104], + loc: { + start: { column: 27, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "LinkedList", + + range: [106, 116], + loc: { + start: { column: 33, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + ], + + range: [116, 119], + loc: { + start: { column: 43, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [106, 119], + loc: { + start: { column: 33, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [104, 119], + loc: { + start: { column: 31, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [100, 119], + loc: { + start: { column: 27, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + ], + + range: [98, 121], + loc: { + start: { column: 25, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + ], + + range: [94, 121], + loc: { + start: { column: 21, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ], + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 49, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..8bf4698c5a73 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types intersection-type Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "LinkedList", + + range: [78, 88], + loc: { + start: { column: 5, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "next", + + range: [100, 104], + loc: { + start: { column: 27, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "LinkedList", + + range: [106, 116], + loc: { + start: { column: 33, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [118, 119], + loc: { + start: { column: 45, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [120, 121], + loc: { + start: { column: 47, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [121, 122], + loc: { + start: { column: 48, line: 3 }, + end: { column: 49, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..4462a057b8ba --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,191 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types intersection-type AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'LinkedList', + + range: [78, 88], + loc: { + start: { column: 5, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + typeAnnotation: TSIntersectionType { + type: 'TSIntersectionType', + types: Array [ + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + TSTypeLiteral { + type: 'TSTypeLiteral', + members: Array [ + TSPropertySignature { + type: 'TSPropertySignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'next', + + range: [100, 104], + loc: { + start: { column: 27, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'LinkedList', + + range: [106, 116], + loc: { + start: { column: 33, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + ], + + range: [116, 119], + loc: { + start: { column: 43, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [106, 119], + loc: { + start: { column: 33, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [104, 119], + loc: { + start: { column: 31, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [100, 119], + loc: { + start: { column: 27, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + ], + + range: [98, 121], + loc: { + start: { column: 25, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + ], + + range: [94, 121], + loc: { + start: { column: 21, line: 3 }, + end: { column: 48, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [89, 90], +- loc: { +- start: { column: 16, line: 3 }, +- end: { column: 17, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ], + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 49, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..bbf2bc63689a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types intersection-type AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/fixture.ts new file mode 100644 index 000000000000..8877ddee0e82 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let x: -1; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..f1220c7e2ea9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,88 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types literal-number-negative TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSLiteralType { + type: "TSLiteralType", + literal: UnaryExpression { + type: "UnaryExpression", + argument: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + operator: "-", + prefix: true, + + range: [80, 82], + loc: { + start: { column: 7, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + + range: [80, 82], + loc: { + start: { column: 7, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + + range: [78, 82], + loc: { + start: { column: 5, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + + range: [77, 82], + loc: { + start: { column: 4, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + init: null, + + range: [77, 82], + loc: { + start: { column: 4, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 83], + loc: { + start: { column: 0, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 84], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..e7e91b113836 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types literal-number-negative TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "-", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..c44f84cc5a39 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/3-Babel-AST.shot @@ -0,0 +1,88 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types literal-number-negative Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSLiteralType { + type: "TSLiteralType", + literal: UnaryExpression { + type: "UnaryExpression", + argument: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + operator: "-", + prefix: true, + + range: [80, 82], + loc: { + start: { column: 7, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + + range: [80, 82], + loc: { + start: { column: 7, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + + range: [78, 82], + loc: { + start: { column: 5, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + + range: [77, 82], + loc: { + start: { column: 4, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + init: null, + + range: [77, 82], + loc: { + start: { column: 4, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 83], + loc: { + start: { column: 0, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 84], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..fa723cfe0854 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types literal-number-negative Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "-", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..3d4e5e78f7ef --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types literal-number-negative AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..c69059e538cd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,72 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types literal-number-negative AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '-', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Numeric { + type: 'Numeric', + value: '1', + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/fixture.ts new file mode 100644 index 000000000000..deaec804f8ee --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let x: 0; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..b4c18ac1eca7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,77 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types literal-number TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "0", + value: 0, + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [77, 81], + loc: { + start: { column: 4, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + init: null, + + range: [77, 81], + loc: { + start: { column: 4, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 83], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..f33cec5ae56b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types literal-number TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Numeric { + type: "Numeric", + value: "0", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..0b381b8e5698 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/3-Babel-AST.shot @@ -0,0 +1,77 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types literal-number Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "0", + value: 0, + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [77, 81], + loc: { + start: { column: 4, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + init: null, + + range: [77, 81], + loc: { + start: { column: 4, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 83], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..fcebea813464 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types literal-number Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Numeric { + type: "Numeric", + value: "0", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..8c89c0f442ec --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types literal-number AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..e16a9a6b0941 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,62 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types literal-number AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Numeric { + type: 'Numeric', + value: '0', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/fixture.ts new file mode 100644 index 000000000000..44da2088eb23 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let x: 'foo'; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..0193d55beb66 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,77 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types literal-string TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "'foo'", + value: "foo", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [78, 85], + loc: { + start: { column: 5, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [77, 85], + loc: { + start: { column: 4, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + init: null, + + range: [77, 85], + loc: { + start: { column: 4, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 86], + loc: { + start: { column: 0, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 87], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..b3e8c534031c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types literal-string TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + String { + type: "String", + value: "'foo'", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..2d7c07f66699 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/3-Babel-AST.shot @@ -0,0 +1,77 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types literal-string Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "'foo'", + value: "foo", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [78, 85], + loc: { + start: { column: 5, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [77, 85], + loc: { + start: { column: 4, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + init: null, + + range: [77, 85], + loc: { + start: { column: 4, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 86], + loc: { + start: { column: 0, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 87], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..45fe14434956 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types literal-string Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + String { + type: "String", + value: "'foo'", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..e1c0de620172 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types literal-string AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..54970640aa70 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,62 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types literal-string AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + String { + type: 'String', + value: '\\\\'foo\\\\'', + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/fixture.ts new file mode 100644 index 000000000000..0fcc9beb7f26 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Test = { + [P in keyof T as 'a']: T[P]; +}; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..6537caf714f5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,193 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-named-type TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Test", + + range: [78, 82], + loc: { + start: { column: 5, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + typeAnnotation: TSMappedType { + type: "TSMappedType", + nameType: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "'a'", + value: "a", + + range: [109, 112], + loc: { + start: { column: 19, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [109, 112], + loc: { + start: { column: 19, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + typeAnnotation: TSIndexedAccessType { + type: "TSIndexedAccessType", + indexType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "P", + + range: [117, 118], + loc: { + start: { column: 27, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + + range: [117, 118], + loc: { + start: { column: 27, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + objectType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [115, 116], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + + range: [115, 116], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + + range: [115, 119], + loc: { + start: { column: 25, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSTypeOperator { + type: "TSTypeOperator", + operator: "keyof", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [104, 105], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [104, 105], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [98, 105], + loc: { + start: { column: 8, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "P", + + range: [93, 94], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + out: false, + + range: [93, 105], + loc: { + start: { column: 3, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [88, 122], + loc: { + start: { column: 15, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + out: false, + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + ], + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 124], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..944a0f5abc59 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,236 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-named-type TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Test", + + range: [78, 82], + loc: { + start: { column: 5, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [92, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "P", + + range: [93, 94], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [95, 97], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "keyof", + + range: [98, 103], + loc: { + start: { column: 8, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [104, 105], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [106, 108], + loc: { + start: { column: 16, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + String { + type: "String", + value: "'a'", + + range: [109, 112], + loc: { + start: { column: 19, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [112, 113], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [113, 114], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [115, 116], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [116, 117], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "P", + + range: [117, 118], + loc: { + start: { column: 27, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [118, 119], + loc: { + start: { column: 28, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [119, 120], + loc: { + start: { column: 29, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [121, 122], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [122, 123], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..379e37469319 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/3-Babel-AST.shot @@ -0,0 +1,171 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-named-type Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Test", + + range: [78, 82], + loc: { + start: { column: 5, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + typeAnnotation: TSMappedType { + type: "TSMappedType", + nameType: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "'a'", + value: "a", + + range: [109, 112], + loc: { + start: { column: 19, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [109, 112], + loc: { + start: { column: 19, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + typeAnnotation: TSIndexedAccessType { + type: "TSIndexedAccessType", + indexType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "P", + + range: [117, 118], + loc: { + start: { column: 27, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + + range: [117, 118], + loc: { + start: { column: 27, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + objectType: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [115, 116], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + + range: [115, 116], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + + range: [115, 119], + loc: { + start: { column: 25, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSTypeOperator { + type: "TSTypeOperator", + operator: "keyof", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [104, 105], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [104, 105], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [98, 105], + loc: { + start: { column: 8, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + name: "P", + + range: [93, 105], + loc: { + start: { column: 3, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [88, 122], + loc: { + start: { column: 15, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + ], + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 124], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..98cca579df3e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,236 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-named-type Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Test", + + range: [78, 82], + loc: { + start: { column: 5, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [92, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "P", + + range: [93, 94], + loc: { + start: { column: 3, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [95, 97], + loc: { + start: { column: 5, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "keyof", + + range: [98, 103], + loc: { + start: { column: 8, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [104, 105], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [106, 108], + loc: { + start: { column: 16, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + String { + type: "String", + value: "'a'", + + range: [109, 112], + loc: { + start: { column: 19, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [112, 113], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [113, 114], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [115, 116], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [116, 117], + loc: { + start: { column: 26, line: 4 }, + end: { column: 27, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "P", + + range: [117, 118], + loc: { + start: { column: 27, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [118, 119], + loc: { + start: { column: 28, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [119, 120], + loc: { + start: { column: 29, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [121, 122], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [122, 123], + loc: { + start: { column: 1, line: 5 }, + end: { column: 2, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..a57f192e4a2f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,199 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-named-type AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'Test', + + range: [78, 82], + loc: { + start: { column: 5, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + typeAnnotation: TSMappedType { + type: 'TSMappedType', + nameType: TSLiteralType { + type: 'TSLiteralType', + literal: Literal { + type: 'Literal', + raw: '\\\\'a\\\\'', + value: 'a', + + range: [109, 112], + loc: { + start: { column: 19, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + + range: [109, 112], + loc: { + start: { column: 19, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + typeAnnotation: TSIndexedAccessType { + type: 'TSIndexedAccessType', + indexType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'P', + + range: [117, 118], + loc: { + start: { column: 27, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + + range: [117, 118], + loc: { + start: { column: 27, line: 4 }, + end: { column: 28, line: 4 }, + }, + }, + objectType: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [115, 116], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + + range: [115, 116], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + + range: [115, 119], + loc: { + start: { column: 25, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + typeParameter: TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSTypeOperator { + type: 'TSTypeOperator', + operator: 'keyof', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [104, 105], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [104, 105], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [98, 105], + loc: { + start: { column: 8, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'P', +- +- range: [93, 94], +- loc: { +- start: { column: 3, line: 4 }, +- end: { column: 4, line: 4 }, +- }, +- }, +- out: false, ++ name: 'P', + + range: [93, 105], + loc: { + start: { column: 3, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [88, 122], + loc: { + start: { column: 15, line: 3 }, + end: { column: 1, line: 5 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [83, 84], +- loc: { +- start: { column: 10, line: 3 }, +- end: { column: 11, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [83, 84], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + ], + + range: [82, 85], + loc: { + start: { column: 9, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + + range: [73, 123], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 124], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..ef2126ed8a82 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-named-type AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/fixture.ts new file mode 100644 index 000000000000..bf0fd2aa7728 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let map: { -readonly [P in string]-?: number }; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..20121cf188ab --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,108 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-readonly-minus TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "map", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSMappedType { + type: "TSMappedType", + nameType: null, + optional: "-", + readonly: "-", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [111, 117], + loc: { + start: { column: 38, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSStringKeyword { + type: "TSStringKeyword", + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "P", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + out: false, + + range: [95, 106], + loc: { + start: { column: 22, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [82, 119], + loc: { + start: { column: 9, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [80, 119], + loc: { + start: { column: 7, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [77, 119], + loc: { + start: { column: 4, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + init: null, + + range: [77, 119], + loc: { + start: { column: 4, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 120], + loc: { + start: { column: 0, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..a03216bedc0b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-readonly-minus TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "map", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "-", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "P", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [97, 99], + loc: { + start: { column: 24, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "-", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [111, 117], + loc: { + start: { column: 38, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [118, 119], + loc: { + start: { column: 45, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..067b0bc3e171 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/3-Babel-AST.shot @@ -0,0 +1,97 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-readonly-minus Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "map", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSMappedType { + type: "TSMappedType", + nameType: null, + optional: "-", + readonly: "-", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [111, 117], + loc: { + start: { column: 38, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSStringKeyword { + type: "TSStringKeyword", + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + name: "P", + + range: [95, 106], + loc: { + start: { column: 22, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [82, 119], + loc: { + start: { column: 9, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [80, 119], + loc: { + start: { column: 7, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [77, 119], + loc: { + start: { column: 4, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + init: null, + + range: [77, 119], + loc: { + start: { column: 4, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 120], + loc: { + start: { column: 0, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..00560364c832 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-readonly-minus Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "map", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "-", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "P", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [97, 99], + loc: { + start: { column: 24, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "-", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [111, 117], + loc: { + start: { column: 38, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [118, 119], + loc: { + start: { column: 45, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..65aeb0689ca9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,113 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-readonly-minus AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'map', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSMappedType { + type: 'TSMappedType', + nameType: null, + optional: '-', + readonly: '-', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [111, 117], + loc: { + start: { column: 38, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + typeParameter: TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSStringKeyword { + type: 'TSStringKeyword', + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'P', +- +- range: [95, 96], +- loc: { +- start: { column: 22, line: 3 }, +- end: { column: 23, line: 3 }, +- }, +- }, +- out: false, ++ name: 'P', + + range: [95, 106], + loc: { + start: { column: 22, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [82, 119], + loc: { + start: { column: 9, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [80, 119], + loc: { + start: { column: 7, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [77, 119], + loc: { + start: { column: 4, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + init: null, + + range: [77, 119], + loc: { + start: { column: 4, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + ], + kind: 'let', + + range: [73, 120], + loc: { + start: { column: 0, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..5b03f5e7642d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,182 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-readonly-minus AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'map', + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '-', + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'readonly', + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'P', + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'in', + + range: [97, 99], + loc: { + start: { column: 24, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '-', + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [111, 117], + loc: { + start: { column: 38, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [118, 119], + loc: { + start: { column: 45, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/fixture.ts new file mode 100644 index 000000000000..e26a9cd97b5f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let map: { +readonly [P in string]+?: number }; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..ad99fda9528e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,108 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-readonly-plus TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "map", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSMappedType { + type: "TSMappedType", + nameType: null, + optional: "+", + readonly: "+", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [111, 117], + loc: { + start: { column: 38, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSStringKeyword { + type: "TSStringKeyword", + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "P", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + out: false, + + range: [95, 106], + loc: { + start: { column: 22, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [82, 119], + loc: { + start: { column: 9, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [80, 119], + loc: { + start: { column: 7, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [77, 119], + loc: { + start: { column: 4, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + init: null, + + range: [77, 119], + loc: { + start: { column: 4, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 120], + loc: { + start: { column: 0, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..b3855f351656 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-readonly-plus TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "map", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "+", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "P", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [97, 99], + loc: { + start: { column: 24, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "+", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [111, 117], + loc: { + start: { column: 38, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [118, 119], + loc: { + start: { column: 45, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..fbfb0205d19e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/3-Babel-AST.shot @@ -0,0 +1,97 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-readonly-plus Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "map", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSMappedType { + type: "TSMappedType", + nameType: null, + optional: "+", + readonly: "+", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [111, 117], + loc: { + start: { column: 38, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSStringKeyword { + type: "TSStringKeyword", + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + name: "P", + + range: [95, 106], + loc: { + start: { column: 22, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [82, 119], + loc: { + start: { column: 9, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [80, 119], + loc: { + start: { column: 7, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [77, 119], + loc: { + start: { column: 4, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + init: null, + + range: [77, 119], + loc: { + start: { column: 4, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 120], + loc: { + start: { column: 0, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..6d311e4d8296 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-readonly-plus Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "map", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "+", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "P", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [97, 99], + loc: { + start: { column: 24, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "+", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [111, 117], + loc: { + start: { column: 38, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [118, 119], + loc: { + start: { column: 45, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..3148bb5b7409 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,113 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-readonly-plus AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'map', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSMappedType { + type: 'TSMappedType', + nameType: null, + optional: '+', + readonly: '+', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [111, 117], + loc: { + start: { column: 38, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + typeParameter: TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSStringKeyword { + type: 'TSStringKeyword', + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'P', +- +- range: [95, 96], +- loc: { +- start: { column: 22, line: 3 }, +- end: { column: 23, line: 3 }, +- }, +- }, +- out: false, ++ name: 'P', + + range: [95, 106], + loc: { + start: { column: 22, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [82, 119], + loc: { + start: { column: 9, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [80, 119], + loc: { + start: { column: 7, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + + range: [77, 119], + loc: { + start: { column: 4, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + init: null, + + range: [77, 119], + loc: { + start: { column: 4, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + ], + kind: 'let', + + range: [73, 120], + loc: { + start: { column: 0, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 121], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..d168a628bf52 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,182 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-readonly-plus AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'map', + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '+', + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'readonly', + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'P', + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'in', + + range: [97, 99], + loc: { + start: { column: 24, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '+', + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [108, 109], + loc: { + start: { column: 35, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [111, 117], + loc: { + start: { column: 38, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [118, 119], + loc: { + start: { column: 45, line: 3 }, + end: { column: 46, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [119, 120], + loc: { + start: { column: 46, line: 3 }, + end: { column: 47, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/fixture.ts new file mode 100644 index 000000000000..189a06453901 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let map: { readonly [P in string]?: number }; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..d69be386629c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,108 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-readonly TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "map", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSMappedType { + type: "TSMappedType", + nameType: null, + optional: true, + readonly: true, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [109, 115], + loc: { + start: { column: 36, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSStringKeyword { + type: "TSStringKeyword", + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "P", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + out: false, + + range: [94, 105], + loc: { + start: { column: 21, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [82, 117], + loc: { + start: { column: 9, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [80, 117], + loc: { + start: { column: 7, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [77, 117], + loc: { + start: { column: 4, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + init: null, + + range: [77, 117], + loc: { + start: { column: 4, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 119], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..79ea45d64c91 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-readonly TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "map", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [84, 92], + loc: { + start: { column: 11, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "P", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [96, 98], + loc: { + start: { column: 23, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [109, 115], + loc: { + start: { column: 36, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..f71c3737c978 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/3-Babel-AST.shot @@ -0,0 +1,97 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-readonly Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "map", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSMappedType { + type: "TSMappedType", + nameType: null, + optional: true, + readonly: true, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [109, 115], + loc: { + start: { column: 36, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSStringKeyword { + type: "TSStringKeyword", + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + name: "P", + + range: [94, 105], + loc: { + start: { column: 21, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [82, 117], + loc: { + start: { column: 9, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [80, 117], + loc: { + start: { column: 7, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [77, 117], + loc: { + start: { column: 4, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + init: null, + + range: [77, 117], + loc: { + start: { column: 4, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 119], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..393ab004cba3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-readonly Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "map", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [84, 92], + loc: { + start: { column: 11, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "P", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [96, 98], + loc: { + start: { column: 23, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [109, 115], + loc: { + start: { column: 36, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..75e06a9b433f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,113 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-readonly AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'map', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSMappedType { + type: 'TSMappedType', + nameType: null, + optional: true, + readonly: true, + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [109, 115], + loc: { + start: { column: 36, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + typeParameter: TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSStringKeyword { + type: 'TSStringKeyword', + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'P', +- +- range: [94, 95], +- loc: { +- start: { column: 21, line: 3 }, +- end: { column: 22, line: 3 }, +- }, +- }, +- out: false, ++ name: 'P', + + range: [94, 105], + loc: { + start: { column: 21, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [82, 117], + loc: { + start: { column: 9, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [80, 117], + loc: { + start: { column: 7, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [77, 117], + loc: { + start: { column: 4, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + init: null, + + range: [77, 117], + loc: { + start: { column: 4, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + ], + kind: 'let', + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 119], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..96e87b1a6362 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,162 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-readonly AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'map', + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'readonly', + + range: [84, 92], + loc: { + start: { column: 11, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'P', + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'in', + + range: [96, 98], + loc: { + start: { column: 23, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [109, 115], + loc: { + start: { column: 36, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/fixture.ts new file mode 100644 index 000000000000..afedc85fe73b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let map: { [P in string] }; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..aedabb491bc6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,97 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-untypped TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "map", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSMappedType { + type: "TSMappedType", + nameType: null, + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSStringKeyword { + type: "TSStringKeyword", + + range: [90, 96], + loc: { + start: { column: 17, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "P", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + out: false, + + range: [85, 96], + loc: { + start: { column: 12, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [82, 99], + loc: { + start: { column: 9, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [80, 99], + loc: { + start: { column: 7, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [77, 99], + loc: { + start: { column: 4, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + init: null, + + range: [77, 99], + loc: { + start: { column: 4, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..ce2ed49cd660 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-untypped TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "map", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "P", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [87, 89], + loc: { + start: { column: 14, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [90, 96], + loc: { + start: { column: 17, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..56535786c450 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/3-Babel-AST.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-untypped Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "map", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSMappedType { + type: "TSMappedType", + nameType: null, + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSStringKeyword { + type: "TSStringKeyword", + + range: [90, 96], + loc: { + start: { column: 17, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + name: "P", + + range: [85, 96], + loc: { + start: { column: 12, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [82, 99], + loc: { + start: { column: 9, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [80, 99], + loc: { + start: { column: 7, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [77, 99], + loc: { + start: { column: 4, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + init: null, + + range: [77, 99], + loc: { + start: { column: 4, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..d0020a150d1b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-untypped Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "map", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "P", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [87, 89], + loc: { + start: { column: 14, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [90, 96], + loc: { + start: { column: 17, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..03f4bb194f82 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,102 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-untypped AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'map', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSMappedType { + type: 'TSMappedType', + nameType: null, + typeParameter: TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSStringKeyword { + type: 'TSStringKeyword', + + range: [90, 96], + loc: { + start: { column: 17, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'P', +- +- range: [85, 86], +- loc: { +- start: { column: 12, line: 3 }, +- end: { column: 13, line: 3 }, +- }, +- }, +- out: false, ++ name: 'P', + + range: [85, 96], + loc: { + start: { column: 12, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [82, 99], + loc: { + start: { column: 9, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [80, 99], + loc: { + start: { column: 7, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [77, 99], + loc: { + start: { column: 4, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + init: null, + + range: [77, 99], + loc: { + start: { column: 4, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + kind: 'let', + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..8686fe7909a8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,122 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped-untypped AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'map', + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'P', + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'in', + + range: [87, 89], + loc: { + start: { column: 14, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [90, 96], + loc: { + start: { column: 17, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/fixture.ts new file mode 100644 index 000000000000..ed12ea8ea1a1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let map: { [P in string]: number }; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..95ee43a32552 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "map", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSMappedType { + type: "TSMappedType", + nameType: null, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSStringKeyword { + type: "TSStringKeyword", + + range: [90, 96], + loc: { + start: { column: 17, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "P", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + out: false, + + range: [85, 96], + loc: { + start: { column: 12, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [82, 107], + loc: { + start: { column: 9, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [80, 107], + loc: { + start: { column: 7, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [77, 107], + loc: { + start: { column: 4, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + init: null, + + range: [77, 107], + loc: { + start: { column: 4, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..5b08c4c14101 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "map", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "P", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [87, 89], + loc: { + start: { column: 14, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [90, 96], + loc: { + start: { column: 17, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..dda941368129 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/3-Babel-AST.shot @@ -0,0 +1,95 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "map", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSMappedType { + type: "TSMappedType", + nameType: null, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + constraint: TSStringKeyword { + type: "TSStringKeyword", + + range: [90, 96], + loc: { + start: { column: 17, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + name: "P", + + range: [85, 96], + loc: { + start: { column: 12, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [82, 107], + loc: { + start: { column: 9, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [80, 107], + loc: { + start: { column: 7, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [77, 107], + loc: { + start: { column: 4, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + init: null, + + range: [77, 107], + loc: { + start: { column: 4, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..f4d870ba6332 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "map", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "P", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [87, 89], + loc: { + start: { column: 14, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [90, 96], + loc: { + start: { column: 17, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..c46578e24d03 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,111 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'map', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSMappedType { + type: 'TSMappedType', + nameType: null, + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + typeParameter: TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSStringKeyword { + type: 'TSStringKeyword', + + range: [90, 96], + loc: { + start: { column: 17, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'P', +- +- range: [85, 86], +- loc: { +- start: { column: 12, line: 3 }, +- end: { column: 13, line: 3 }, +- }, +- }, +- out: false, ++ name: 'P', + + range: [85, 96], + loc: { + start: { column: 12, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + + range: [82, 107], + loc: { + start: { column: 9, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [80, 107], + loc: { + start: { column: 7, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [77, 107], + loc: { + start: { column: 4, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + init: null, + + range: [77, 107], + loc: { + start: { column: 4, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + kind: 'let', + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..4e38e7cc1253 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,142 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types mapped AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'map', + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'P', + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'in', + + range: [87, 89], + loc: { + start: { column: 14, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [90, 96], + loc: { + start: { column: 17, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/fixture.ts new file mode 100644 index 000000000000..161642a15386 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Foo = + | [number, string?, boolean?] + | ([{}, [number?] | (null & boolean[])] & {}); diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..edaba8621f1b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,222 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types nested-types TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [89, 95], + loc: { + start: { column: 5, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + TSOptionalType { + type: "TSOptionalType", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [97, 103], + loc: { + start: { column: 13, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + + range: [97, 104], + loc: { + start: { column: 13, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + TSOptionalType { + type: "TSOptionalType", + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [106, 113], + loc: { + start: { column: 22, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + + range: [106, 114], + loc: { + start: { column: 22, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + ], + + range: [88, 115], + loc: { + start: { column: 4, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + TSIntersectionType { + type: "TSIntersectionType", + types: Array [ + TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [], + + range: [122, 124], + loc: { + start: { column: 6, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + TSUnionType { + type: "TSUnionType", + types: Array [ + TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSOptionalType { + type: "TSOptionalType", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [127, 133], + loc: { + start: { column: 11, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [127, 134], + loc: { + start: { column: 11, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + ], + + range: [126, 135], + loc: { + start: { column: 10, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + TSIntersectionType { + type: "TSIntersectionType", + types: Array [ + TSNullKeyword { + type: "TSNullKeyword", + + range: [139, 143], + loc: { + start: { column: 23, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + TSArrayType { + type: "TSArrayType", + elementType: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [146, 153], + loc: { + start: { column: 30, line: 5 }, + end: { column: 37, line: 5 }, + }, + }, + + range: [146, 155], + loc: { + start: { column: 30, line: 5 }, + end: { column: 39, line: 5 }, + }, + }, + ], + + range: [139, 155], + loc: { + start: { column: 23, line: 5 }, + end: { column: 39, line: 5 }, + }, + }, + ], + + range: [126, 156], + loc: { + start: { column: 10, line: 5 }, + end: { column: 40, line: 5 }, + }, + }, + ], + + range: [121, 157], + loc: { + start: { column: 5, line: 5 }, + end: { column: 41, line: 5 }, + }, + }, + TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [], + + range: [160, 162], + loc: { + start: { column: 44, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + ], + + range: [121, 162], + loc: { + start: { column: 5, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + ], + + range: [86, 163], + loc: { + start: { column: 2, line: 4 }, + end: { column: 47, line: 5 }, + }, + }, + + range: [73, 164], + loc: { + start: { column: 0, line: 3 }, + end: { column: 48, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 165], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..d5e8ff2e9d6d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,376 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types nested-types TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [86, 87], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [88, 89], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [89, 95], + loc: { + start: { column: 5, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [95, 96], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [97, 103], + loc: { + start: { column: 13, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [103, 104], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [104, 105], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [106, 113], + loc: { + start: { column: 22, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [113, 114], + loc: { + start: { column: 29, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [114, 115], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [118, 119], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [120, 121], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [121, 122], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [122, 123], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [123, 124], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [124, 125], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [126, 127], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [127, 133], + loc: { + start: { column: 11, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [133, 134], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [134, 135], + loc: { + start: { column: 18, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [136, 137], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [138, 139], + loc: { + start: { column: 22, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "null", + + range: [139, 143], + loc: { + start: { column: 23, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&", + + range: [144, 145], + loc: { + start: { column: 28, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [146, 153], + loc: { + start: { column: 30, line: 5 }, + end: { column: 37, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [153, 154], + loc: { + start: { column: 37, line: 5 }, + end: { column: 38, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [154, 155], + loc: { + start: { column: 38, line: 5 }, + end: { column: 39, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [155, 156], + loc: { + start: { column: 39, line: 5 }, + end: { column: 40, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [156, 157], + loc: { + start: { column: 40, line: 5 }, + end: { column: 41, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&", + + range: [158, 159], + loc: { + start: { column: 42, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [160, 161], + loc: { + start: { column: 44, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [161, 162], + loc: { + start: { column: 45, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [162, 163], + loc: { + start: { column: 46, line: 5 }, + end: { column: 47, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [163, 164], + loc: { + start: { column: 47, line: 5 }, + end: { column: 48, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..8c7b61a52c82 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/3-Babel-AST.shot @@ -0,0 +1,240 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types nested-types Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [89, 95], + loc: { + start: { column: 5, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + TSOptionalType { + type: "TSOptionalType", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [97, 103], + loc: { + start: { column: 13, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + + range: [97, 104], + loc: { + start: { column: 13, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + TSOptionalType { + type: "TSOptionalType", + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [106, 113], + loc: { + start: { column: 22, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + + range: [106, 114], + loc: { + start: { column: 22, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + ], + + range: [88, 115], + loc: { + start: { column: 4, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + TSParenthesizedType { + type: "TSParenthesizedType", + typeAnnotation: TSIntersectionType { + type: "TSIntersectionType", + types: Array [ + TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [], + + range: [122, 124], + loc: { + start: { column: 6, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + TSUnionType { + type: "TSUnionType", + types: Array [ + TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSOptionalType { + type: "TSOptionalType", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [127, 133], + loc: { + start: { column: 11, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + + range: [127, 134], + loc: { + start: { column: 11, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + ], + + range: [126, 135], + loc: { + start: { column: 10, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + TSParenthesizedType { + type: "TSParenthesizedType", + typeAnnotation: TSIntersectionType { + type: "TSIntersectionType", + types: Array [ + TSNullKeyword { + type: "TSNullKeyword", + + range: [139, 143], + loc: { + start: { column: 23, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + TSArrayType { + type: "TSArrayType", + elementType: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [146, 153], + loc: { + start: { column: 30, line: 5 }, + end: { column: 37, line: 5 }, + }, + }, + + range: [146, 155], + loc: { + start: { column: 30, line: 5 }, + end: { column: 39, line: 5 }, + }, + }, + ], + + range: [139, 155], + loc: { + start: { column: 23, line: 5 }, + end: { column: 39, line: 5 }, + }, + }, + + range: [138, 156], + loc: { + start: { column: 22, line: 5 }, + end: { column: 40, line: 5 }, + }, + }, + ], + + range: [126, 156], + loc: { + start: { column: 10, line: 5 }, + end: { column: 40, line: 5 }, + }, + }, + ], + + range: [121, 157], + loc: { + start: { column: 5, line: 5 }, + end: { column: 41, line: 5 }, + }, + }, + TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [], + + range: [160, 162], + loc: { + start: { column: 44, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + ], + + range: [121, 162], + loc: { + start: { column: 5, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + + range: [120, 163], + loc: { + start: { column: 4, line: 5 }, + end: { column: 47, line: 5 }, + }, + }, + ], + + range: [86, 163], + loc: { + start: { column: 2, line: 4 }, + end: { column: 47, line: 5 }, + }, + }, + + range: [73, 164], + loc: { + start: { column: 0, line: 3 }, + end: { column: 48, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 165], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..7b38c3f89063 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,376 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types nested-types Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [86, 87], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [88, 89], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [89, 95], + loc: { + start: { column: 5, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [95, 96], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [97, 103], + loc: { + start: { column: 13, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [103, 104], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [104, 105], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [106, 113], + loc: { + start: { column: 22, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [113, 114], + loc: { + start: { column: 29, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [114, 115], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [118, 119], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [120, 121], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [121, 122], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [122, 123], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [123, 124], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [124, 125], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [126, 127], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [127, 133], + loc: { + start: { column: 11, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [133, 134], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [134, 135], + loc: { + start: { column: 18, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [136, 137], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [138, 139], + loc: { + start: { column: 22, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Null { + type: "Null", + value: "null", + + range: [139, 143], + loc: { + start: { column: 23, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&", + + range: [144, 145], + loc: { + start: { column: 28, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [146, 153], + loc: { + start: { column: 30, line: 5 }, + end: { column: 37, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [153, 154], + loc: { + start: { column: 37, line: 5 }, + end: { column: 38, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [154, 155], + loc: { + start: { column: 38, line: 5 }, + end: { column: 39, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [155, 156], + loc: { + start: { column: 39, line: 5 }, + end: { column: 40, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [156, 157], + loc: { + start: { column: 40, line: 5 }, + end: { column: 41, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&", + + range: [158, 159], + loc: { + start: { column: 42, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [160, 161], + loc: { + start: { column: 44, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [161, 162], + loc: { + start: { column: 45, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [162, 163], + loc: { + start: { column: 46, line: 5 }, + end: { column: 47, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [163, 164], + loc: { + start: { column: 47, line: 5 }, + end: { column: 48, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..87b233890935 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,333 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types nested-types AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSUnionType { + type: 'TSUnionType', + types: Array [ + TSTupleType { + type: 'TSTupleType', + elementTypes: Array [ + TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [89, 95], + loc: { + start: { column: 5, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + TSOptionalType { + type: 'TSOptionalType', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [97, 103], + loc: { + start: { column: 13, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + + range: [97, 104], + loc: { + start: { column: 13, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + TSOptionalType { + type: 'TSOptionalType', + typeAnnotation: TSBooleanKeyword { + type: 'TSBooleanKeyword', + + range: [106, 113], + loc: { + start: { column: 22, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + + range: [106, 114], + loc: { + start: { column: 22, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + ], + + range: [88, 115], + loc: { + start: { column: 4, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, +- TSIntersectionType { +- type: 'TSIntersectionType', +- types: Array [ +- TSTupleType { +- type: 'TSTupleType', +- elementTypes: Array [ +- TSTypeLiteral { +- type: 'TSTypeLiteral', +- members: Array [], ++ TSParenthesizedType { ++ type: 'TSParenthesizedType', ++ typeAnnotation: TSIntersectionType { ++ type: 'TSIntersectionType', ++ types: Array [ ++ TSTupleType { ++ type: 'TSTupleType', ++ elementTypes: Array [ ++ TSTypeLiteral { ++ type: 'TSTypeLiteral', ++ members: Array [], + +- range: [122, 124], +- loc: { +- start: { column: 6, line: 5 }, +- end: { column: 8, line: 5 }, ++ range: [122, 124], ++ loc: { ++ start: { column: 6, line: 5 }, ++ end: { column: 8, line: 5 }, ++ }, + }, +- }, +- TSUnionType { +- type: 'TSUnionType', +- types: Array [ +- TSTupleType { +- type: 'TSTupleType', +- elementTypes: Array [ +- TSOptionalType { +- type: 'TSOptionalType', +- typeAnnotation: TSNumberKeyword { +- type: 'TSNumberKeyword', ++ TSUnionType { ++ type: 'TSUnionType', ++ types: Array [ ++ TSTupleType { ++ type: 'TSTupleType', ++ elementTypes: Array [ ++ TSOptionalType { ++ type: 'TSOptionalType', ++ typeAnnotation: TSNumberKeyword { ++ type: 'TSNumberKeyword', ++ ++ range: [127, 133], ++ loc: { ++ start: { column: 11, line: 5 }, ++ end: { column: 17, line: 5 }, ++ }, ++ }, + +- range: [127, 133], ++ range: [127, 134], + loc: { + start: { column: 11, line: 5 }, +- end: { column: 17, line: 5 }, ++ end: { column: 18, line: 5 }, + }, + }, ++ ], + +- range: [127, 134], +- loc: { +- start: { column: 11, line: 5 }, +- end: { column: 18, line: 5 }, +- }, ++ range: [126, 135], ++ loc: { ++ start: { column: 10, line: 5 }, ++ end: { column: 19, line: 5 }, + }, +- ], +- +- range: [126, 135], +- loc: { +- start: { column: 10, line: 5 }, +- end: { column: 19, line: 5 }, + }, +- }, +- TSIntersectionType { +- type: 'TSIntersectionType', +- types: Array [ +- TSNullKeyword { +- type: 'TSNullKeyword', ++ TSParenthesizedType { ++ type: 'TSParenthesizedType', ++ typeAnnotation: TSIntersectionType { ++ type: 'TSIntersectionType', ++ types: Array [ ++ TSNullKeyword { ++ type: 'TSNullKeyword', + +- range: [139, 143], +- loc: { +- start: { column: 23, line: 5 }, +- end: { column: 27, line: 5 }, +- }, +- }, +- TSArrayType { +- type: 'TSArrayType', +- elementType: TSBooleanKeyword { +- type: 'TSBooleanKeyword', ++ range: [139, 143], ++ loc: { ++ start: { column: 23, line: 5 }, ++ end: { column: 27, line: 5 }, ++ }, ++ }, ++ TSArrayType { ++ type: 'TSArrayType', ++ elementType: TSBooleanKeyword { ++ type: 'TSBooleanKeyword', + +- range: [146, 153], +- loc: { +- start: { column: 30, line: 5 }, +- end: { column: 37, line: 5 }, ++ range: [146, 153], ++ loc: { ++ start: { column: 30, line: 5 }, ++ end: { column: 37, line: 5 }, ++ }, ++ }, ++ ++ range: [146, 155], ++ loc: { ++ start: { column: 30, line: 5 }, ++ end: { column: 39, line: 5 }, ++ }, + }, +- }, ++ ], + +- range: [146, 155], ++ range: [139, 155], + loc: { +- start: { column: 30, line: 5 }, ++ start: { column: 23, line: 5 }, + end: { column: 39, line: 5 }, + }, + }, +- ], + +- range: [139, 155], +- loc: { +- start: { column: 23, line: 5 }, +- end: { column: 39, line: 5 }, ++ range: [138, 156], ++ loc: { ++ start: { column: 22, line: 5 }, ++ end: { column: 40, line: 5 }, ++ }, + }, ++ ], ++ ++ range: [126, 156], ++ loc: { ++ start: { column: 10, line: 5 }, ++ end: { column: 40, line: 5 }, + }, +- ], ++ }, ++ ], + +- range: [126, 156], +- loc: { +- start: { column: 10, line: 5 }, +- end: { column: 40, line: 5 }, +- }, ++ range: [121, 157], ++ loc: { ++ start: { column: 5, line: 5 }, ++ end: { column: 41, line: 5 }, + }, +- ], +- +- range: [121, 157], +- loc: { +- start: { column: 5, line: 5 }, +- end: { column: 41, line: 5 }, + }, +- }, +- TSTypeLiteral { +- type: 'TSTypeLiteral', +- members: Array [], ++ TSTypeLiteral { ++ type: 'TSTypeLiteral', ++ members: Array [], + +- range: [160, 162], +- loc: { +- start: { column: 44, line: 5 }, +- end: { column: 46, line: 5 }, ++ range: [160, 162], ++ loc: { ++ start: { column: 44, line: 5 }, ++ end: { column: 46, line: 5 }, ++ }, + }, ++ ], ++ ++ range: [121, 162], ++ loc: { ++ start: { column: 5, line: 5 }, ++ end: { column: 46, line: 5 }, + }, +- ], ++ }, + +- range: [121, 162], ++ range: [120, 163], + loc: { +- start: { column: 5, line: 5 }, +- end: { column: 46, line: 5 }, ++ start: { column: 4, line: 5 }, ++ end: { column: 47, line: 5 }, + }, + }, + ], + + range: [86, 163], + loc: { + start: { column: 2, line: 4 }, + end: { column: 47, line: 5 }, + }, + }, + + range: [73, 164], + loc: { + start: { column: 0, line: 3 }, + end: { column: 48, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 165], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..53ed6df9bae9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,382 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types nested-types AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Identifier { + type: 'Identifier', + value: 'type', + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '|', + + range: [86, 87], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [88, 89], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [89, 95], + loc: { + start: { column: 5, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [95, 96], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [97, 103], + loc: { + start: { column: 13, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [103, 104], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [104, 105], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'boolean', + + range: [106, 113], + loc: { + start: { column: 22, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [113, 114], + loc: { + start: { column: 29, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [114, 115], + loc: { + start: { column: 30, line: 4 }, + end: { column: 31, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '|', + + range: [118, 119], + loc: { + start: { column: 2, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [120, 121], + loc: { + start: { column: 4, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [121, 122], + loc: { + start: { column: 5, line: 5 }, + end: { column: 6, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [122, 123], + loc: { + start: { column: 6, line: 5 }, + end: { column: 7, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [123, 124], + loc: { + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [124, 125], + loc: { + start: { column: 8, line: 5 }, + end: { column: 9, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [126, 127], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [127, 133], + loc: { + start: { column: 11, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [133, 134], + loc: { + start: { column: 17, line: 5 }, + end: { column: 18, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [134, 135], + loc: { + start: { column: 18, line: 5 }, + end: { column: 19, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '|', + + range: [136, 137], + loc: { + start: { column: 20, line: 5 }, + end: { column: 21, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [138, 139], + loc: { + start: { column: 22, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Null { ++ type: 'Null', + value: 'null', + + range: [139, 143], + loc: { + start: { column: 23, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '&', + + range: [144, 145], + loc: { + start: { column: 28, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'boolean', + + range: [146, 153], + loc: { + start: { column: 30, line: 5 }, + end: { column: 37, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [153, 154], + loc: { + start: { column: 37, line: 5 }, + end: { column: 38, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [154, 155], + loc: { + start: { column: 38, line: 5 }, + end: { column: 39, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [155, 156], + loc: { + start: { column: 39, line: 5 }, + end: { column: 40, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [156, 157], + loc: { + start: { column: 40, line: 5 }, + end: { column: 41, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '&', + + range: [158, 159], + loc: { + start: { column: 42, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [160, 161], + loc: { + start: { column: 44, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [161, 162], + loc: { + start: { column: 45, line: 5 }, + end: { column: 46, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [162, 163], + loc: { + start: { column: 46, line: 5 }, + end: { column: 47, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [163, 164], + loc: { + start: { column: 47, line: 5 }, + end: { column: 48, line: 5 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/fixture.ts new file mode 100644 index 000000000000..bf4852082462 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Thing = { + get size(): number; + set size(value: number | string | boolean); +}; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..f72d70c08459 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types object-literal-type-with-accessors TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Thing", + + range: [78, 83], + loc: { + start: { column: 5, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "size", + + range: [94, 98], + loc: { + start: { column: 6, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + kind: "get", + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [102, 108], + loc: { + start: { column: 14, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [100, 108], + loc: { + start: { column: 12, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [90, 109], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "size", + + range: [116, 120], + loc: { + start: { column: 6, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + kind: "set", + params: Array [ + Identifier { + type: "Identifier", + name: "value", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [128, 134], + loc: { + start: { column: 18, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + TSStringKeyword { + type: "TSStringKeyword", + + range: [137, 143], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [146, 153], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + ], + + range: [128, 153], + loc: { + start: { column: 18, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + + range: [126, 153], + loc: { + start: { column: 16, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + + range: [121, 153], + loc: { + start: { column: 11, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + ], + + range: [112, 155], + loc: { + start: { column: 2, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + ], + + range: [86, 157], + loc: { + start: { column: 13, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + + range: [73, 158], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 159], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..ce30377019f9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,256 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types object-literal-type-with-accessors TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Thing", + + range: [78, 83], + loc: { + start: { column: 5, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "get", + + range: [90, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "size", + + range: [94, 98], + loc: { + start: { column: 6, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [98, 99], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [99, 100], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [100, 101], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [102, 108], + loc: { + start: { column: 14, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [108, 109], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "set", + + range: [112, 115], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "size", + + range: [116, 120], + loc: { + start: { column: 6, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [120, 121], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "value", + + range: [121, 126], + loc: { + start: { column: 11, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [126, 127], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [128, 134], + loc: { + start: { column: 18, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [135, 136], + loc: { + start: { column: 25, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [137, 143], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [144, 145], + loc: { + start: { column: 34, line: 5 }, + end: { column: 35, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [146, 153], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [153, 154], + loc: { + start: { column: 43, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [154, 155], + loc: { + start: { column: 44, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [156, 157], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [157, 158], + loc: { + start: { column: 1, line: 6 }, + end: { column: 2, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..e5806cc2a171 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/3-Babel-AST.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types object-literal-type-with-accessors Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Thing", + + range: [78, 83], + loc: { + start: { column: 5, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "size", + + range: [94, 98], + loc: { + start: { column: 6, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + kind: "get", + parameters: Array [], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [102, 108], + loc: { + start: { column: 14, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [100, 108], + loc: { + start: { column: 12, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [90, 109], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + TSMethodSignature { + type: "TSMethodSignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "size", + + range: [116, 120], + loc: { + start: { column: 6, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + kind: "set", + parameters: Array [ + Identifier { + type: "Identifier", + name: "value", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [128, 134], + loc: { + start: { column: 18, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + TSStringKeyword { + type: "TSStringKeyword", + + range: [137, 143], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [146, 153], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + ], + + range: [128, 153], + loc: { + start: { column: 18, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + + range: [126, 153], + loc: { + start: { column: 16, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + + range: [121, 153], + loc: { + start: { column: 11, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + ], + + range: [112, 155], + loc: { + start: { column: 2, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + ], + + range: [86, 157], + loc: { + start: { column: 13, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + + range: [73, 158], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 159], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..520ce3e9d190 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,256 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types object-literal-type-with-accessors Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Thing", + + range: [78, 83], + loc: { + start: { column: 5, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "get", + + range: [90, 93], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "size", + + range: [94, 98], + loc: { + start: { column: 6, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [98, 99], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [99, 100], + loc: { + start: { column: 11, line: 4 }, + end: { column: 12, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [100, 101], + loc: { + start: { column: 12, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [102, 108], + loc: { + start: { column: 14, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [108, 109], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "set", + + range: [112, 115], + loc: { + start: { column: 2, line: 5 }, + end: { column: 5, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "size", + + range: [116, 120], + loc: { + start: { column: 6, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [120, 121], + loc: { + start: { column: 10, line: 5 }, + end: { column: 11, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "value", + + range: [121, 126], + loc: { + start: { column: 11, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [126, 127], + loc: { + start: { column: 16, line: 5 }, + end: { column: 17, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [128, 134], + loc: { + start: { column: 18, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [135, 136], + loc: { + start: { column: 25, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [137, 143], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [144, 145], + loc: { + start: { column: 34, line: 5 }, + end: { column: 35, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [146, 153], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [153, 154], + loc: { + start: { column: 43, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [154, 155], + loc: { + start: { column: 44, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [156, 157], + loc: { + start: { column: 0, line: 6 }, + end: { column: 1, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [157, 158], + loc: { + start: { column: 1, line: 6 }, + end: { column: 2, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..d1b1d336bcf5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,173 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types object-literal-type-with-accessors AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'Thing', + + range: [78, 83], + loc: { + start: { column: 5, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: 'TSTypeLiteral', + members: Array [ + TSMethodSignature { + type: 'TSMethodSignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'size', + + range: [94, 98], + loc: { + start: { column: 6, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + kind: 'get', +- params: Array [], +- returnType: TSTypeAnnotation { ++ parameters: Array [], ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [102, 108], + loc: { + start: { column: 14, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [100, 108], + loc: { + start: { column: 12, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [90, 109], + loc: { + start: { column: 2, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + TSMethodSignature { + type: 'TSMethodSignature', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'size', + + range: [116, 120], + loc: { + start: { column: 6, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + kind: 'set', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'value', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSUnionType { + type: 'TSUnionType', + types: Array [ + TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [128, 134], + loc: { + start: { column: 18, line: 5 }, + end: { column: 24, line: 5 }, + }, + }, + TSStringKeyword { + type: 'TSStringKeyword', + + range: [137, 143], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + TSBooleanKeyword { + type: 'TSBooleanKeyword', + + range: [146, 153], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + ], + + range: [128, 153], + loc: { + start: { column: 18, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + + range: [126, 153], + loc: { + start: { column: 16, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + + range: [121, 153], + loc: { + start: { column: 11, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + ], + + range: [112, 155], + loc: { + start: { column: 2, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + ], + + range: [86, 157], + loc: { + start: { column: 13, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + + range: [73, 158], + loc: { + start: { column: 0, line: 3 }, + end: { column: 2, line: 6 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 159], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..8351b86c4803 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types object-literal-type-with-accessors AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/fixture.ts new file mode 100644 index 000000000000..c5fc0636182d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Mapper = (x: T) => U; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..f224655bb634 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,165 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-in-and-out TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Mapper", + + range: [78, 84], + loc: { + start: { column: 5, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + params: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [102, 105], + loc: { + start: { column: 29, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [101, 105], + loc: { + start: { column: 28, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [107, 111], + loc: { + start: { column: 34, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [100, 111], + loc: { + start: { column: 27, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: true, + name: Identifier { + type: "Identifier", + name: "T", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + out: false, + + range: [85, 89], + loc: { + start: { column: 12, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "U", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + out: true, + + range: [91, 96], + loc: { + start: { column: 18, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + + range: [84, 97], + loc: { + start: { column: 11, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..626b2bc72898 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,186 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-in-and-out TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Mapper", + + range: [78, 84], + loc: { + start: { column: 5, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [85, 87], + loc: { + start: { column: 12, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "out", + + range: [91, 94], + loc: { + start: { column: 18, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [107, 109], + loc: { + start: { column: 34, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..fafece2841c1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/3-Babel-AST.shot @@ -0,0 +1,145 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-in-and-out Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Mapper", + + range: [78, 84], + loc: { + start: { column: 5, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + parameters: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [102, 105], + loc: { + start: { column: 29, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [101, 105], + loc: { + start: { column: 28, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [107, 111], + loc: { + start: { column: 34, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [100, 111], + loc: { + start: { column: 27, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: true, + name: "T", + + range: [85, 89], + loc: { + start: { column: 12, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + TSTypeParameter { + type: "TSTypeParameter", + name: "U", + out: true, + + range: [91, 96], + loc: { + start: { column: 18, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + + range: [84, 97], + loc: { + start: { column: 11, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..d6fbd84ba623 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,186 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-in-and-out Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Mapper", + + range: [78, 84], + loc: { + start: { column: 5, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [85, 87], + loc: { + start: { column: 12, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "out", + + range: [91, 94], + loc: { + start: { column: 18, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [107, 109], + loc: { + start: { column: 34, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..0acb047d6756 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,173 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-in-and-out AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'Mapper', + + range: [78, 84], + loc: { + start: { column: 5, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + typeAnnotation: TSFunctionType { + type: 'TSFunctionType', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'x', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [102, 105], + loc: { + start: { column: 29, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [101, 105], + loc: { + start: { column: 28, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'U', + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [107, 111], + loc: { + start: { column: 34, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [100, 111], + loc: { + start: { column: 27, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + in: true, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [88, 89], +- loc: { +- start: { column: 15, line: 3 }, +- end: { column: 16, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [85, 89], + loc: { + start: { column: 12, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'U', +- +- range: [95, 96], +- loc: { +- start: { column: 22, line: 3 }, +- end: { column: 23, line: 3 }, +- }, +- }, ++ name: 'U', + out: true, + + range: [91, 96], + loc: { + start: { column: 18, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + + range: [84, 97], + loc: { + start: { column: 11, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..36475ebde607 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-in-and-out AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/fixture.ts new file mode 100644 index 000000000000..1b264a310969 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Processor = (x: T) => T; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..86e8cc26e85c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,144 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-in-out TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Processor", + + range: [78, 87], + loc: { + start: { column: 5, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + params: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [102, 105], + loc: { + start: { column: 29, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [101, 105], + loc: { + start: { column: 28, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [107, 111], + loc: { + start: { column: 34, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [100, 111], + loc: { + start: { column: 27, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: true, + name: Identifier { + type: "Identifier", + name: "T", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + out: true, + + range: [88, 96], + loc: { + start: { column: 15, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + + range: [87, 97], + loc: { + start: { column: 14, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..de3bdc5de778 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-in-out TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Processor", + + range: [78, 87], + loc: { + start: { column: 5, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [88, 90], + loc: { + start: { column: 15, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "out", + + range: [91, 94], + loc: { + start: { column: 18, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [107, 109], + loc: { + start: { column: 34, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..e6f0eabf34f8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/3-Babel-AST.shot @@ -0,0 +1,135 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-in-out Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Processor", + + range: [78, 87], + loc: { + start: { column: 5, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + parameters: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [102, 105], + loc: { + start: { column: 29, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [101, 105], + loc: { + start: { column: 28, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [107, 111], + loc: { + start: { column: 34, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [100, 111], + loc: { + start: { column: 27, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: true, + name: "T", + out: true, + + range: [88, 96], + loc: { + start: { column: 15, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + + range: [87, 97], + loc: { + start: { column: 14, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..48478eab1616 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-in-out Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Processor", + + range: [78, 87], + loc: { + start: { column: 5, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [88, 90], + loc: { + start: { column: 15, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "out", + + range: [91, 94], + loc: { + start: { column: 18, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [107, 109], + loc: { + start: { column: 34, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [111, 112], + loc: { + start: { column: 38, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..c8f77719ef7a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,151 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-in-out AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'Processor', + + range: [78, 87], + loc: { + start: { column: 5, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + typeAnnotation: TSFunctionType { + type: 'TSFunctionType', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'x', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [102, 105], + loc: { + start: { column: 29, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [101, 105], + loc: { + start: { column: 28, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [110, 111], + loc: { + start: { column: 37, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [107, 111], + loc: { + start: { column: 34, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + + range: [100, 111], + loc: { + start: { column: 27, line: 3 }, + end: { column: 38, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + in: true, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [95, 96], +- loc: { +- start: { column: 22, line: 3 }, +- end: { column: 23, line: 3 }, +- }, +- }, ++ name: 'T', + out: true, + + range: [88, 96], + loc: { + start: { column: 15, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + + range: [87, 97], + loc: { + start: { column: 14, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + + range: [73, 112], + loc: { + start: { column: 0, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 113], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..012d7b4c8b9e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-in-out AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/fixture.ts new file mode 100644 index 000000000000..8b8616bd9b7a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Consumer = (x: T) => void; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..101936bcbabf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,134 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-in TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Consumer", + + range: [78, 86], + loc: { + start: { column: 5, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + params: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [97, 100], + loc: { + start: { column: 24, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [96, 100], + loc: { + start: { column: 23, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [105, 109], + loc: { + start: { column: 32, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [102, 109], + loc: { + start: { column: 29, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [95, 109], + loc: { + start: { column: 22, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: true, + name: Identifier { + type: "Identifier", + name: "T", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + out: false, + + range: [87, 91], + loc: { + start: { column: 14, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + + range: [86, 92], + loc: { + start: { column: 13, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 111], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..cb5b8dbf36b4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-in TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Consumer", + + range: [78, 86], + loc: { + start: { column: 5, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [87, 89], + loc: { + start: { column: 14, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [102, 104], + loc: { + start: { column: 29, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [105, 109], + loc: { + start: { column: 32, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..9c42b738b209 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/3-Babel-AST.shot @@ -0,0 +1,124 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-in Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Consumer", + + range: [78, 86], + loc: { + start: { column: 5, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + parameters: Array [ + Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [97, 100], + loc: { + start: { column: 24, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [96, 100], + loc: { + start: { column: 23, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [105, 109], + loc: { + start: { column: 32, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [102, 109], + loc: { + start: { column: 29, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [95, 109], + loc: { + start: { column: 22, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: true, + name: "T", + + range: [87, 91], + loc: { + start: { column: 14, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + + range: [86, 92], + loc: { + start: { column: 13, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 111], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..3999e8570813 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-in Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Consumer", + + range: [78, 86], + loc: { + start: { column: 5, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [87, 89], + loc: { + start: { column: 14, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [102, 104], + loc: { + start: { column: 29, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [105, 109], + loc: { + start: { column: 32, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..20b933b3fd64 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,141 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-in AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'Consumer', + + range: [78, 86], + loc: { + start: { column: 5, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + typeAnnotation: TSFunctionType { + type: 'TSFunctionType', +- params: Array [ ++ parameters: Array [ + Identifier { + type: 'Identifier', + name: 'x', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [97, 100], + loc: { + start: { column: 24, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [96, 100], + loc: { + start: { column: 23, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], +- returnType: TSTypeAnnotation { ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSVoidKeyword { + type: 'TSVoidKeyword', + + range: [105, 109], + loc: { + start: { column: 32, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [102, 109], + loc: { + start: { column: 29, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [95, 109], + loc: { + start: { column: 22, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + in: true, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [90, 91], +- loc: { +- start: { column: 17, line: 3 }, +- end: { column: 18, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [87, 91], + loc: { + start: { column: 14, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + + range: [86, 92], + loc: { + start: { column: 13, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 111], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..9f174448bd37 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-in AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/fixture.ts new file mode 100644 index 000000000000..cbaf191ecdfc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Provider = () => T; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..192a30ecd8b5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,105 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-out TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Provider", + + range: [78, 86], + loc: { + start: { column: 5, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [99, 103], + loc: { + start: { column: 26, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [96, 103], + loc: { + start: { column: 23, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + out: true, + + range: [87, 92], + loc: { + start: { column: 14, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ], + + range: [86, 93], + loc: { + start: { column: 13, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..dc4d72a5083b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-out TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Provider", + + range: [78, 86], + loc: { + start: { column: 5, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "out", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [99, 101], + loc: { + start: { column: 26, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..451d20aa1e61 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/3-Babel-AST.shot @@ -0,0 +1,95 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-out Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Provider", + + range: [78, 86], + loc: { + start: { column: 5, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + parameters: Array [], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [99, 103], + loc: { + start: { column: 26, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [96, 103], + loc: { + start: { column: 23, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + out: true, + + range: [87, 92], + loc: { + start: { column: 14, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ], + + range: [86, 93], + loc: { + start: { column: 13, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..e70f05c115d2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-out Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Provider", + + range: [78, 86], + loc: { + start: { column: 5, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "out", + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [99, 101], + loc: { + start: { column: 26, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..ae55b74f2dc5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,112 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-out AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'Provider', + + range: [78, 86], + loc: { + start: { column: 5, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + typeAnnotation: TSFunctionType { + type: 'TSFunctionType', +- params: Array [], +- returnType: TSTypeAnnotation { ++ parameters: Array [], ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [99, 103], + loc: { + start: { column: 26, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + + range: [96, 103], + loc: { + start: { column: 23, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [91, 92], +- loc: { +- start: { column: 18, line: 3 }, +- end: { column: 19, line: 3 }, +- }, +- }, ++ name: 'T', + out: true, + + range: [87, 92], + loc: { + start: { column: 14, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ], + + range: [86, 93], + loc: { + start: { column: 13, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [73, 104], + loc: { + start: { column: 0, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..7e9ba9251c42 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types optional-variance-out AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/fixture.ts new file mode 100644 index 000000000000..a9606bf9bdb7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Foo = string | number; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..6c3c6e241e07 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,64 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types parenthesized-type TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [93, 99], + loc: { + start: { column: 20, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + + range: [84, 99], + loc: { + start: { column: 11, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..de2190dba61e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types parenthesized-type TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [93, 99], + loc: { + start: { column: 20, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..5983bc284040 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/3-Babel-AST.shot @@ -0,0 +1,64 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types parenthesized-type Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [93, 99], + loc: { + start: { column: 20, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + + range: [84, 99], + loc: { + start: { column: 11, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..90b61826fce4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types parenthesized-type Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [93, 99], + loc: { + start: { column: 20, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..2a275a364407 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types parenthesized-type AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..e0f721e566e5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types parenthesized-type AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/fixture.ts new file mode 100644 index 000000000000..07d7262f71c1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let x: Array>; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..237af44d7d8a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types reference-generic-nested TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Array", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Array", + + range: [86, 91], + loc: { + start: { column: 13, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [92, 98], + loc: { + start: { column: 19, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + ], + + range: [91, 99], + loc: { + start: { column: 18, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [86, 99], + loc: { + start: { column: 13, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + + range: [85, 100], + loc: { + start: { column: 12, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [80, 100], + loc: { + start: { column: 7, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [78, 100], + loc: { + start: { column: 5, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [77, 100], + loc: { + start: { column: 4, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + init: null, + + range: [77, 100], + loc: { + start: { column: 4, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..179cb0647db7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types reference-generic-nested TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Array", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Array", + + range: [86, 91], + loc: { + start: { column: 13, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [92, 98], + loc: { + start: { column: 19, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..8d2c97b3fe7c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/3-Babel-AST.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types reference-generic-nested Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Array", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Array", + + range: [86, 91], + loc: { + start: { column: 13, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [92, 98], + loc: { + start: { column: 19, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + ], + + range: [91, 99], + loc: { + start: { column: 18, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [86, 99], + loc: { + start: { column: 13, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + + range: [85, 100], + loc: { + start: { column: 12, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [80, 100], + loc: { + start: { column: 7, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [78, 100], + loc: { + start: { column: 5, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [77, 100], + loc: { + start: { column: 4, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + init: null, + + range: [77, 100], + loc: { + start: { column: 4, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..0d38e059df5a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types reference-generic-nested Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Array", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Array", + + range: [86, 91], + loc: { + start: { column: 13, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [92, 98], + loc: { + start: { column: 19, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..7a6abfb9236f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types reference-generic-nested AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..c604f0b4d958 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,122 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types reference-generic-nested AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Array', + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Array', + + range: [86, 91], + loc: { + start: { column: 13, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [92, 98], + loc: { + start: { column: 19, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/fixture.ts new file mode 100644 index 000000000000..03789a1a73af --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let x: Array; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..02e66cecda88 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types reference-generic TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Array", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [86, 92], + loc: { + start: { column: 13, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ], + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [80, 93], + loc: { + start: { column: 7, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [78, 93], + loc: { + start: { column: 5, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [77, 93], + loc: { + start: { column: 4, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + init: null, + + range: [77, 93], + loc: { + start: { column: 4, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..451b6d485a97 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types reference-generic TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Array", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [86, 92], + loc: { + start: { column: 13, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..59216b0b5247 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/3-Babel-AST.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types reference-generic Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Array", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [86, 92], + loc: { + start: { column: 13, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ], + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [80, 93], + loc: { + start: { column: 7, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [78, 93], + loc: { + start: { column: 5, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [77, 93], + loc: { + start: { column: 4, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + init: null, + + range: [77, 93], + loc: { + start: { column: 4, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..4bed44ed4ada --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types reference-generic Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Array", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [86, 92], + loc: { + start: { column: 13, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..5653a047406e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types reference-generic AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..33fdec2de7fd --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,92 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types reference-generic AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Array', + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [86, 92], + loc: { + start: { column: 13, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/fixture.ts new file mode 100644 index 000000000000..2f6a39764023 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let x: T; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..110f172a2dce --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types reference TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [77, 81], + loc: { + start: { column: 4, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + init: null, + + range: [77, 81], + loc: { + start: { column: 4, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 83], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..9046bcd3bfd5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types reference TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..e5f62293830d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/3-Babel-AST.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types reference Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + + range: [77, 81], + loc: { + start: { column: 4, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + init: null, + + range: [77, 81], + loc: { + start: { column: 4, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 82], + loc: { + start: { column: 0, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 83], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..b684fa05a5ce --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types reference Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..c396b9e2ddb6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types reference AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..111a34fc7406 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,62 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types reference AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/fixture.ts new file mode 100644 index 000000000000..8cfd3dfbb9ce --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type T = `foo`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..638e7a32809b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,70 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-1 TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "T", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + typeAnnotation: TSLiteralType { + type: "TSLiteralType", + literal: TemplateLiteral { + type: "TemplateLiteral", + expressions: Array [], + quasis: Array [ + TemplateElement { + type: "TemplateElement", + tail: true, + value: Object { + "cooked": "foo", + "raw": "foo", + }, + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ], + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [73, 88], + loc: { + start: { column: 0, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 89], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..962595ac5169 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-1 TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Template { + type: "Template", + value: "\`foo\`", + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..7f28f4324de9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/3-Babel-AST.shot @@ -0,0 +1,70 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-1 Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "T", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + typeAnnotation: TSLiteralType { + type: "TSLiteralType", + literal: TemplateLiteral { + type: "TemplateLiteral", + expressions: Array [], + quasis: Array [ + TemplateElement { + type: "TemplateElement", + tail: true, + value: Object { + "cooked": "foo", + "raw": "foo", + }, + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ], + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [73, 88], + loc: { + start: { column: 0, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 89], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..84a55c2ccc8f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-1 Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Template { + type: "Template", + value: "\`foo\`", + + range: [82, 87], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..e85a5a9b7bf2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-1 AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..f8981bc53621 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-1 AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/fixture.ts new file mode 100644 index 000000000000..0048c59f7185 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type T = `foo${'bar'}`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..7e76c7e53fa4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-2 TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "T", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + typeAnnotation: TSTemplateLiteralType { + type: "TSTemplateLiteralType", + quasis: Array [ + TemplateElement { + type: "TemplateElement", + tail: false, + value: Object { + "cooked": "foo", + "raw": "foo", + }, + + range: [82, 88], + loc: { + start: { column: 9, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + TemplateElement { + type: "TemplateElement", + tail: true, + value: Object { + "cooked": "", + "raw": "", + }, + + range: [93, 95], + loc: { + start: { column: 20, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + types: Array [ + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "'bar'", + value: "bar", + + range: [88, 93], + loc: { + start: { column: 15, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [88, 93], + loc: { + start: { column: 15, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + + range: [82, 95], + loc: { + start: { column: 9, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [73, 96], + loc: { + start: { column: 0, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 97], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..8604d3a8f064 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-2 TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Template { + type: "Template", + value: "\`foo\${", + + range: [82, 88], + loc: { + start: { column: 9, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + String { + type: "String", + value: "'bar'", + + range: [88, 93], + loc: { + start: { column: 15, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Template { + type: "Template", + value: "}\`", + + range: [93, 95], + loc: { + start: { column: 20, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..a1836bdc130e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/3-Babel-AST.shot @@ -0,0 +1,105 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-2 Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "T", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + typeAnnotation: TSLiteralType { + type: "TSLiteralType", + literal: TemplateLiteral { + type: "TemplateLiteral", + expressions: Array [ + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "'bar'", + value: "bar", + + range: [88, 93], + loc: { + start: { column: 15, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [88, 93], + loc: { + start: { column: 15, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + quasis: Array [ + TemplateElement { + type: "TemplateElement", + tail: false, + value: Object { + "cooked": "foo", + "raw": "foo", + }, + + range: [82, 88], + loc: { + start: { column: 9, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + TemplateElement { + type: "TemplateElement", + tail: true, + value: Object { + "cooked": "", + "raw": "", + }, + + range: [93, 95], + loc: { + start: { column: 20, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + + range: [82, 95], + loc: { + start: { column: 9, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [82, 95], + loc: { + start: { column: 9, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [73, 96], + loc: { + start: { column: 0, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 97], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..a6c90f6770e1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-2 Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Template { + type: "Template", + value: "\`foo\${", + + range: [82, 88], + loc: { + start: { column: 9, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + String { + type: "String", + value: "'bar'", + + range: [88, 93], + loc: { + start: { column: 15, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Template { + type: "Template", + value: "}\`", + + range: [93, 95], + loc: { + start: { column: 20, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..70a2fe689f31 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,152 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-2 AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'T', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, +- typeAnnotation: TSTemplateLiteralType { +- type: 'TSTemplateLiteralType', +- quasis: Array [ +- TemplateElement { +- type: 'TemplateElement', +- tail: false, +- value: Object { +- 'cooked': 'foo', +- 'raw': 'foo', +- }, ++ typeAnnotation: TSLiteralType { ++ type: 'TSLiteralType', ++ literal: TemplateLiteral { ++ type: 'TemplateLiteral', ++ expressions: Array [ ++ TSLiteralType { ++ type: 'TSLiteralType', ++ literal: Literal { ++ type: 'Literal', ++ raw: '\\\\'bar\\\\'', ++ value: 'bar', + +- range: [82, 88], +- loc: { +- start: { column: 9, line: 3 }, +- end: { column: 15, line: 3 }, +- }, +- }, +- TemplateElement { +- type: 'TemplateElement', +- tail: true, +- value: Object { +- 'cooked': '', +- 'raw': '', +- }, ++ range: [88, 93], ++ loc: { ++ start: { column: 15, line: 3 }, ++ end: { column: 20, line: 3 }, ++ }, ++ }, + +- range: [93, 95], +- loc: { +- start: { column: 20, line: 3 }, +- end: { column: 22, line: 3 }, +- }, +- }, +- ], +- types: Array [ +- TSLiteralType { +- type: 'TSLiteralType', +- literal: Literal { +- type: 'Literal', +- raw: '\\\\'bar\\\\'', +- value: 'bar', +- + range: [88, 93], + loc: { + start: { column: 15, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, ++ ], ++ quasis: Array [ ++ TemplateElement { ++ type: 'TemplateElement', ++ tail: false, ++ value: Object { ++ 'cooked': 'foo', ++ 'raw': 'foo', ++ }, + +- range: [88, 93], +- loc: { +- start: { column: 15, line: 3 }, +- end: { column: 20, line: 3 }, ++ range: [82, 88], ++ loc: { ++ start: { column: 9, line: 3 }, ++ end: { column: 15, line: 3 }, ++ }, ++ }, ++ TemplateElement { ++ type: 'TemplateElement', ++ tail: true, ++ value: Object { ++ 'cooked': '', ++ 'raw': '', ++ }, ++ ++ range: [93, 95], ++ loc: { ++ start: { column: 20, line: 3 }, ++ end: { column: 22, line: 3 }, ++ }, + }, ++ ], ++ ++ range: [82, 95], ++ loc: { ++ start: { column: 9, line: 3 }, ++ end: { column: 22, line: 3 }, + }, +- ], ++ }, + + range: [82, 95], + loc: { + start: { column: 9, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [73, 96], + loc: { + start: { column: 0, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 97], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..61609dd71382 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-2 AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/fixture.ts new file mode 100644 index 000000000000..c09925934646 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Color = 'red' | 'blue'; +type Quantity = 'one' | 'two'; +type SeussFish = `${Quantity | Color} fish`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..4e5a39bfc464 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,265 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-3 TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Color", + + range: [78, 83], + loc: { + start: { column: 5, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "'red'", + value: "red", + + range: [86, 91], + loc: { + start: { column: 13, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [86, 91], + loc: { + start: { column: 13, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "'blue'", + value: "blue", + + range: [94, 100], + loc: { + start: { column: 21, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [94, 100], + loc: { + start: { column: 21, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + + range: [86, 100], + loc: { + start: { column: 13, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Quantity", + + range: [107, 115], + loc: { + start: { column: 5, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "'one'", + value: "one", + + range: [118, 123], + loc: { + start: { column: 16, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [118, 123], + loc: { + start: { column: 16, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "'two'", + value: "two", + + range: [126, 131], + loc: { + start: { column: 24, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + + range: [126, 131], + loc: { + start: { column: 24, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + ], + + range: [118, 131], + loc: { + start: { column: 16, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + + range: [102, 132], + loc: { + start: { column: 0, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "SeussFish", + + range: [138, 147], + loc: { + start: { column: 5, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + typeAnnotation: TSTemplateLiteralType { + type: "TSTemplateLiteralType", + quasis: Array [ + TemplateElement { + type: "TemplateElement", + tail: false, + value: Object { + "cooked": "", + "raw": "", + }, + + range: [150, 153], + loc: { + start: { column: 17, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + TemplateElement { + type: "TemplateElement", + tail: true, + value: Object { + "cooked": " fish", + "raw": " fish", + }, + + range: [169, 176], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + ], + types: Array [ + TSUnionType { + type: "TSUnionType", + types: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Quantity", + + range: [153, 161], + loc: { + start: { column: 20, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + + range: [153, 161], + loc: { + start: { column: 20, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Color", + + range: [164, 169], + loc: { + start: { column: 31, line: 5 }, + end: { column: 36, line: 5 }, + }, + }, + + range: [164, 169], + loc: { + start: { column: 31, line: 5 }, + end: { column: 36, line: 5 }, + }, + }, + ], + + range: [153, 169], + loc: { + start: { column: 20, line: 5 }, + end: { column: 36, line: 5 }, + }, + }, + ], + + range: [150, 176], + loc: { + start: { column: 17, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + + range: [133, 177], + loc: { + start: { column: 0, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 178], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..3030f7915ba1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,236 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-3 TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Color", + + range: [78, 83], + loc: { + start: { column: 5, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + String { + type: "String", + value: "'red'", + + range: [86, 91], + loc: { + start: { column: 13, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + String { + type: "String", + value: "'blue'", + + range: [94, 100], + loc: { + start: { column: 21, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [102, 106], + loc: { + start: { column: 0, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Quantity", + + range: [107, 115], + loc: { + start: { column: 5, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [116, 117], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + String { + type: "String", + value: "'one'", + + range: [118, 123], + loc: { + start: { column: 16, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [124, 125], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + String { + type: "String", + value: "'two'", + + range: [126, 131], + loc: { + start: { column: 24, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [131, 132], + loc: { + start: { column: 29, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [133, 137], + loc: { + start: { column: 0, line: 5 }, + end: { column: 4, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "SeussFish", + + range: [138, 147], + loc: { + start: { column: 5, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [148, 149], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Template { + type: "Template", + value: "\`\${", + + range: [150, 153], + loc: { + start: { column: 17, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "Quantity", + + range: [153, 161], + loc: { + start: { column: 20, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [162, 163], + loc: { + start: { column: 29, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "Color", + + range: [164, 169], + loc: { + start: { column: 31, line: 5 }, + end: { column: 36, line: 5 }, + }, + }, + Template { + type: "Template", + value: "} fish\`", + + range: [169, 176], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [176, 177], + loc: { + start: { column: 43, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..e20c38e5fa98 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/3-Babel-AST.shot @@ -0,0 +1,274 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-3 Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Color", + + range: [78, 83], + loc: { + start: { column: 5, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "'red'", + value: "red", + + range: [86, 91], + loc: { + start: { column: 13, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [86, 91], + loc: { + start: { column: 13, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "'blue'", + value: "blue", + + range: [94, 100], + loc: { + start: { column: 21, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [94, 100], + loc: { + start: { column: 21, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + + range: [86, 100], + loc: { + start: { column: 13, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Quantity", + + range: [107, 115], + loc: { + start: { column: 5, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "'one'", + value: "one", + + range: [118, 123], + loc: { + start: { column: 16, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [118, 123], + loc: { + start: { column: 16, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "'two'", + value: "two", + + range: [126, 131], + loc: { + start: { column: 24, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + + range: [126, 131], + loc: { + start: { column: 24, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + ], + + range: [118, 131], + loc: { + start: { column: 16, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + + range: [102, 132], + loc: { + start: { column: 0, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "SeussFish", + + range: [138, 147], + loc: { + start: { column: 5, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + typeAnnotation: TSLiteralType { + type: "TSLiteralType", + literal: TemplateLiteral { + type: "TemplateLiteral", + expressions: Array [ + TSUnionType { + type: "TSUnionType", + types: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Quantity", + + range: [153, 161], + loc: { + start: { column: 20, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + + range: [153, 161], + loc: { + start: { column: 20, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Color", + + range: [164, 169], + loc: { + start: { column: 31, line: 5 }, + end: { column: 36, line: 5 }, + }, + }, + + range: [164, 169], + loc: { + start: { column: 31, line: 5 }, + end: { column: 36, line: 5 }, + }, + }, + ], + + range: [153, 169], + loc: { + start: { column: 20, line: 5 }, + end: { column: 36, line: 5 }, + }, + }, + ], + quasis: Array [ + TemplateElement { + type: "TemplateElement", + tail: false, + value: Object { + "cooked": "", + "raw": "", + }, + + range: [150, 153], + loc: { + start: { column: 17, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + TemplateElement { + type: "TemplateElement", + tail: true, + value: Object { + "cooked": " fish", + "raw": " fish", + }, + + range: [169, 176], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + ], + + range: [150, 176], + loc: { + start: { column: 17, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + + range: [150, 176], + loc: { + start: { column: 17, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + + range: [133, 177], + loc: { + start: { column: 0, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 178], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..33a769b7a254 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,236 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-3 Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Color", + + range: [78, 83], + loc: { + start: { column: 5, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + String { + type: "String", + value: "'red'", + + range: [86, 91], + loc: { + start: { column: 13, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + String { + type: "String", + value: "'blue'", + + range: [94, 100], + loc: { + start: { column: 21, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [102, 106], + loc: { + start: { column: 0, line: 4 }, + end: { column: 4, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Quantity", + + range: [107, 115], + loc: { + start: { column: 5, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [116, 117], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + String { + type: "String", + value: "'one'", + + range: [118, 123], + loc: { + start: { column: 16, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [124, 125], + loc: { + start: { column: 22, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + String { + type: "String", + value: "'two'", + + range: [126, 131], + loc: { + start: { column: 24, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [131, 132], + loc: { + start: { column: 29, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [133, 137], + loc: { + start: { column: 0, line: 5 }, + end: { column: 4, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "SeussFish", + + range: [138, 147], + loc: { + start: { column: 5, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [148, 149], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Template { + type: "Template", + value: "\`\${", + + range: [150, 153], + loc: { + start: { column: 17, line: 5 }, + end: { column: 20, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "Quantity", + + range: [153, 161], + loc: { + start: { column: 20, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [162, 163], + loc: { + start: { column: 29, line: 5 }, + end: { column: 30, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "Color", + + range: [164, 169], + loc: { + start: { column: 31, line: 5 }, + end: { column: 36, line: 5 }, + }, + }, + Template { + type: "Template", + value: "} fish\`", + + range: [169, 176], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [176, 177], + loc: { + start: { column: 43, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..948340c0664c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,340 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-3 AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'Color', + + range: [78, 83], + loc: { + start: { column: 5, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + typeAnnotation: TSUnionType { + type: 'TSUnionType', + types: Array [ + TSLiteralType { + type: 'TSLiteralType', + literal: Literal { + type: 'Literal', + raw: '\\\\'red\\\\'', + value: 'red', + + range: [86, 91], + loc: { + start: { column: 13, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + + range: [86, 91], + loc: { + start: { column: 13, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + TSLiteralType { + type: 'TSLiteralType', + literal: Literal { + type: 'Literal', + raw: '\\\\'blue\\\\'', + value: 'blue', + + range: [94, 100], + loc: { + start: { column: 21, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [94, 100], + loc: { + start: { column: 21, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + + range: [86, 100], + loc: { + start: { column: 13, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'Quantity', + + range: [107, 115], + loc: { + start: { column: 5, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + typeAnnotation: TSUnionType { + type: 'TSUnionType', + types: Array [ + TSLiteralType { + type: 'TSLiteralType', + literal: Literal { + type: 'Literal', + raw: '\\\\'one\\\\'', + value: 'one', + + range: [118, 123], + loc: { + start: { column: 16, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + + range: [118, 123], + loc: { + start: { column: 16, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + TSLiteralType { + type: 'TSLiteralType', + literal: Literal { + type: 'Literal', + raw: '\\\\'two\\\\'', + value: 'two', + + range: [126, 131], + loc: { + start: { column: 24, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + + range: [126, 131], + loc: { + start: { column: 24, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + ], + + range: [118, 131], + loc: { + start: { column: 16, line: 4 }, + end: { column: 29, line: 4 }, + }, + }, + + range: [102, 132], + loc: { + start: { column: 0, line: 4 }, + end: { column: 30, line: 4 }, + }, + }, + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'SeussFish', + + range: [138, 147], + loc: { + start: { column: 5, line: 5 }, + end: { column: 14, line: 5 }, + }, + }, +- typeAnnotation: TSTemplateLiteralType { +- type: 'TSTemplateLiteralType', +- quasis: Array [ +- TemplateElement { +- type: 'TemplateElement', +- tail: false, +- value: Object { +- 'cooked': '', +- 'raw': '', +- }, ++ typeAnnotation: TSLiteralType { ++ type: 'TSLiteralType', ++ literal: TemplateLiteral { ++ type: 'TemplateLiteral', ++ expressions: Array [ ++ TSUnionType { ++ type: 'TSUnionType', ++ types: Array [ ++ TSTypeReference { ++ type: 'TSTypeReference', ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Quantity', + +- range: [150, 153], +- loc: { +- start: { column: 17, line: 5 }, +- end: { column: 20, line: 5 }, +- }, +- }, +- TemplateElement { +- type: 'TemplateElement', +- tail: true, +- value: Object { +- 'cooked': ' fish', +- 'raw': ' fish', +- }, +- +- range: [169, 176], +- loc: { +- start: { column: 36, line: 5 }, +- end: { column: 43, line: 5 }, +- }, +- }, +- ], +- types: Array [ +- TSUnionType { +- type: 'TSUnionType', +- types: Array [ +- TSTypeReference { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- name: 'Quantity', ++ range: [153, 161], ++ loc: { ++ start: { column: 20, line: 5 }, ++ end: { column: 28, line: 5 }, ++ }, ++ }, + + range: [153, 161], + loc: { + start: { column: 20, line: 5 }, + end: { column: 28, line: 5 }, + }, + }, ++ TSTypeReference { ++ type: 'TSTypeReference', ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Color', + +- range: [153, 161], +- loc: { +- start: { column: 20, line: 5 }, +- end: { column: 28, line: 5 }, +- }, +- }, +- TSTypeReference { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- name: 'Color', ++ range: [164, 169], ++ loc: { ++ start: { column: 31, line: 5 }, ++ end: { column: 36, line: 5 }, ++ }, ++ }, + + range: [164, 169], + loc: { + start: { column: 31, line: 5 }, + end: { column: 36, line: 5 }, + }, + }, ++ ], + +- range: [164, 169], +- loc: { +- start: { column: 31, line: 5 }, +- end: { column: 36, line: 5 }, +- }, ++ range: [153, 169], ++ loc: { ++ start: { column: 20, line: 5 }, ++ end: { column: 36, line: 5 }, + }, +- ], ++ }, ++ ], ++ quasis: Array [ ++ TemplateElement { ++ type: 'TemplateElement', ++ tail: false, ++ value: Object { ++ 'cooked': '', ++ 'raw': '', ++ }, + +- range: [153, 169], +- loc: { +- start: { column: 20, line: 5 }, +- end: { column: 36, line: 5 }, ++ range: [150, 153], ++ loc: { ++ start: { column: 17, line: 5 }, ++ end: { column: 20, line: 5 }, ++ }, ++ }, ++ TemplateElement { ++ type: 'TemplateElement', ++ tail: true, ++ value: Object { ++ 'cooked': ' fish', ++ 'raw': ' fish', ++ }, ++ ++ range: [169, 176], ++ loc: { ++ start: { column: 36, line: 5 }, ++ end: { column: 43, line: 5 }, ++ }, + }, ++ ], ++ ++ range: [150, 176], ++ loc: { ++ start: { column: 17, line: 5 }, ++ end: { column: 43, line: 5 }, + }, +- ], ++ }, + + range: [150, 176], + loc: { + start: { column: 17, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + + range: [133, 177], + loc: { + start: { column: 0, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 178], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..9adb33090a31 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-3 AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/fixture.ts new file mode 100644 index 000000000000..1f2c30bee13f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/fixture.ts @@ -0,0 +1,5 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type EnthusiasticGreeting = + `${Uppercase} - ${Lowercase} - ${Capitalize} - ${Uncapitalize}`; +type HELLO = EnthusiasticGreeting<'heLLo'>; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..1b9878d79b7a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,424 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-4 TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "EnthusiasticGreeting", + + range: [78, 98], + loc: { + start: { column: 5, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + typeAnnotation: TSTemplateLiteralType { + type: "TSTemplateLiteralType", + quasis: Array [ + TemplateElement { + type: "TemplateElement", + tail: false, + value: Object { + "cooked": "", + "raw": "", + }, + + range: [121, 124], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + TemplateElement { + type: "TemplateElement", + tail: false, + value: Object { + "cooked": " - ", + "raw": " - ", + }, + + range: [136, 142], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + TemplateElement { + type: "TemplateElement", + tail: false, + value: Object { + "cooked": " - ", + "raw": " - ", + }, + + range: [154, 160], + loc: { + start: { column: 35, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + TemplateElement { + type: "TemplateElement", + tail: false, + value: Object { + "cooked": " - ", + "raw": " - ", + }, + + range: [173, 179], + loc: { + start: { column: 54, line: 4 }, + end: { column: 60, line: 4 }, + }, + }, + TemplateElement { + type: "TemplateElement", + tail: true, + value: Object { + "cooked": "", + "raw": "", + }, + + range: [194, 196], + loc: { + start: { column: 75, line: 4 }, + end: { column: 77, line: 4 }, + }, + }, + ], + types: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Uppercase", + + range: [124, 133], + loc: { + start: { column: 5, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [134, 135], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [134, 135], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + ], + + range: [133, 136], + loc: { + start: { column: 14, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + + range: [124, 136], + loc: { + start: { column: 5, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Lowercase", + + range: [142, 151], + loc: { + start: { column: 23, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [152, 153], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [152, 153], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + ], + + range: [151, 154], + loc: { + start: { column: 32, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + + range: [142, 154], + loc: { + start: { column: 23, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Capitalize", + + range: [160, 170], + loc: { + start: { column: 41, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [171, 172], + loc: { + start: { column: 52, line: 4 }, + end: { column: 53, line: 4 }, + }, + }, + + range: [171, 172], + loc: { + start: { column: 52, line: 4 }, + end: { column: 53, line: 4 }, + }, + }, + ], + + range: [170, 173], + loc: { + start: { column: 51, line: 4 }, + end: { column: 54, line: 4 }, + }, + }, + + range: [160, 173], + loc: { + start: { column: 41, line: 4 }, + end: { column: 54, line: 4 }, + }, + }, + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Uncapitalize", + + range: [179, 191], + loc: { + start: { column: 60, line: 4 }, + end: { column: 72, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [192, 193], + loc: { + start: { column: 73, line: 4 }, + end: { column: 74, line: 4 }, + }, + }, + + range: [192, 193], + loc: { + start: { column: 73, line: 4 }, + end: { column: 74, line: 4 }, + }, + }, + ], + + range: [191, 194], + loc: { + start: { column: 72, line: 4 }, + end: { column: 75, line: 4 }, + }, + }, + + range: [179, 194], + loc: { + start: { column: 60, line: 4 }, + end: { column: 75, line: 4 }, + }, + }, + ], + + range: [121, 196], + loc: { + start: { column: 2, line: 4 }, + end: { column: 77, line: 4 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + constraint: TSStringKeyword { + type: "TSStringKeyword", + + range: [109, 115], + loc: { + start: { column: 36, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + out: false, + + range: [99, 115], + loc: { + start: { column: 26, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + ], + + range: [98, 116], + loc: { + start: { column: 25, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + + range: [73, 197], + loc: { + start: { column: 0, line: 3 }, + end: { column: 78, line: 4 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "HELLO", + + range: [203, 208], + loc: { + start: { column: 5, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "EnthusiasticGreeting", + + range: [211, 231], + loc: { + start: { column: 13, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "'heLLo'", + value: "heLLo", + + range: [232, 239], + loc: { + start: { column: 34, line: 5 }, + end: { column: 41, line: 5 }, + }, + }, + + range: [232, 239], + loc: { + start: { column: 34, line: 5 }, + end: { column: 41, line: 5 }, + }, + }, + ], + + range: [231, 240], + loc: { + start: { column: 33, line: 5 }, + end: { column: 42, line: 5 }, + }, + }, + + range: [211, 240], + loc: { + start: { column: 13, line: 5 }, + end: { column: 42, line: 5 }, + }, + }, + + range: [198, 241], + loc: { + start: { column: 0, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 242], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..7c82d85d7273 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,386 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-4 TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "EnthusiasticGreeting", + + range: [78, 98], + loc: { + start: { column: 5, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [101, 108], + loc: { + start: { column: 28, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [109, 115], + loc: { + start: { column: 36, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Template { + type: "Template", + value: "\`\${", + + range: [121, 124], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Uppercase", + + range: [124, 133], + loc: { + start: { column: 5, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [133, 134], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [134, 135], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [135, 136], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Template { + type: "Template", + value: "} - \${", + + range: [136, 142], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Lowercase", + + range: [142, 151], + loc: { + start: { column: 23, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [151, 152], + loc: { + start: { column: 32, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [152, 153], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [153, 154], + loc: { + start: { column: 34, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Template { + type: "Template", + value: "} - \${", + + range: [154, 160], + loc: { + start: { column: 35, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Capitalize", + + range: [160, 170], + loc: { + start: { column: 41, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [170, 171], + loc: { + start: { column: 51, line: 4 }, + end: { column: 52, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [171, 172], + loc: { + start: { column: 52, line: 4 }, + end: { column: 53, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [172, 173], + loc: { + start: { column: 53, line: 4 }, + end: { column: 54, line: 4 }, + }, + }, + Template { + type: "Template", + value: "} - \${", + + range: [173, 179], + loc: { + start: { column: 54, line: 4 }, + end: { column: 60, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Uncapitalize", + + range: [179, 191], + loc: { + start: { column: 60, line: 4 }, + end: { column: 72, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [191, 192], + loc: { + start: { column: 72, line: 4 }, + end: { column: 73, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [192, 193], + loc: { + start: { column: 73, line: 4 }, + end: { column: 74, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [193, 194], + loc: { + start: { column: 74, line: 4 }, + end: { column: 75, line: 4 }, + }, + }, + Template { + type: "Template", + value: "}\`", + + range: [194, 196], + loc: { + start: { column: 75, line: 4 }, + end: { column: 77, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [196, 197], + loc: { + start: { column: 77, line: 4 }, + end: { column: 78, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [198, 202], + loc: { + start: { column: 0, line: 5 }, + end: { column: 4, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "HELLO", + + range: [203, 208], + loc: { + start: { column: 5, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [209, 210], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "EnthusiasticGreeting", + + range: [211, 231], + loc: { + start: { column: 13, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [231, 232], + loc: { + start: { column: 33, line: 5 }, + end: { column: 34, line: 5 }, + }, + }, + String { + type: "String", + value: "'heLLo'", + + range: [232, 239], + loc: { + start: { column: 34, line: 5 }, + end: { column: 41, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [239, 240], + loc: { + start: { column: 41, line: 5 }, + end: { column: 42, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [240, 241], + loc: { + start: { column: 42, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..ddb20d7d10f3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/3-Babel-AST.shot @@ -0,0 +1,422 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-4 Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "EnthusiasticGreeting", + + range: [78, 98], + loc: { + start: { column: 5, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + typeAnnotation: TSLiteralType { + type: "TSLiteralType", + literal: TemplateLiteral { + type: "TemplateLiteral", + expressions: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Uppercase", + + range: [124, 133], + loc: { + start: { column: 5, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [134, 135], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + + range: [134, 135], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + ], + + range: [133, 136], + loc: { + start: { column: 14, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + + range: [124, 136], + loc: { + start: { column: 5, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Lowercase", + + range: [142, 151], + loc: { + start: { column: 23, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [152, 153], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + + range: [152, 153], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + ], + + range: [151, 154], + loc: { + start: { column: 32, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + + range: [142, 154], + loc: { + start: { column: 23, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Capitalize", + + range: [160, 170], + loc: { + start: { column: 41, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [171, 172], + loc: { + start: { column: 52, line: 4 }, + end: { column: 53, line: 4 }, + }, + }, + + range: [171, 172], + loc: { + start: { column: 52, line: 4 }, + end: { column: 53, line: 4 }, + }, + }, + ], + + range: [170, 173], + loc: { + start: { column: 51, line: 4 }, + end: { column: 54, line: 4 }, + }, + }, + + range: [160, 173], + loc: { + start: { column: 41, line: 4 }, + end: { column: 54, line: 4 }, + }, + }, + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "Uncapitalize", + + range: [179, 191], + loc: { + start: { column: 60, line: 4 }, + end: { column: 72, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [192, 193], + loc: { + start: { column: 73, line: 4 }, + end: { column: 74, line: 4 }, + }, + }, + + range: [192, 193], + loc: { + start: { column: 73, line: 4 }, + end: { column: 74, line: 4 }, + }, + }, + ], + + range: [191, 194], + loc: { + start: { column: 72, line: 4 }, + end: { column: 75, line: 4 }, + }, + }, + + range: [179, 194], + loc: { + start: { column: 60, line: 4 }, + end: { column: 75, line: 4 }, + }, + }, + ], + quasis: Array [ + TemplateElement { + type: "TemplateElement", + tail: false, + value: Object { + "cooked": "", + "raw": "", + }, + + range: [121, 124], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + TemplateElement { + type: "TemplateElement", + tail: false, + value: Object { + "cooked": " - ", + "raw": " - ", + }, + + range: [136, 142], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + TemplateElement { + type: "TemplateElement", + tail: false, + value: Object { + "cooked": " - ", + "raw": " - ", + }, + + range: [154, 160], + loc: { + start: { column: 35, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + TemplateElement { + type: "TemplateElement", + tail: false, + value: Object { + "cooked": " - ", + "raw": " - ", + }, + + range: [173, 179], + loc: { + start: { column: 54, line: 4 }, + end: { column: 60, line: 4 }, + }, + }, + TemplateElement { + type: "TemplateElement", + tail: true, + value: Object { + "cooked": "", + "raw": "", + }, + + range: [194, 196], + loc: { + start: { column: 75, line: 4 }, + end: { column: 77, line: 4 }, + }, + }, + ], + + range: [121, 196], + loc: { + start: { column: 2, line: 4 }, + end: { column: 77, line: 4 }, + }, + }, + + range: [121, 196], + loc: { + start: { column: 2, line: 4 }, + end: { column: 77, line: 4 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + constraint: TSStringKeyword { + type: "TSStringKeyword", + + range: [109, 115], + loc: { + start: { column: 36, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + name: "T", + + range: [99, 115], + loc: { + start: { column: 26, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + ], + + range: [98, 116], + loc: { + start: { column: 25, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + + range: [73, 197], + loc: { + start: { column: 0, line: 3 }, + end: { column: 78, line: 4 }, + }, + }, + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "HELLO", + + range: [203, 208], + loc: { + start: { column: 5, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "EnthusiasticGreeting", + + range: [211, 231], + loc: { + start: { column: 13, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "'heLLo'", + value: "heLLo", + + range: [232, 239], + loc: { + start: { column: 34, line: 5 }, + end: { column: 41, line: 5 }, + }, + }, + + range: [232, 239], + loc: { + start: { column: 34, line: 5 }, + end: { column: 41, line: 5 }, + }, + }, + ], + + range: [231, 240], + loc: { + start: { column: 33, line: 5 }, + end: { column: 42, line: 5 }, + }, + }, + + range: [211, 240], + loc: { + start: { column: 13, line: 5 }, + end: { column: 42, line: 5 }, + }, + }, + + range: [198, 241], + loc: { + start: { column: 0, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [73, 242], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..24f5af2e86df --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,386 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-4 Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "EnthusiasticGreeting", + + range: [78, 98], + loc: { + start: { column: 5, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [101, 108], + loc: { + start: { column: 28, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [109, 115], + loc: { + start: { column: 36, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + Template { + type: "Template", + value: "\`\${", + + range: [121, 124], + loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Uppercase", + + range: [124, 133], + loc: { + start: { column: 5, line: 4 }, + end: { column: 14, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [133, 134], + loc: { + start: { column: 14, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [134, 135], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [135, 136], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Template { + type: "Template", + value: "} - \${", + + range: [136, 142], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Lowercase", + + range: [142, 151], + loc: { + start: { column: 23, line: 4 }, + end: { column: 32, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [151, 152], + loc: { + start: { column: 32, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [152, 153], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [153, 154], + loc: { + start: { column: 34, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, + Template { + type: "Template", + value: "} - \${", + + range: [154, 160], + loc: { + start: { column: 35, line: 4 }, + end: { column: 41, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Capitalize", + + range: [160, 170], + loc: { + start: { column: 41, line: 4 }, + end: { column: 51, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [170, 171], + loc: { + start: { column: 51, line: 4 }, + end: { column: 52, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [171, 172], + loc: { + start: { column: 52, line: 4 }, + end: { column: 53, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [172, 173], + loc: { + start: { column: 53, line: 4 }, + end: { column: 54, line: 4 }, + }, + }, + Template { + type: "Template", + value: "} - \${", + + range: [173, 179], + loc: { + start: { column: 54, line: 4 }, + end: { column: 60, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "Uncapitalize", + + range: [179, 191], + loc: { + start: { column: 60, line: 4 }, + end: { column: 72, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [191, 192], + loc: { + start: { column: 72, line: 4 }, + end: { column: 73, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [192, 193], + loc: { + start: { column: 73, line: 4 }, + end: { column: 74, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [193, 194], + loc: { + start: { column: 74, line: 4 }, + end: { column: 75, line: 4 }, + }, + }, + Template { + type: "Template", + value: "}\`", + + range: [194, 196], + loc: { + start: { column: 75, line: 4 }, + end: { column: 77, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [196, 197], + loc: { + start: { column: 77, line: 4 }, + end: { column: 78, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [198, 202], + loc: { + start: { column: 0, line: 5 }, + end: { column: 4, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "HELLO", + + range: [203, 208], + loc: { + start: { column: 5, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [209, 210], + loc: { + start: { column: 11, line: 5 }, + end: { column: 12, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "EnthusiasticGreeting", + + range: [211, 231], + loc: { + start: { column: 13, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [231, 232], + loc: { + start: { column: 33, line: 5 }, + end: { column: 34, line: 5 }, + }, + }, + String { + type: "String", + value: "'heLLo'", + + range: [232, 239], + loc: { + start: { column: 34, line: 5 }, + end: { column: 41, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [239, 240], + loc: { + start: { column: 41, line: 5 }, + end: { column: 42, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [240, 241], + loc: { + start: { column: 42, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..d6b807f6ded2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,643 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'EnthusiasticGreeting', + + range: [78, 98], + loc: { + start: { column: 5, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, +- typeAnnotation: TSTemplateLiteralType { +- type: 'TSTemplateLiteralType', +- quasis: Array [ +- TemplateElement { +- type: 'TemplateElement', +- tail: false, +- value: Object { +- 'cooked': '', +- 'raw': '', +- }, ++ typeAnnotation: TSLiteralType { ++ type: 'TSLiteralType', ++ literal: TemplateLiteral { ++ type: 'TemplateLiteral', ++ expressions: Array [ ++ TSTypeReference { ++ type: 'TSTypeReference', ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Uppercase', + +- range: [121, 124], +- loc: { +- start: { column: 2, line: 4 }, +- end: { column: 5, line: 4 }, +- }, +- }, +- TemplateElement { +- type: 'TemplateElement', +- tail: false, +- value: Object { +- 'cooked': ' - ', +- 'raw': ' - ', +- }, ++ range: [124, 133], ++ loc: { ++ start: { column: 5, line: 4 }, ++ end: { column: 14, line: 4 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { ++ type: 'TSTypeParameterInstantiation', ++ params: Array [ ++ TSTypeReference { ++ type: 'TSTypeReference', ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'T', + +- range: [136, 142], +- loc: { +- start: { column: 17, line: 4 }, +- end: { column: 23, line: 4 }, +- }, +- }, +- TemplateElement { +- type: 'TemplateElement', +- tail: false, +- value: Object { +- 'cooked': ' - ', +- 'raw': ' - ', +- }, +- +- range: [154, 160], +- loc: { +- start: { column: 35, line: 4 }, +- end: { column: 41, line: 4 }, +- }, +- }, +- TemplateElement { +- type: 'TemplateElement', +- tail: false, +- value: Object { +- 'cooked': ' - ', +- 'raw': ' - ', +- }, +- +- range: [173, 179], +- loc: { +- start: { column: 54, line: 4 }, +- end: { column: 60, line: 4 }, +- }, +- }, +- TemplateElement { +- type: 'TemplateElement', +- tail: true, +- value: Object { +- 'cooked': '', +- 'raw': '', +- }, +- +- range: [194, 196], +- loc: { +- start: { column: 75, line: 4 }, +- end: { column: 77, line: 4 }, +- }, +- }, +- ], +- types: Array [ +- TSTypeReference { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- name: 'Uppercase', +- +- range: [124, 133], +- loc: { +- start: { column: 5, line: 4 }, +- end: { column: 14, line: 4 }, +- }, +- }, +- typeParameters: TSTypeParameterInstantiation { +- type: 'TSTypeParameterInstantiation', +- params: Array [ +- TSTypeReference { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- name: 'T', ++ range: [134, 135], ++ loc: { ++ start: { column: 15, line: 4 }, ++ end: { column: 16, line: 4 }, ++ }, ++ }, + + range: [134, 135], + loc: { + start: { column: 15, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, ++ ], + +- range: [134, 135], +- loc: { +- start: { column: 15, line: 4 }, +- end: { column: 16, line: 4 }, +- }, ++ range: [133, 136], ++ loc: { ++ start: { column: 14, line: 4 }, ++ end: { column: 17, line: 4 }, + }, +- ], ++ }, + +- range: [133, 136], ++ range: [124, 136], + loc: { +- start: { column: 14, line: 4 }, ++ start: { column: 5, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, ++ TSTypeReference { ++ type: 'TSTypeReference', ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Lowercase', + +- range: [124, 136], +- loc: { +- start: { column: 5, line: 4 }, +- end: { column: 17, line: 4 }, +- }, +- }, +- TSTypeReference { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- name: 'Lowercase', +- +- range: [142, 151], +- loc: { +- start: { column: 23, line: 4 }, +- end: { column: 32, line: 4 }, ++ range: [142, 151], ++ loc: { ++ start: { column: 23, line: 4 }, ++ end: { column: 32, line: 4 }, ++ }, + }, +- }, +- typeParameters: TSTypeParameterInstantiation { +- type: 'TSTypeParameterInstantiation', +- params: Array [ +- TSTypeReference { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- name: 'T', ++ typeParameters: TSTypeParameterInstantiation { ++ type: 'TSTypeParameterInstantiation', ++ params: Array [ ++ TSTypeReference { ++ type: 'TSTypeReference', ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'T', ++ ++ range: [152, 153], ++ loc: { ++ start: { column: 33, line: 4 }, ++ end: { column: 34, line: 4 }, ++ }, ++ }, + + range: [152, 153], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, ++ ], + +- range: [152, 153], +- loc: { +- start: { column: 33, line: 4 }, +- end: { column: 34, line: 4 }, +- }, ++ range: [151, 154], ++ loc: { ++ start: { column: 32, line: 4 }, ++ end: { column: 35, line: 4 }, + }, +- ], ++ }, + +- range: [151, 154], ++ range: [142, 154], + loc: { +- start: { column: 32, line: 4 }, ++ start: { column: 23, line: 4 }, + end: { column: 35, line: 4 }, + }, + }, ++ TSTypeReference { ++ type: 'TSTypeReference', ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Capitalize', + +- range: [142, 154], +- loc: { +- start: { column: 23, line: 4 }, +- end: { column: 35, line: 4 }, +- }, +- }, +- TSTypeReference { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- name: 'Capitalize', ++ range: [160, 170], ++ loc: { ++ start: { column: 41, line: 4 }, ++ end: { column: 51, line: 4 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { ++ type: 'TSTypeParameterInstantiation', ++ params: Array [ ++ TSTypeReference { ++ type: 'TSTypeReference', ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'T', + +- range: [160, 170], +- loc: { +- start: { column: 41, line: 4 }, +- end: { column: 51, line: 4 }, +- }, +- }, +- typeParameters: TSTypeParameterInstantiation { +- type: 'TSTypeParameterInstantiation', +- params: Array [ +- TSTypeReference { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- name: 'T', ++ range: [171, 172], ++ loc: { ++ start: { column: 52, line: 4 }, ++ end: { column: 53, line: 4 }, ++ }, ++ }, + + range: [171, 172], + loc: { + start: { column: 52, line: 4 }, + end: { column: 53, line: 4 }, + }, + }, ++ ], + +- range: [171, 172], +- loc: { +- start: { column: 52, line: 4 }, +- end: { column: 53, line: 4 }, +- }, ++ range: [170, 173], ++ loc: { ++ start: { column: 51, line: 4 }, ++ end: { column: 54, line: 4 }, + }, +- ], ++ }, + +- range: [170, 173], ++ range: [160, 173], + loc: { +- start: { column: 51, line: 4 }, ++ start: { column: 41, line: 4 }, + end: { column: 54, line: 4 }, + }, + }, ++ TSTypeReference { ++ type: 'TSTypeReference', ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Uncapitalize', + +- range: [160, 173], +- loc: { +- start: { column: 41, line: 4 }, +- end: { column: 54, line: 4 }, +- }, +- }, +- TSTypeReference { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- name: 'Uncapitalize', ++ range: [179, 191], ++ loc: { ++ start: { column: 60, line: 4 }, ++ end: { column: 72, line: 4 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { ++ type: 'TSTypeParameterInstantiation', ++ params: Array [ ++ TSTypeReference { ++ type: 'TSTypeReference', ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'T', + +- range: [179, 191], +- loc: { +- start: { column: 60, line: 4 }, +- end: { column: 72, line: 4 }, +- }, +- }, +- typeParameters: TSTypeParameterInstantiation { +- type: 'TSTypeParameterInstantiation', +- params: Array [ +- TSTypeReference { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- name: 'T', ++ range: [192, 193], ++ loc: { ++ start: { column: 73, line: 4 }, ++ end: { column: 74, line: 4 }, ++ }, ++ }, + + range: [192, 193], + loc: { + start: { column: 73, line: 4 }, + end: { column: 74, line: 4 }, + }, + }, ++ ], + +- range: [192, 193], +- loc: { +- start: { column: 73, line: 4 }, +- end: { column: 74, line: 4 }, +- }, ++ range: [191, 194], ++ loc: { ++ start: { column: 72, line: 4 }, ++ end: { column: 75, line: 4 }, + }, +- ], ++ }, + +- range: [191, 194], ++ range: [179, 194], + loc: { +- start: { column: 72, line: 4 }, ++ start: { column: 60, line: 4 }, + end: { column: 75, line: 4 }, + }, + }, ++ ], ++ quasis: Array [ ++ TemplateElement { ++ type: 'TemplateElement', ++ tail: false, ++ value: Object { ++ 'cooked': '', ++ 'raw': '', ++ }, + +- range: [179, 194], +- loc: { +- start: { column: 60, line: 4 }, +- end: { column: 75, line: 4 }, ++ range: [121, 124], ++ loc: { ++ start: { column: 2, line: 4 }, ++ end: { column: 5, line: 4 }, ++ }, ++ }, ++ TemplateElement { ++ type: 'TemplateElement', ++ tail: false, ++ value: Object { ++ 'cooked': ' - ', ++ 'raw': ' - ', ++ }, ++ ++ range: [136, 142], ++ loc: { ++ start: { column: 17, line: 4 }, ++ end: { column: 23, line: 4 }, ++ }, ++ }, ++ TemplateElement { ++ type: 'TemplateElement', ++ tail: false, ++ value: Object { ++ 'cooked': ' - ', ++ 'raw': ' - ', ++ }, ++ ++ range: [154, 160], ++ loc: { ++ start: { column: 35, line: 4 }, ++ end: { column: 41, line: 4 }, ++ }, ++ }, ++ TemplateElement { ++ type: 'TemplateElement', ++ tail: false, ++ value: Object { ++ 'cooked': ' - ', ++ 'raw': ' - ', ++ }, ++ ++ range: [173, 179], ++ loc: { ++ start: { column: 54, line: 4 }, ++ end: { column: 60, line: 4 }, ++ }, ++ }, ++ TemplateElement { ++ type: 'TemplateElement', ++ tail: true, ++ value: Object { ++ 'cooked': '', ++ 'raw': '', ++ }, ++ ++ range: [194, 196], ++ loc: { ++ start: { column: 75, line: 4 }, ++ end: { column: 77, line: 4 }, ++ }, + }, ++ ], ++ ++ range: [121, 196], ++ loc: { ++ start: { column: 2, line: 4 }, ++ end: { column: 77, line: 4 }, + }, +- ], ++ }, + + range: [121, 196], + loc: { + start: { column: 2, line: 4 }, + end: { column: 77, line: 4 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + constraint: TSStringKeyword { + type: 'TSStringKeyword', + + range: [109, 115], + loc: { + start: { column: 36, line: 3 }, + end: { column: 42, line: 3 }, +- }, +- }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [99, 100], +- loc: { +- start: { column: 26, line: 3 }, +- end: { column: 27, line: 3 }, + }, + }, +- out: false, ++ name: 'T', + + range: [99, 115], + loc: { + start: { column: 26, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + ], + + range: [98, 116], + loc: { + start: { column: 25, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + + range: [73, 197], + loc: { + start: { column: 0, line: 3 }, + end: { column: 78, line: 4 }, + }, + }, + TSTypeAliasDeclaration { + type: 'TSTypeAliasDeclaration', + id: Identifier { + type: 'Identifier', + name: 'HELLO', + + range: [203, 208], + loc: { + start: { column: 5, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'EnthusiasticGreeting', + + range: [211, 231], + loc: { + start: { column: 13, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSLiteralType { + type: 'TSLiteralType', + literal: Literal { + type: 'Literal', + raw: '\\\\'heLLo\\\\'', + value: 'heLLo', + + range: [232, 239], + loc: { + start: { column: 34, line: 5 }, + end: { column: 41, line: 5 }, + }, + }, + + range: [232, 239], + loc: { + start: { column: 34, line: 5 }, + end: { column: 41, line: 5 }, + }, + }, + ], + + range: [231, 240], + loc: { + start: { column: 33, line: 5 }, + end: { column: 42, line: 5 }, + }, + }, + + range: [211, 240], + loc: { + start: { column: 13, line: 5 }, + end: { column: 42, line: 5 }, + }, + }, + + range: [198, 241], + loc: { + start: { column: 0, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 242], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..4ebf872b5042 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/fixture.ts new file mode 100644 index 000000000000..6454e7b18245 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/fixture.ts @@ -0,0 +1,31 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class A { + public a: number; + + public method(this: this): number { + return this.a; + } + + public method2(this: A): this { + return this.a; + } + + public method3(this: this): number { + var fn = () => this.a; + return fn(); + } + + public method4(this: A): number { + var fn = () => this.a; + return fn(); + } + + static staticMethod(this: A): number { + return this.a; + } + + static typeof(this: A): this { + return typeof this; + } +} diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..59345cea548d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,1060 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types this-type-expanded TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + accessibility: "public", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "a", + + range: [92, 93], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [95, 101], + loc: { + start: { column: 12, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [93, 101], + loc: { + start: { column: 10, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + value: null, + + range: [85, 102], + loc: { + start: { column: 2, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + accessibility: "public", + computed: false, + key: Identifier { + type: "Identifier", + name: "method", + + range: [113, 119], + loc: { + start: { column: 9, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [153, 157], + loc: { + start: { column: 11, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "a", + + range: [158, 159], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + + range: [153, 159], + loc: { + start: { column: 11, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + + range: [146, 160], + loc: { + start: { column: 4, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + ], + + range: [140, 164], + loc: { + start: { column: 36, line: 6 }, + end: { column: 3, line: 8 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "this", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSThisType { + type: "TSThisType", + + range: [126, 130], + loc: { + start: { column: 22, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + + range: [124, 130], + loc: { + start: { column: 20, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + + range: [120, 130], + loc: { + start: { column: 16, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [133, 139], + loc: { + start: { column: 29, line: 6 }, + end: { column: 35, line: 6 }, + }, + }, + + range: [131, 139], + loc: { + start: { column: 27, line: 6 }, + end: { column: 35, line: 6 }, + }, + }, + + range: [119, 164], + loc: { + start: { column: 15, line: 6 }, + end: { column: 3, line: 8 }, + }, + }, + + range: [106, 164], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 8 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + accessibility: "public", + computed: false, + key: Identifier { + type: "Identifier", + name: "method2", + + range: [175, 182], + loc: { + start: { column: 9, line: 10 }, + end: { column: 16, line: 10 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [211, 215], + loc: { + start: { column: 11, line: 11 }, + end: { column: 15, line: 11 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "a", + + range: [216, 217], + loc: { + start: { column: 16, line: 11 }, + end: { column: 17, line: 11 }, + }, + }, + + range: [211, 217], + loc: { + start: { column: 11, line: 11 }, + end: { column: 17, line: 11 }, + }, + }, + + range: [204, 218], + loc: { + start: { column: 4, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + ], + + range: [198, 222], + loc: { + start: { column: 32, line: 10 }, + end: { column: 3, line: 12 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "this", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [189, 190], + loc: { + start: { column: 23, line: 10 }, + end: { column: 24, line: 10 }, + }, + }, + + range: [189, 190], + loc: { + start: { column: 23, line: 10 }, + end: { column: 24, line: 10 }, + }, + }, + + range: [187, 190], + loc: { + start: { column: 21, line: 10 }, + end: { column: 24, line: 10 }, + }, + }, + + range: [183, 190], + loc: { + start: { column: 17, line: 10 }, + end: { column: 24, line: 10 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSThisType { + type: "TSThisType", + + range: [193, 197], + loc: { + start: { column: 27, line: 10 }, + end: { column: 31, line: 10 }, + }, + }, + + range: [191, 197], + loc: { + start: { column: 25, line: 10 }, + end: { column: 31, line: 10 }, + }, + }, + + range: [182, 222], + loc: { + start: { column: 16, line: 10 }, + end: { column: 3, line: 12 }, + }, + }, + + range: [168, 222], + loc: { + start: { column: 2, line: 10 }, + end: { column: 3, line: 12 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + accessibility: "public", + computed: false, + key: Identifier { + type: "Identifier", + name: "method3", + + range: [233, 240], + loc: { + start: { column: 9, line: 14 }, + end: { column: 16, line: 14 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "fn", + + range: [271, 273], + loc: { + start: { column: 8, line: 15 }, + end: { column: 10, line: 15 }, + }, + }, + init: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [282, 286], + loc: { + start: { column: 19, line: 15 }, + end: { column: 23, line: 15 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "a", + + range: [287, 288], + loc: { + start: { column: 24, line: 15 }, + end: { column: 25, line: 15 }, + }, + }, + + range: [282, 288], + loc: { + start: { column: 19, line: 15 }, + end: { column: 25, line: 15 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [], + + range: [276, 288], + loc: { + start: { column: 13, line: 15 }, + end: { column: 25, line: 15 }, + }, + }, + + range: [271, 288], + loc: { + start: { column: 8, line: 15 }, + end: { column: 25, line: 15 }, + }, + }, + ], + kind: "var", + + range: [267, 289], + loc: { + start: { column: 4, line: 15 }, + end: { column: 26, line: 15 }, + }, + }, + ReturnStatement { + type: "ReturnStatement", + argument: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "fn", + + range: [301, 303], + loc: { + start: { column: 11, line: 16 }, + end: { column: 13, line: 16 }, + }, + }, + optional: false, + + range: [301, 305], + loc: { + start: { column: 11, line: 16 }, + end: { column: 15, line: 16 }, + }, + }, + + range: [294, 306], + loc: { + start: { column: 4, line: 16 }, + end: { column: 16, line: 16 }, + }, + }, + ], + + range: [261, 310], + loc: { + start: { column: 37, line: 14 }, + end: { column: 3, line: 17 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "this", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSThisType { + type: "TSThisType", + + range: [247, 251], + loc: { + start: { column: 23, line: 14 }, + end: { column: 27, line: 14 }, + }, + }, + + range: [245, 251], + loc: { + start: { column: 21, line: 14 }, + end: { column: 27, line: 14 }, + }, + }, + + range: [241, 251], + loc: { + start: { column: 17, line: 14 }, + end: { column: 27, line: 14 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [254, 260], + loc: { + start: { column: 30, line: 14 }, + end: { column: 36, line: 14 }, + }, + }, + + range: [252, 260], + loc: { + start: { column: 28, line: 14 }, + end: { column: 36, line: 14 }, + }, + }, + + range: [240, 310], + loc: { + start: { column: 16, line: 14 }, + end: { column: 3, line: 17 }, + }, + }, + + range: [226, 310], + loc: { + start: { column: 2, line: 14 }, + end: { column: 3, line: 17 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + accessibility: "public", + computed: false, + key: Identifier { + type: "Identifier", + name: "method4", + + range: [321, 328], + loc: { + start: { column: 9, line: 19 }, + end: { column: 16, line: 19 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "fn", + + range: [356, 358], + loc: { + start: { column: 8, line: 20 }, + end: { column: 10, line: 20 }, + }, + }, + init: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [367, 371], + loc: { + start: { column: 19, line: 20 }, + end: { column: 23, line: 20 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "a", + + range: [372, 373], + loc: { + start: { column: 24, line: 20 }, + end: { column: 25, line: 20 }, + }, + }, + + range: [367, 373], + loc: { + start: { column: 19, line: 20 }, + end: { column: 25, line: 20 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [], + + range: [361, 373], + loc: { + start: { column: 13, line: 20 }, + end: { column: 25, line: 20 }, + }, + }, + + range: [356, 373], + loc: { + start: { column: 8, line: 20 }, + end: { column: 25, line: 20 }, + }, + }, + ], + kind: "var", + + range: [352, 374], + loc: { + start: { column: 4, line: 20 }, + end: { column: 26, line: 20 }, + }, + }, + ReturnStatement { + type: "ReturnStatement", + argument: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "fn", + + range: [386, 388], + loc: { + start: { column: 11, line: 21 }, + end: { column: 13, line: 21 }, + }, + }, + optional: false, + + range: [386, 390], + loc: { + start: { column: 11, line: 21 }, + end: { column: 15, line: 21 }, + }, + }, + + range: [379, 391], + loc: { + start: { column: 4, line: 21 }, + end: { column: 16, line: 21 }, + }, + }, + ], + + range: [346, 395], + loc: { + start: { column: 34, line: 19 }, + end: { column: 3, line: 22 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "this", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [335, 336], + loc: { + start: { column: 23, line: 19 }, + end: { column: 24, line: 19 }, + }, + }, + + range: [335, 336], + loc: { + start: { column: 23, line: 19 }, + end: { column: 24, line: 19 }, + }, + }, + + range: [333, 336], + loc: { + start: { column: 21, line: 19 }, + end: { column: 24, line: 19 }, + }, + }, + + range: [329, 336], + loc: { + start: { column: 17, line: 19 }, + end: { column: 24, line: 19 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [339, 345], + loc: { + start: { column: 27, line: 19 }, + end: { column: 33, line: 19 }, + }, + }, + + range: [337, 345], + loc: { + start: { column: 25, line: 19 }, + end: { column: 33, line: 19 }, + }, + }, + + range: [328, 395], + loc: { + start: { column: 16, line: 19 }, + end: { column: 3, line: 22 }, + }, + }, + + range: [314, 395], + loc: { + start: { column: 2, line: 19 }, + end: { column: 3, line: 22 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "staticMethod", + + range: [406, 418], + loc: { + start: { column: 9, line: 24 }, + end: { column: 21, line: 24 }, + }, + }, + kind: "method", + override: false, + static: true, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [449, 453], + loc: { + start: { column: 11, line: 25 }, + end: { column: 15, line: 25 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "a", + + range: [454, 455], + loc: { + start: { column: 16, line: 25 }, + end: { column: 17, line: 25 }, + }, + }, + + range: [449, 455], + loc: { + start: { column: 11, line: 25 }, + end: { column: 17, line: 25 }, + }, + }, + + range: [442, 456], + loc: { + start: { column: 4, line: 25 }, + end: { column: 18, line: 25 }, + }, + }, + ], + + range: [436, 460], + loc: { + start: { column: 39, line: 24 }, + end: { column: 3, line: 26 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "this", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [425, 426], + loc: { + start: { column: 28, line: 24 }, + end: { column: 29, line: 24 }, + }, + }, + + range: [425, 426], + loc: { + start: { column: 28, line: 24 }, + end: { column: 29, line: 24 }, + }, + }, + + range: [423, 426], + loc: { + start: { column: 26, line: 24 }, + end: { column: 29, line: 24 }, + }, + }, + + range: [419, 426], + loc: { + start: { column: 22, line: 24 }, + end: { column: 29, line: 24 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [429, 435], + loc: { + start: { column: 32, line: 24 }, + end: { column: 38, line: 24 }, + }, + }, + + range: [427, 435], + loc: { + start: { column: 30, line: 24 }, + end: { column: 38, line: 24 }, + }, + }, + + range: [418, 460], + loc: { + start: { column: 21, line: 24 }, + end: { column: 3, line: 26 }, + }, + }, + + range: [399, 460], + loc: { + start: { column: 2, line: 24 }, + end: { column: 3, line: 26 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "typeof", + + range: [471, 477], + loc: { + start: { column: 9, line: 28 }, + end: { column: 15, line: 28 }, + }, + }, + kind: "method", + override: false, + static: true, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: UnaryExpression { + type: "UnaryExpression", + argument: ThisExpression { + type: "ThisExpression", + + range: [513, 517], + loc: { + start: { column: 18, line: 29 }, + end: { column: 22, line: 29 }, + }, + }, + operator: "typeof", + prefix: true, + + range: [506, 517], + loc: { + start: { column: 11, line: 29 }, + end: { column: 22, line: 29 }, + }, + }, + + range: [499, 518], + loc: { + start: { column: 4, line: 29 }, + end: { column: 23, line: 29 }, + }, + }, + ], + + range: [493, 522], + loc: { + start: { column: 31, line: 28 }, + end: { column: 3, line: 30 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "this", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [484, 485], + loc: { + start: { column: 22, line: 28 }, + end: { column: 23, line: 28 }, + }, + }, + + range: [484, 485], + loc: { + start: { column: 22, line: 28 }, + end: { column: 23, line: 28 }, + }, + }, + + range: [482, 485], + loc: { + start: { column: 20, line: 28 }, + end: { column: 23, line: 28 }, + }, + }, + + range: [478, 485], + loc: { + start: { column: 16, line: 28 }, + end: { column: 23, line: 28 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSThisType { + type: "TSThisType", + + range: [488, 492], + loc: { + start: { column: 26, line: 28 }, + end: { column: 30, line: 28 }, + }, + }, + + range: [486, 492], + loc: { + start: { column: 24, line: 28 }, + end: { column: 30, line: 28 }, + }, + }, + + range: [477, 522], + loc: { + start: { column: 15, line: 28 }, + end: { column: 3, line: 30 }, + }, + }, + + range: [464, 522], + loc: { + start: { column: 2, line: 28 }, + end: { column: 3, line: 30 }, + }, + }, + ], + + range: [81, 524], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 31 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "A", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 524], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 31 }, + }, + }, + ], + sourceType: "script", + + range: [73, 525], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 32 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..aefe853b6dc5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,1246 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types this-type-expanded TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [85, 91], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [92, 93], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [93, 94], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [95, 101], + loc: { + start: { column: 12, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [101, 102], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [106, 112], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "method", + + range: [113, 119], + loc: { + start: { column: 9, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [119, 120], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [120, 124], + loc: { + start: { column: 16, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [124, 125], + loc: { + start: { column: 20, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [126, 130], + loc: { + start: { column: 22, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [130, 131], + loc: { + start: { column: 26, line: 6 }, + end: { column: 27, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [131, 132], + loc: { + start: { column: 27, line: 6 }, + end: { column: 28, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [133, 139], + loc: { + start: { column: 29, line: 6 }, + end: { column: 35, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [140, 141], + loc: { + start: { column: 36, line: 6 }, + end: { column: 37, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [146, 152], + loc: { + start: { column: 4, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [153, 157], + loc: { + start: { column: 11, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [157, 158], + loc: { + start: { column: 15, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [158, 159], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [159, 160], + loc: { + start: { column: 17, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [163, 164], + loc: { + start: { column: 2, line: 8 }, + end: { column: 3, line: 8 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [168, 174], + loc: { + start: { column: 2, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "method2", + + range: [175, 182], + loc: { + start: { column: 9, line: 10 }, + end: { column: 16, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [182, 183], + loc: { + start: { column: 16, line: 10 }, + end: { column: 17, line: 10 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [183, 187], + loc: { + start: { column: 17, line: 10 }, + end: { column: 21, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [187, 188], + loc: { + start: { column: 21, line: 10 }, + end: { column: 22, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [189, 190], + loc: { + start: { column: 23, line: 10 }, + end: { column: 24, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [190, 191], + loc: { + start: { column: 24, line: 10 }, + end: { column: 25, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [191, 192], + loc: { + start: { column: 25, line: 10 }, + end: { column: 26, line: 10 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [193, 197], + loc: { + start: { column: 27, line: 10 }, + end: { column: 31, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [198, 199], + loc: { + start: { column: 32, line: 10 }, + end: { column: 33, line: 10 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [204, 210], + loc: { + start: { column: 4, line: 11 }, + end: { column: 10, line: 11 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [211, 215], + loc: { + start: { column: 11, line: 11 }, + end: { column: 15, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [215, 216], + loc: { + start: { column: 15, line: 11 }, + end: { column: 16, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [216, 217], + loc: { + start: { column: 16, line: 11 }, + end: { column: 17, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [217, 218], + loc: { + start: { column: 17, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [221, 222], + loc: { + start: { column: 2, line: 12 }, + end: { column: 3, line: 12 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [226, 232], + loc: { + start: { column: 2, line: 14 }, + end: { column: 8, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "method3", + + range: [233, 240], + loc: { + start: { column: 9, line: 14 }, + end: { column: 16, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [240, 241], + loc: { + start: { column: 16, line: 14 }, + end: { column: 17, line: 14 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [241, 245], + loc: { + start: { column: 17, line: 14 }, + end: { column: 21, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [245, 246], + loc: { + start: { column: 21, line: 14 }, + end: { column: 22, line: 14 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [247, 251], + loc: { + start: { column: 23, line: 14 }, + end: { column: 27, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [251, 252], + loc: { + start: { column: 27, line: 14 }, + end: { column: 28, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [252, 253], + loc: { + start: { column: 28, line: 14 }, + end: { column: 29, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [254, 260], + loc: { + start: { column: 30, line: 14 }, + end: { column: 36, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [261, 262], + loc: { + start: { column: 37, line: 14 }, + end: { column: 38, line: 14 }, + }, + }, + Keyword { + type: "Keyword", + value: "var", + + range: [267, 270], + loc: { + start: { column: 4, line: 15 }, + end: { column: 7, line: 15 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [271, 273], + loc: { + start: { column: 8, line: 15 }, + end: { column: 10, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [274, 275], + loc: { + start: { column: 11, line: 15 }, + end: { column: 12, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [276, 277], + loc: { + start: { column: 13, line: 15 }, + end: { column: 14, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [277, 278], + loc: { + start: { column: 14, line: 15 }, + end: { column: 15, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [279, 281], + loc: { + start: { column: 16, line: 15 }, + end: { column: 18, line: 15 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [282, 286], + loc: { + start: { column: 19, line: 15 }, + end: { column: 23, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [286, 287], + loc: { + start: { column: 23, line: 15 }, + end: { column: 24, line: 15 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [287, 288], + loc: { + start: { column: 24, line: 15 }, + end: { column: 25, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [288, 289], + loc: { + start: { column: 25, line: 15 }, + end: { column: 26, line: 15 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [294, 300], + loc: { + start: { column: 4, line: 16 }, + end: { column: 10, line: 16 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [301, 303], + loc: { + start: { column: 11, line: 16 }, + end: { column: 13, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [303, 304], + loc: { + start: { column: 13, line: 16 }, + end: { column: 14, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [304, 305], + loc: { + start: { column: 14, line: 16 }, + end: { column: 15, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [305, 306], + loc: { + start: { column: 15, line: 16 }, + end: { column: 16, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [309, 310], + loc: { + start: { column: 2, line: 17 }, + end: { column: 3, line: 17 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [314, 320], + loc: { + start: { column: 2, line: 19 }, + end: { column: 8, line: 19 }, + }, + }, + Identifier { + type: "Identifier", + value: "method4", + + range: [321, 328], + loc: { + start: { column: 9, line: 19 }, + end: { column: 16, line: 19 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [328, 329], + loc: { + start: { column: 16, line: 19 }, + end: { column: 17, line: 19 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [329, 333], + loc: { + start: { column: 17, line: 19 }, + end: { column: 21, line: 19 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [333, 334], + loc: { + start: { column: 21, line: 19 }, + end: { column: 22, line: 19 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [335, 336], + loc: { + start: { column: 23, line: 19 }, + end: { column: 24, line: 19 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [336, 337], + loc: { + start: { column: 24, line: 19 }, + end: { column: 25, line: 19 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [337, 338], + loc: { + start: { column: 25, line: 19 }, + end: { column: 26, line: 19 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [339, 345], + loc: { + start: { column: 27, line: 19 }, + end: { column: 33, line: 19 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [346, 347], + loc: { + start: { column: 34, line: 19 }, + end: { column: 35, line: 19 }, + }, + }, + Keyword { + type: "Keyword", + value: "var", + + range: [352, 355], + loc: { + start: { column: 4, line: 20 }, + end: { column: 7, line: 20 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [356, 358], + loc: { + start: { column: 8, line: 20 }, + end: { column: 10, line: 20 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [359, 360], + loc: { + start: { column: 11, line: 20 }, + end: { column: 12, line: 20 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [361, 362], + loc: { + start: { column: 13, line: 20 }, + end: { column: 14, line: 20 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [362, 363], + loc: { + start: { column: 14, line: 20 }, + end: { column: 15, line: 20 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [364, 366], + loc: { + start: { column: 16, line: 20 }, + end: { column: 18, line: 20 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [367, 371], + loc: { + start: { column: 19, line: 20 }, + end: { column: 23, line: 20 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [371, 372], + loc: { + start: { column: 23, line: 20 }, + end: { column: 24, line: 20 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [372, 373], + loc: { + start: { column: 24, line: 20 }, + end: { column: 25, line: 20 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [373, 374], + loc: { + start: { column: 25, line: 20 }, + end: { column: 26, line: 20 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [379, 385], + loc: { + start: { column: 4, line: 21 }, + end: { column: 10, line: 21 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [386, 388], + loc: { + start: { column: 11, line: 21 }, + end: { column: 13, line: 21 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [388, 389], + loc: { + start: { column: 13, line: 21 }, + end: { column: 14, line: 21 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [389, 390], + loc: { + start: { column: 14, line: 21 }, + end: { column: 15, line: 21 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [390, 391], + loc: { + start: { column: 15, line: 21 }, + end: { column: 16, line: 21 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [394, 395], + loc: { + start: { column: 2, line: 22 }, + end: { column: 3, line: 22 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [399, 405], + loc: { + start: { column: 2, line: 24 }, + end: { column: 8, line: 24 }, + }, + }, + Identifier { + type: "Identifier", + value: "staticMethod", + + range: [406, 418], + loc: { + start: { column: 9, line: 24 }, + end: { column: 21, line: 24 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [418, 419], + loc: { + start: { column: 21, line: 24 }, + end: { column: 22, line: 24 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [419, 423], + loc: { + start: { column: 22, line: 24 }, + end: { column: 26, line: 24 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [423, 424], + loc: { + start: { column: 26, line: 24 }, + end: { column: 27, line: 24 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [425, 426], + loc: { + start: { column: 28, line: 24 }, + end: { column: 29, line: 24 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [426, 427], + loc: { + start: { column: 29, line: 24 }, + end: { column: 30, line: 24 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [427, 428], + loc: { + start: { column: 30, line: 24 }, + end: { column: 31, line: 24 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [429, 435], + loc: { + start: { column: 32, line: 24 }, + end: { column: 38, line: 24 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [436, 437], + loc: { + start: { column: 39, line: 24 }, + end: { column: 40, line: 24 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [442, 448], + loc: { + start: { column: 4, line: 25 }, + end: { column: 10, line: 25 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [449, 453], + loc: { + start: { column: 11, line: 25 }, + end: { column: 15, line: 25 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [453, 454], + loc: { + start: { column: 15, line: 25 }, + end: { column: 16, line: 25 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [454, 455], + loc: { + start: { column: 16, line: 25 }, + end: { column: 17, line: 25 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [455, 456], + loc: { + start: { column: 17, line: 25 }, + end: { column: 18, line: 25 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [459, 460], + loc: { + start: { column: 2, line: 26 }, + end: { column: 3, line: 26 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [464, 470], + loc: { + start: { column: 2, line: 28 }, + end: { column: 8, line: 28 }, + }, + }, + Keyword { + type: "Keyword", + value: "typeof", + + range: [471, 477], + loc: { + start: { column: 9, line: 28 }, + end: { column: 15, line: 28 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [477, 478], + loc: { + start: { column: 15, line: 28 }, + end: { column: 16, line: 28 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [478, 482], + loc: { + start: { column: 16, line: 28 }, + end: { column: 20, line: 28 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [482, 483], + loc: { + start: { column: 20, line: 28 }, + end: { column: 21, line: 28 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [484, 485], + loc: { + start: { column: 22, line: 28 }, + end: { column: 23, line: 28 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [485, 486], + loc: { + start: { column: 23, line: 28 }, + end: { column: 24, line: 28 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [486, 487], + loc: { + start: { column: 24, line: 28 }, + end: { column: 25, line: 28 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [488, 492], + loc: { + start: { column: 26, line: 28 }, + end: { column: 30, line: 28 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [493, 494], + loc: { + start: { column: 31, line: 28 }, + end: { column: 32, line: 28 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [499, 505], + loc: { + start: { column: 4, line: 29 }, + end: { column: 10, line: 29 }, + }, + }, + Keyword { + type: "Keyword", + value: "typeof", + + range: [506, 512], + loc: { + start: { column: 11, line: 29 }, + end: { column: 17, line: 29 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [513, 517], + loc: { + start: { column: 18, line: 29 }, + end: { column: 22, line: 29 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [517, 518], + loc: { + start: { column: 22, line: 29 }, + end: { column: 23, line: 29 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [521, 522], + loc: { + start: { column: 2, line: 30 }, + end: { column: 3, line: 30 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [523, 524], + loc: { + start: { column: 0, line: 31 }, + end: { column: 1, line: 31 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..5b5628189f62 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/3-Babel-AST.shot @@ -0,0 +1,1052 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types this-type-expanded Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + PropertyDefinition { + type: "PropertyDefinition", + accessibility: "public", + computed: false, + key: Identifier { + type: "Identifier", + name: "a", + + range: [92, 93], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [95, 101], + loc: { + start: { column: 12, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [93, 101], + loc: { + start: { column: 10, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + value: null, + + range: [85, 102], + loc: { + start: { column: 2, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + accessibility: "public", + computed: false, + key: Identifier { + type: "Identifier", + name: "method", + + range: [113, 119], + loc: { + start: { column: 9, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [153, 157], + loc: { + start: { column: 11, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "a", + + range: [158, 159], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + + range: [153, 159], + loc: { + start: { column: 11, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + + range: [146, 160], + loc: { + start: { column: 4, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + ], + + range: [140, 164], + loc: { + start: { column: 36, line: 6 }, + end: { column: 3, line: 8 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "this", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSThisType { + type: "TSThisType", + + range: [126, 130], + loc: { + start: { column: 22, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + + range: [124, 130], + loc: { + start: { column: 20, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + + range: [120, 130], + loc: { + start: { column: 16, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [133, 139], + loc: { + start: { column: 29, line: 6 }, + end: { column: 35, line: 6 }, + }, + }, + + range: [131, 139], + loc: { + start: { column: 27, line: 6 }, + end: { column: 35, line: 6 }, + }, + }, + + range: [119, 164], + loc: { + start: { column: 15, line: 6 }, + end: { column: 3, line: 8 }, + }, + }, + + range: [106, 164], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 8 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + accessibility: "public", + computed: false, + key: Identifier { + type: "Identifier", + name: "method2", + + range: [175, 182], + loc: { + start: { column: 9, line: 10 }, + end: { column: 16, line: 10 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [211, 215], + loc: { + start: { column: 11, line: 11 }, + end: { column: 15, line: 11 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "a", + + range: [216, 217], + loc: { + start: { column: 16, line: 11 }, + end: { column: 17, line: 11 }, + }, + }, + + range: [211, 217], + loc: { + start: { column: 11, line: 11 }, + end: { column: 17, line: 11 }, + }, + }, + + range: [204, 218], + loc: { + start: { column: 4, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + ], + + range: [198, 222], + loc: { + start: { column: 32, line: 10 }, + end: { column: 3, line: 12 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "this", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [189, 190], + loc: { + start: { column: 23, line: 10 }, + end: { column: 24, line: 10 }, + }, + }, + + range: [189, 190], + loc: { + start: { column: 23, line: 10 }, + end: { column: 24, line: 10 }, + }, + }, + + range: [187, 190], + loc: { + start: { column: 21, line: 10 }, + end: { column: 24, line: 10 }, + }, + }, + + range: [183, 190], + loc: { + start: { column: 17, line: 10 }, + end: { column: 24, line: 10 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSThisType { + type: "TSThisType", + + range: [193, 197], + loc: { + start: { column: 27, line: 10 }, + end: { column: 31, line: 10 }, + }, + }, + + range: [191, 197], + loc: { + start: { column: 25, line: 10 }, + end: { column: 31, line: 10 }, + }, + }, + + range: [182, 222], + loc: { + start: { column: 16, line: 10 }, + end: { column: 3, line: 12 }, + }, + }, + + range: [168, 222], + loc: { + start: { column: 2, line: 10 }, + end: { column: 3, line: 12 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + accessibility: "public", + computed: false, + key: Identifier { + type: "Identifier", + name: "method3", + + range: [233, 240], + loc: { + start: { column: 9, line: 14 }, + end: { column: 16, line: 14 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "fn", + + range: [271, 273], + loc: { + start: { column: 8, line: 15 }, + end: { column: 10, line: 15 }, + }, + }, + init: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [282, 286], + loc: { + start: { column: 19, line: 15 }, + end: { column: 23, line: 15 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "a", + + range: [287, 288], + loc: { + start: { column: 24, line: 15 }, + end: { column: 25, line: 15 }, + }, + }, + + range: [282, 288], + loc: { + start: { column: 19, line: 15 }, + end: { column: 25, line: 15 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [], + + range: [276, 288], + loc: { + start: { column: 13, line: 15 }, + end: { column: 25, line: 15 }, + }, + }, + + range: [271, 288], + loc: { + start: { column: 8, line: 15 }, + end: { column: 25, line: 15 }, + }, + }, + ], + kind: "var", + + range: [267, 289], + loc: { + start: { column: 4, line: 15 }, + end: { column: 26, line: 15 }, + }, + }, + ReturnStatement { + type: "ReturnStatement", + argument: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "fn", + + range: [301, 303], + loc: { + start: { column: 11, line: 16 }, + end: { column: 13, line: 16 }, + }, + }, + optional: false, + + range: [301, 305], + loc: { + start: { column: 11, line: 16 }, + end: { column: 15, line: 16 }, + }, + }, + + range: [294, 306], + loc: { + start: { column: 4, line: 16 }, + end: { column: 16, line: 16 }, + }, + }, + ], + + range: [261, 310], + loc: { + start: { column: 37, line: 14 }, + end: { column: 3, line: 17 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "this", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSThisType { + type: "TSThisType", + + range: [247, 251], + loc: { + start: { column: 23, line: 14 }, + end: { column: 27, line: 14 }, + }, + }, + + range: [245, 251], + loc: { + start: { column: 21, line: 14 }, + end: { column: 27, line: 14 }, + }, + }, + + range: [241, 251], + loc: { + start: { column: 17, line: 14 }, + end: { column: 27, line: 14 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [254, 260], + loc: { + start: { column: 30, line: 14 }, + end: { column: 36, line: 14 }, + }, + }, + + range: [252, 260], + loc: { + start: { column: 28, line: 14 }, + end: { column: 36, line: 14 }, + }, + }, + + range: [240, 310], + loc: { + start: { column: 16, line: 14 }, + end: { column: 3, line: 17 }, + }, + }, + + range: [226, 310], + loc: { + start: { column: 2, line: 14 }, + end: { column: 3, line: 17 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + accessibility: "public", + computed: false, + key: Identifier { + type: "Identifier", + name: "method4", + + range: [321, 328], + loc: { + start: { column: 9, line: 19 }, + end: { column: 16, line: 19 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "fn", + + range: [356, 358], + loc: { + start: { column: 8, line: 20 }, + end: { column: 10, line: 20 }, + }, + }, + init: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [367, 371], + loc: { + start: { column: 19, line: 20 }, + end: { column: 23, line: 20 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "a", + + range: [372, 373], + loc: { + start: { column: 24, line: 20 }, + end: { column: 25, line: 20 }, + }, + }, + + range: [367, 373], + loc: { + start: { column: 19, line: 20 }, + end: { column: 25, line: 20 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [], + + range: [361, 373], + loc: { + start: { column: 13, line: 20 }, + end: { column: 25, line: 20 }, + }, + }, + + range: [356, 373], + loc: { + start: { column: 8, line: 20 }, + end: { column: 25, line: 20 }, + }, + }, + ], + kind: "var", + + range: [352, 374], + loc: { + start: { column: 4, line: 20 }, + end: { column: 26, line: 20 }, + }, + }, + ReturnStatement { + type: "ReturnStatement", + argument: CallExpression { + type: "CallExpression", + arguments: Array [], + callee: Identifier { + type: "Identifier", + name: "fn", + + range: [386, 388], + loc: { + start: { column: 11, line: 21 }, + end: { column: 13, line: 21 }, + }, + }, + optional: false, + + range: [386, 390], + loc: { + start: { column: 11, line: 21 }, + end: { column: 15, line: 21 }, + }, + }, + + range: [379, 391], + loc: { + start: { column: 4, line: 21 }, + end: { column: 16, line: 21 }, + }, + }, + ], + + range: [346, 395], + loc: { + start: { column: 34, line: 19 }, + end: { column: 3, line: 22 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "this", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [335, 336], + loc: { + start: { column: 23, line: 19 }, + end: { column: 24, line: 19 }, + }, + }, + + range: [335, 336], + loc: { + start: { column: 23, line: 19 }, + end: { column: 24, line: 19 }, + }, + }, + + range: [333, 336], + loc: { + start: { column: 21, line: 19 }, + end: { column: 24, line: 19 }, + }, + }, + + range: [329, 336], + loc: { + start: { column: 17, line: 19 }, + end: { column: 24, line: 19 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [339, 345], + loc: { + start: { column: 27, line: 19 }, + end: { column: 33, line: 19 }, + }, + }, + + range: [337, 345], + loc: { + start: { column: 25, line: 19 }, + end: { column: 33, line: 19 }, + }, + }, + + range: [328, 395], + loc: { + start: { column: 16, line: 19 }, + end: { column: 3, line: 22 }, + }, + }, + + range: [314, 395], + loc: { + start: { column: 2, line: 19 }, + end: { column: 3, line: 22 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "staticMethod", + + range: [406, 418], + loc: { + start: { column: 9, line: 24 }, + end: { column: 21, line: 24 }, + }, + }, + kind: "method", + static: true, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: MemberExpression { + type: "MemberExpression", + computed: false, + object: ThisExpression { + type: "ThisExpression", + + range: [449, 453], + loc: { + start: { column: 11, line: 25 }, + end: { column: 15, line: 25 }, + }, + }, + optional: false, + property: Identifier { + type: "Identifier", + name: "a", + + range: [454, 455], + loc: { + start: { column: 16, line: 25 }, + end: { column: 17, line: 25 }, + }, + }, + + range: [449, 455], + loc: { + start: { column: 11, line: 25 }, + end: { column: 17, line: 25 }, + }, + }, + + range: [442, 456], + loc: { + start: { column: 4, line: 25 }, + end: { column: 18, line: 25 }, + }, + }, + ], + + range: [436, 460], + loc: { + start: { column: 39, line: 24 }, + end: { column: 3, line: 26 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "this", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [425, 426], + loc: { + start: { column: 28, line: 24 }, + end: { column: 29, line: 24 }, + }, + }, + + range: [425, 426], + loc: { + start: { column: 28, line: 24 }, + end: { column: 29, line: 24 }, + }, + }, + + range: [423, 426], + loc: { + start: { column: 26, line: 24 }, + end: { column: 29, line: 24 }, + }, + }, + + range: [419, 426], + loc: { + start: { column: 22, line: 24 }, + end: { column: 29, line: 24 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [429, 435], + loc: { + start: { column: 32, line: 24 }, + end: { column: 38, line: 24 }, + }, + }, + + range: [427, 435], + loc: { + start: { column: 30, line: 24 }, + end: { column: 38, line: 24 }, + }, + }, + + range: [418, 460], + loc: { + start: { column: 21, line: 24 }, + end: { column: 3, line: 26 }, + }, + }, + + range: [399, 460], + loc: { + start: { column: 2, line: 24 }, + end: { column: 3, line: 26 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "typeof", + + range: [471, 477], + loc: { + start: { column: 9, line: 28 }, + end: { column: 15, line: 28 }, + }, + }, + kind: "method", + static: true, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: UnaryExpression { + type: "UnaryExpression", + argument: ThisExpression { + type: "ThisExpression", + + range: [513, 517], + loc: { + start: { column: 18, line: 29 }, + end: { column: 22, line: 29 }, + }, + }, + operator: "typeof", + prefix: true, + + range: [506, 517], + loc: { + start: { column: 11, line: 29 }, + end: { column: 22, line: 29 }, + }, + }, + + range: [499, 518], + loc: { + start: { column: 4, line: 29 }, + end: { column: 23, line: 29 }, + }, + }, + ], + + range: [493, 522], + loc: { + start: { column: 31, line: 28 }, + end: { column: 3, line: 30 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: "Identifier", + name: "this", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "A", + + range: [484, 485], + loc: { + start: { column: 22, line: 28 }, + end: { column: 23, line: 28 }, + }, + }, + + range: [484, 485], + loc: { + start: { column: 22, line: 28 }, + end: { column: 23, line: 28 }, + }, + }, + + range: [482, 485], + loc: { + start: { column: 20, line: 28 }, + end: { column: 23, line: 28 }, + }, + }, + + range: [478, 485], + loc: { + start: { column: 16, line: 28 }, + end: { column: 23, line: 28 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSThisType { + type: "TSThisType", + + range: [488, 492], + loc: { + start: { column: 26, line: 28 }, + end: { column: 30, line: 28 }, + }, + }, + + range: [486, 492], + loc: { + start: { column: 24, line: 28 }, + end: { column: 30, line: 28 }, + }, + }, + + range: [477, 522], + loc: { + start: { column: 15, line: 28 }, + end: { column: 3, line: 30 }, + }, + }, + + range: [464, 522], + loc: { + start: { column: 2, line: 28 }, + end: { column: 3, line: 30 }, + }, + }, + ], + + range: [81, 524], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 31 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "A", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 524], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 31 }, + }, + }, + ], + sourceType: "script", + + range: [73, 525], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 32 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..603d715b520c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,1246 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types this-type-expanded Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [85, 91], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [92, 93], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [93, 94], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [95, 101], + loc: { + start: { column: 12, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [101, 102], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [106, 112], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "method", + + range: [113, 119], + loc: { + start: { column: 9, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [119, 120], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "this", + + range: [120, 124], + loc: { + start: { column: 16, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [124, 125], + loc: { + start: { column: 20, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [126, 130], + loc: { + start: { column: 22, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [130, 131], + loc: { + start: { column: 26, line: 6 }, + end: { column: 27, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [131, 132], + loc: { + start: { column: 27, line: 6 }, + end: { column: 28, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [133, 139], + loc: { + start: { column: 29, line: 6 }, + end: { column: 35, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [140, 141], + loc: { + start: { column: 36, line: 6 }, + end: { column: 37, line: 6 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [146, 152], + loc: { + start: { column: 4, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [153, 157], + loc: { + start: { column: 11, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [157, 158], + loc: { + start: { column: 15, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [158, 159], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [159, 160], + loc: { + start: { column: 17, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [163, 164], + loc: { + start: { column: 2, line: 8 }, + end: { column: 3, line: 8 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [168, 174], + loc: { + start: { column: 2, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "method2", + + range: [175, 182], + loc: { + start: { column: 9, line: 10 }, + end: { column: 16, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [182, 183], + loc: { + start: { column: 16, line: 10 }, + end: { column: 17, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "this", + + range: [183, 187], + loc: { + start: { column: 17, line: 10 }, + end: { column: 21, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [187, 188], + loc: { + start: { column: 21, line: 10 }, + end: { column: 22, line: 10 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [189, 190], + loc: { + start: { column: 23, line: 10 }, + end: { column: 24, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [190, 191], + loc: { + start: { column: 24, line: 10 }, + end: { column: 25, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [191, 192], + loc: { + start: { column: 25, line: 10 }, + end: { column: 26, line: 10 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [193, 197], + loc: { + start: { column: 27, line: 10 }, + end: { column: 31, line: 10 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [198, 199], + loc: { + start: { column: 32, line: 10 }, + end: { column: 33, line: 10 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [204, 210], + loc: { + start: { column: 4, line: 11 }, + end: { column: 10, line: 11 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [211, 215], + loc: { + start: { column: 11, line: 11 }, + end: { column: 15, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [215, 216], + loc: { + start: { column: 15, line: 11 }, + end: { column: 16, line: 11 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [216, 217], + loc: { + start: { column: 16, line: 11 }, + end: { column: 17, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [217, 218], + loc: { + start: { column: 17, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [221, 222], + loc: { + start: { column: 2, line: 12 }, + end: { column: 3, line: 12 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [226, 232], + loc: { + start: { column: 2, line: 14 }, + end: { column: 8, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "method3", + + range: [233, 240], + loc: { + start: { column: 9, line: 14 }, + end: { column: 16, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [240, 241], + loc: { + start: { column: 16, line: 14 }, + end: { column: 17, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "this", + + range: [241, 245], + loc: { + start: { column: 17, line: 14 }, + end: { column: 21, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [245, 246], + loc: { + start: { column: 21, line: 14 }, + end: { column: 22, line: 14 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [247, 251], + loc: { + start: { column: 23, line: 14 }, + end: { column: 27, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [251, 252], + loc: { + start: { column: 27, line: 14 }, + end: { column: 28, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [252, 253], + loc: { + start: { column: 28, line: 14 }, + end: { column: 29, line: 14 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [254, 260], + loc: { + start: { column: 30, line: 14 }, + end: { column: 36, line: 14 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [261, 262], + loc: { + start: { column: 37, line: 14 }, + end: { column: 38, line: 14 }, + }, + }, + Keyword { + type: "Keyword", + value: "var", + + range: [267, 270], + loc: { + start: { column: 4, line: 15 }, + end: { column: 7, line: 15 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [271, 273], + loc: { + start: { column: 8, line: 15 }, + end: { column: 10, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [274, 275], + loc: { + start: { column: 11, line: 15 }, + end: { column: 12, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [276, 277], + loc: { + start: { column: 13, line: 15 }, + end: { column: 14, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [277, 278], + loc: { + start: { column: 14, line: 15 }, + end: { column: 15, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [279, 281], + loc: { + start: { column: 16, line: 15 }, + end: { column: 18, line: 15 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [282, 286], + loc: { + start: { column: 19, line: 15 }, + end: { column: 23, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [286, 287], + loc: { + start: { column: 23, line: 15 }, + end: { column: 24, line: 15 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [287, 288], + loc: { + start: { column: 24, line: 15 }, + end: { column: 25, line: 15 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [288, 289], + loc: { + start: { column: 25, line: 15 }, + end: { column: 26, line: 15 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [294, 300], + loc: { + start: { column: 4, line: 16 }, + end: { column: 10, line: 16 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [301, 303], + loc: { + start: { column: 11, line: 16 }, + end: { column: 13, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [303, 304], + loc: { + start: { column: 13, line: 16 }, + end: { column: 14, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [304, 305], + loc: { + start: { column: 14, line: 16 }, + end: { column: 15, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [305, 306], + loc: { + start: { column: 15, line: 16 }, + end: { column: 16, line: 16 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [309, 310], + loc: { + start: { column: 2, line: 17 }, + end: { column: 3, line: 17 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [314, 320], + loc: { + start: { column: 2, line: 19 }, + end: { column: 8, line: 19 }, + }, + }, + Identifier { + type: "Identifier", + value: "method4", + + range: [321, 328], + loc: { + start: { column: 9, line: 19 }, + end: { column: 16, line: 19 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [328, 329], + loc: { + start: { column: 16, line: 19 }, + end: { column: 17, line: 19 }, + }, + }, + Identifier { + type: "Identifier", + value: "this", + + range: [329, 333], + loc: { + start: { column: 17, line: 19 }, + end: { column: 21, line: 19 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [333, 334], + loc: { + start: { column: 21, line: 19 }, + end: { column: 22, line: 19 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [335, 336], + loc: { + start: { column: 23, line: 19 }, + end: { column: 24, line: 19 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [336, 337], + loc: { + start: { column: 24, line: 19 }, + end: { column: 25, line: 19 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [337, 338], + loc: { + start: { column: 25, line: 19 }, + end: { column: 26, line: 19 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [339, 345], + loc: { + start: { column: 27, line: 19 }, + end: { column: 33, line: 19 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [346, 347], + loc: { + start: { column: 34, line: 19 }, + end: { column: 35, line: 19 }, + }, + }, + Keyword { + type: "Keyword", + value: "var", + + range: [352, 355], + loc: { + start: { column: 4, line: 20 }, + end: { column: 7, line: 20 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [356, 358], + loc: { + start: { column: 8, line: 20 }, + end: { column: 10, line: 20 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [359, 360], + loc: { + start: { column: 11, line: 20 }, + end: { column: 12, line: 20 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [361, 362], + loc: { + start: { column: 13, line: 20 }, + end: { column: 14, line: 20 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [362, 363], + loc: { + start: { column: 14, line: 20 }, + end: { column: 15, line: 20 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [364, 366], + loc: { + start: { column: 16, line: 20 }, + end: { column: 18, line: 20 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [367, 371], + loc: { + start: { column: 19, line: 20 }, + end: { column: 23, line: 20 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [371, 372], + loc: { + start: { column: 23, line: 20 }, + end: { column: 24, line: 20 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [372, 373], + loc: { + start: { column: 24, line: 20 }, + end: { column: 25, line: 20 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [373, 374], + loc: { + start: { column: 25, line: 20 }, + end: { column: 26, line: 20 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [379, 385], + loc: { + start: { column: 4, line: 21 }, + end: { column: 10, line: 21 }, + }, + }, + Identifier { + type: "Identifier", + value: "fn", + + range: [386, 388], + loc: { + start: { column: 11, line: 21 }, + end: { column: 13, line: 21 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [388, 389], + loc: { + start: { column: 13, line: 21 }, + end: { column: 14, line: 21 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [389, 390], + loc: { + start: { column: 14, line: 21 }, + end: { column: 15, line: 21 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [390, 391], + loc: { + start: { column: 15, line: 21 }, + end: { column: 16, line: 21 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [394, 395], + loc: { + start: { column: 2, line: 22 }, + end: { column: 3, line: 22 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [399, 405], + loc: { + start: { column: 2, line: 24 }, + end: { column: 8, line: 24 }, + }, + }, + Identifier { + type: "Identifier", + value: "staticMethod", + + range: [406, 418], + loc: { + start: { column: 9, line: 24 }, + end: { column: 21, line: 24 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [418, 419], + loc: { + start: { column: 21, line: 24 }, + end: { column: 22, line: 24 }, + }, + }, + Identifier { + type: "Identifier", + value: "this", + + range: [419, 423], + loc: { + start: { column: 22, line: 24 }, + end: { column: 26, line: 24 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [423, 424], + loc: { + start: { column: 26, line: 24 }, + end: { column: 27, line: 24 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [425, 426], + loc: { + start: { column: 28, line: 24 }, + end: { column: 29, line: 24 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [426, 427], + loc: { + start: { column: 29, line: 24 }, + end: { column: 30, line: 24 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [427, 428], + loc: { + start: { column: 30, line: 24 }, + end: { column: 31, line: 24 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [429, 435], + loc: { + start: { column: 32, line: 24 }, + end: { column: 38, line: 24 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [436, 437], + loc: { + start: { column: 39, line: 24 }, + end: { column: 40, line: 24 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [442, 448], + loc: { + start: { column: 4, line: 25 }, + end: { column: 10, line: 25 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [449, 453], + loc: { + start: { column: 11, line: 25 }, + end: { column: 15, line: 25 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [453, 454], + loc: { + start: { column: 15, line: 25 }, + end: { column: 16, line: 25 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [454, 455], + loc: { + start: { column: 16, line: 25 }, + end: { column: 17, line: 25 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [455, 456], + loc: { + start: { column: 17, line: 25 }, + end: { column: 18, line: 25 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [459, 460], + loc: { + start: { column: 2, line: 26 }, + end: { column: 3, line: 26 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [464, 470], + loc: { + start: { column: 2, line: 28 }, + end: { column: 8, line: 28 }, + }, + }, + Identifier { + type: "Identifier", + value: "typeof", + + range: [471, 477], + loc: { + start: { column: 9, line: 28 }, + end: { column: 15, line: 28 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [477, 478], + loc: { + start: { column: 15, line: 28 }, + end: { column: 16, line: 28 }, + }, + }, + Identifier { + type: "Identifier", + value: "this", + + range: [478, 482], + loc: { + start: { column: 16, line: 28 }, + end: { column: 20, line: 28 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [482, 483], + loc: { + start: { column: 20, line: 28 }, + end: { column: 21, line: 28 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [484, 485], + loc: { + start: { column: 22, line: 28 }, + end: { column: 23, line: 28 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [485, 486], + loc: { + start: { column: 23, line: 28 }, + end: { column: 24, line: 28 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [486, 487], + loc: { + start: { column: 24, line: 28 }, + end: { column: 25, line: 28 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [488, 492], + loc: { + start: { column: 26, line: 28 }, + end: { column: 30, line: 28 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [493, 494], + loc: { + start: { column: 31, line: 28 }, + end: { column: 32, line: 28 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [499, 505], + loc: { + start: { column: 4, line: 29 }, + end: { column: 10, line: 29 }, + }, + }, + Keyword { + type: "Keyword", + value: "typeof", + + range: [506, 512], + loc: { + start: { column: 11, line: 29 }, + end: { column: 17, line: 29 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [513, 517], + loc: { + start: { column: 18, line: 29 }, + end: { column: 22, line: 29 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [517, 518], + loc: { + start: { column: 22, line: 29 }, + end: { column: 23, line: 29 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [521, 522], + loc: { + start: { column: 2, line: 30 }, + end: { column: 3, line: 30 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [523, 524], + loc: { + start: { column: 0, line: 31 }, + end: { column: 1, line: 31 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..11f2406bcb57 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,1064 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + PropertyDefinition { + type: 'PropertyDefinition', + accessibility: 'public', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'a', + + range: [92, 93], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [95, 101], + loc: { + start: { column: 12, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + + range: [93, 101], + loc: { + start: { column: 10, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + value: null, + + range: [85, 102], + loc: { + start: { column: 2, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + accessibility: 'public', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'method', + + range: [113, 119], + loc: { + start: { column: 9, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: MemberExpression { + type: 'MemberExpression', + computed: false, + object: ThisExpression { + type: 'ThisExpression', + + range: [153, 157], + loc: { + start: { column: 11, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + optional: false, + property: Identifier { + type: 'Identifier', + name: 'a', + + range: [158, 159], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + + range: [153, 159], + loc: { + start: { column: 11, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + + range: [146, 160], + loc: { + start: { column: 4, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + ], + + range: [140, 164], + loc: { + start: { column: 36, line: 6 }, + end: { column: 3, line: 8 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: 'Identifier', + name: 'this', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSThisType { + type: 'TSThisType', + + range: [126, 130], + loc: { + start: { column: 22, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + + range: [124, 130], + loc: { + start: { column: 20, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + + range: [120, 130], + loc: { + start: { column: 16, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [133, 139], + loc: { + start: { column: 29, line: 6 }, + end: { column: 35, line: 6 }, + }, + }, + + range: [131, 139], + loc: { + start: { column: 27, line: 6 }, + end: { column: 35, line: 6 }, + }, + }, + + range: [119, 164], + loc: { + start: { column: 15, line: 6 }, + end: { column: 3, line: 8 }, + }, + }, + + range: [106, 164], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 8 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + accessibility: 'public', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'method2', + + range: [175, 182], + loc: { + start: { column: 9, line: 10 }, + end: { column: 16, line: 10 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: MemberExpression { + type: 'MemberExpression', + computed: false, + object: ThisExpression { + type: 'ThisExpression', + + range: [211, 215], + loc: { + start: { column: 11, line: 11 }, + end: { column: 15, line: 11 }, + }, + }, + optional: false, + property: Identifier { + type: 'Identifier', + name: 'a', + + range: [216, 217], + loc: { + start: { column: 16, line: 11 }, + end: { column: 17, line: 11 }, + }, + }, + + range: [211, 217], + loc: { + start: { column: 11, line: 11 }, + end: { column: 17, line: 11 }, + }, + }, + + range: [204, 218], + loc: { + start: { column: 4, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + ], + + range: [198, 222], + loc: { + start: { column: 32, line: 10 }, + end: { column: 3, line: 12 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: 'Identifier', + name: 'this', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'A', + + range: [189, 190], + loc: { + start: { column: 23, line: 10 }, + end: { column: 24, line: 10 }, + }, + }, + + range: [189, 190], + loc: { + start: { column: 23, line: 10 }, + end: { column: 24, line: 10 }, + }, + }, + + range: [187, 190], + loc: { + start: { column: 21, line: 10 }, + end: { column: 24, line: 10 }, + }, + }, + + range: [183, 190], + loc: { + start: { column: 17, line: 10 }, + end: { column: 24, line: 10 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSThisType { + type: 'TSThisType', + + range: [193, 197], + loc: { + start: { column: 27, line: 10 }, + end: { column: 31, line: 10 }, + }, + }, + + range: [191, 197], + loc: { + start: { column: 25, line: 10 }, + end: { column: 31, line: 10 }, + }, + }, + + range: [182, 222], + loc: { + start: { column: 16, line: 10 }, + end: { column: 3, line: 12 }, + }, + }, + + range: [168, 222], + loc: { + start: { column: 2, line: 10 }, + end: { column: 3, line: 12 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + accessibility: 'public', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'method3', + + range: [233, 240], + loc: { + start: { column: 9, line: 14 }, + end: { column: 16, line: 14 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'fn', + + range: [271, 273], + loc: { + start: { column: 8, line: 15 }, + end: { column: 10, line: 15 }, + }, + }, + init: ArrowFunctionExpression { + type: 'ArrowFunctionExpression', + async: false, + body: MemberExpression { + type: 'MemberExpression', + computed: false, + object: ThisExpression { + type: 'ThisExpression', + + range: [282, 286], + loc: { + start: { column: 19, line: 15 }, + end: { column: 23, line: 15 }, + }, + }, + optional: false, + property: Identifier { + type: 'Identifier', + name: 'a', + + range: [287, 288], + loc: { + start: { column: 24, line: 15 }, + end: { column: 25, line: 15 }, + }, + }, + + range: [282, 288], + loc: { + start: { column: 19, line: 15 }, + end: { column: 25, line: 15 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [], + + range: [276, 288], + loc: { + start: { column: 13, line: 15 }, + end: { column: 25, line: 15 }, + }, + }, + + range: [271, 288], + loc: { + start: { column: 8, line: 15 }, + end: { column: 25, line: 15 }, + }, + }, + ], + kind: 'var', + + range: [267, 289], + loc: { + start: { column: 4, line: 15 }, + end: { column: 26, line: 15 }, + }, + }, + ReturnStatement { + type: 'ReturnStatement', + argument: CallExpression { + type: 'CallExpression', + arguments: Array [], + callee: Identifier { + type: 'Identifier', + name: 'fn', + + range: [301, 303], + loc: { + start: { column: 11, line: 16 }, + end: { column: 13, line: 16 }, + }, + }, + optional: false, + + range: [301, 305], + loc: { + start: { column: 11, line: 16 }, + end: { column: 15, line: 16 }, + }, + }, + + range: [294, 306], + loc: { + start: { column: 4, line: 16 }, + end: { column: 16, line: 16 }, + }, + }, + ], + + range: [261, 310], + loc: { + start: { column: 37, line: 14 }, + end: { column: 3, line: 17 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: 'Identifier', + name: 'this', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSThisType { + type: 'TSThisType', + + range: [247, 251], + loc: { + start: { column: 23, line: 14 }, + end: { column: 27, line: 14 }, + }, + }, + + range: [245, 251], + loc: { + start: { column: 21, line: 14 }, + end: { column: 27, line: 14 }, + }, + }, + + range: [241, 251], + loc: { + start: { column: 17, line: 14 }, + end: { column: 27, line: 14 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [254, 260], + loc: { + start: { column: 30, line: 14 }, + end: { column: 36, line: 14 }, + }, + }, + + range: [252, 260], + loc: { + start: { column: 28, line: 14 }, + end: { column: 36, line: 14 }, + }, + }, + + range: [240, 310], + loc: { + start: { column: 16, line: 14 }, + end: { column: 3, line: 17 }, + }, + }, + + range: [226, 310], + loc: { + start: { column: 2, line: 14 }, + end: { column: 3, line: 17 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + accessibility: 'public', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'method4', + + range: [321, 328], + loc: { + start: { column: 9, line: 19 }, + end: { column: 16, line: 19 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'fn', + + range: [356, 358], + loc: { + start: { column: 8, line: 20 }, + end: { column: 10, line: 20 }, + }, + }, + init: ArrowFunctionExpression { + type: 'ArrowFunctionExpression', + async: false, + body: MemberExpression { + type: 'MemberExpression', + computed: false, + object: ThisExpression { + type: 'ThisExpression', + + range: [367, 371], + loc: { + start: { column: 19, line: 20 }, + end: { column: 23, line: 20 }, + }, + }, + optional: false, + property: Identifier { + type: 'Identifier', + name: 'a', + + range: [372, 373], + loc: { + start: { column: 24, line: 20 }, + end: { column: 25, line: 20 }, + }, + }, + + range: [367, 373], + loc: { + start: { column: 19, line: 20 }, + end: { column: 25, line: 20 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [], + + range: [361, 373], + loc: { + start: { column: 13, line: 20 }, + end: { column: 25, line: 20 }, + }, + }, + + range: [356, 373], + loc: { + start: { column: 8, line: 20 }, + end: { column: 25, line: 20 }, + }, + }, + ], + kind: 'var', + + range: [352, 374], + loc: { + start: { column: 4, line: 20 }, + end: { column: 26, line: 20 }, + }, + }, + ReturnStatement { + type: 'ReturnStatement', + argument: CallExpression { + type: 'CallExpression', + arguments: Array [], + callee: Identifier { + type: 'Identifier', + name: 'fn', + + range: [386, 388], + loc: { + start: { column: 11, line: 21 }, + end: { column: 13, line: 21 }, + }, + }, + optional: false, + + range: [386, 390], + loc: { + start: { column: 11, line: 21 }, + end: { column: 15, line: 21 }, + }, + }, + + range: [379, 391], + loc: { + start: { column: 4, line: 21 }, + end: { column: 16, line: 21 }, + }, + }, + ], + + range: [346, 395], + loc: { + start: { column: 34, line: 19 }, + end: { column: 3, line: 22 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: 'Identifier', + name: 'this', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'A', + + range: [335, 336], + loc: { + start: { column: 23, line: 19 }, + end: { column: 24, line: 19 }, + }, + }, + + range: [335, 336], + loc: { + start: { column: 23, line: 19 }, + end: { column: 24, line: 19 }, + }, + }, + + range: [333, 336], + loc: { + start: { column: 21, line: 19 }, + end: { column: 24, line: 19 }, + }, + }, + + range: [329, 336], + loc: { + start: { column: 17, line: 19 }, + end: { column: 24, line: 19 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [339, 345], + loc: { + start: { column: 27, line: 19 }, + end: { column: 33, line: 19 }, + }, + }, + + range: [337, 345], + loc: { + start: { column: 25, line: 19 }, + end: { column: 33, line: 19 }, + }, + }, + + range: [328, 395], + loc: { + start: { column: 16, line: 19 }, + end: { column: 3, line: 22 }, + }, + }, + + range: [314, 395], + loc: { + start: { column: 2, line: 19 }, + end: { column: 3, line: 22 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'staticMethod', + + range: [406, 418], + loc: { + start: { column: 9, line: 24 }, + end: { column: 21, line: 24 }, + }, + }, + kind: 'method', +- override: false, + static: true, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: MemberExpression { + type: 'MemberExpression', + computed: false, + object: ThisExpression { + type: 'ThisExpression', + + range: [449, 453], + loc: { + start: { column: 11, line: 25 }, + end: { column: 15, line: 25 }, + }, + }, + optional: false, + property: Identifier { + type: 'Identifier', + name: 'a', + + range: [454, 455], + loc: { + start: { column: 16, line: 25 }, + end: { column: 17, line: 25 }, + }, + }, + + range: [449, 455], + loc: { + start: { column: 11, line: 25 }, + end: { column: 17, line: 25 }, + }, + }, + + range: [442, 456], + loc: { + start: { column: 4, line: 25 }, + end: { column: 18, line: 25 }, + }, + }, + ], + + range: [436, 460], + loc: { + start: { column: 39, line: 24 }, + end: { column: 3, line: 26 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: 'Identifier', + name: 'this', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'A', + + range: [425, 426], + loc: { + start: { column: 28, line: 24 }, + end: { column: 29, line: 24 }, + }, + }, + + range: [425, 426], + loc: { + start: { column: 28, line: 24 }, + end: { column: 29, line: 24 }, + }, + }, + + range: [423, 426], + loc: { + start: { column: 26, line: 24 }, + end: { column: 29, line: 24 }, + }, + }, + + range: [419, 426], + loc: { + start: { column: 22, line: 24 }, + end: { column: 29, line: 24 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [429, 435], + loc: { + start: { column: 32, line: 24 }, + end: { column: 38, line: 24 }, + }, + }, + + range: [427, 435], + loc: { + start: { column: 30, line: 24 }, + end: { column: 38, line: 24 }, + }, + }, + + range: [418, 460], + loc: { + start: { column: 21, line: 24 }, + end: { column: 3, line: 26 }, + }, + }, + + range: [399, 460], + loc: { + start: { column: 2, line: 24 }, + end: { column: 3, line: 26 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'typeof', + + range: [471, 477], + loc: { + start: { column: 9, line: 28 }, + end: { column: 15, line: 28 }, + }, + }, + kind: 'method', +- override: false, + static: true, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: UnaryExpression { + type: 'UnaryExpression', + argument: ThisExpression { + type: 'ThisExpression', + + range: [513, 517], + loc: { + start: { column: 18, line: 29 }, + end: { column: 22, line: 29 }, + }, + }, + operator: 'typeof', + prefix: true, + + range: [506, 517], + loc: { + start: { column: 11, line: 29 }, + end: { column: 22, line: 29 }, + }, + }, + + range: [499, 518], + loc: { + start: { column: 4, line: 29 }, + end: { column: 23, line: 29 }, + }, + }, + ], + + range: [493, 522], + loc: { + start: { column: 31, line: 28 }, + end: { column: 3, line: 30 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [ + Identifier { + type: 'Identifier', + name: 'this', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'A', + + range: [484, 485], + loc: { + start: { column: 22, line: 28 }, + end: { column: 23, line: 28 }, + }, + }, + + range: [484, 485], + loc: { + start: { column: 22, line: 28 }, + end: { column: 23, line: 28 }, + }, + }, + + range: [482, 485], + loc: { + start: { column: 20, line: 28 }, + end: { column: 23, line: 28 }, + }, + }, + + range: [478, 485], + loc: { + start: { column: 16, line: 28 }, + end: { column: 23, line: 28 }, + }, + }, + ], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSThisType { + type: 'TSThisType', + + range: [488, 492], + loc: { + start: { column: 26, line: 28 }, + end: { column: 30, line: 28 }, + }, + }, + + range: [486, 492], + loc: { + start: { column: 24, line: 28 }, + end: { column: 30, line: 28 }, + }, + }, + + range: [477, 522], + loc: { + start: { column: 15, line: 28 }, + end: { column: 3, line: 30 }, + }, + }, + + range: [464, 522], + loc: { + start: { column: 2, line: 28 }, + end: { column: 3, line: 30 }, + }, + }, + ], + + range: [81, 524], + loc: { + start: { column: 8, line: 3 }, + end: { column: 1, line: 31 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'A', + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + superClass: null, + + range: [73, 524], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 31 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 525], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 32 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..1ac8cbcbd28d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,1274 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'A', + + range: [79, 80], + loc: { + start: { column: 6, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [85, 91], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'a', + + range: [92, 93], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [93, 94], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [95, 101], + loc: { + start: { column: 12, line: 4 }, + end: { column: 18, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [101, 102], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [106, 112], + loc: { + start: { column: 2, line: 6 }, + end: { column: 8, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'method', + + range: [113, 119], + loc: { + start: { column: 9, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [119, 120], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'this', + + range: [120, 124], + loc: { + start: { column: 16, line: 6 }, + end: { column: 20, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [124, 125], + loc: { + start: { column: 20, line: 6 }, + end: { column: 21, line: 6 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'this', + + range: [126, 130], + loc: { + start: { column: 22, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [130, 131], + loc: { + start: { column: 26, line: 6 }, + end: { column: 27, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [131, 132], + loc: { + start: { column: 27, line: 6 }, + end: { column: 28, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [133, 139], + loc: { + start: { column: 29, line: 6 }, + end: { column: 35, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [140, 141], + loc: { + start: { column: 36, line: 6 }, + end: { column: 37, line: 6 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'return', + + range: [146, 152], + loc: { + start: { column: 4, line: 7 }, + end: { column: 10, line: 7 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'this', + + range: [153, 157], + loc: { + start: { column: 11, line: 7 }, + end: { column: 15, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '.', + + range: [157, 158], + loc: { + start: { column: 15, line: 7 }, + end: { column: 16, line: 7 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'a', + + range: [158, 159], + loc: { + start: { column: 16, line: 7 }, + end: { column: 17, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [159, 160], + loc: { + start: { column: 17, line: 7 }, + end: { column: 18, line: 7 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [163, 164], + loc: { + start: { column: 2, line: 8 }, + end: { column: 3, line: 8 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [168, 174], + loc: { + start: { column: 2, line: 10 }, + end: { column: 8, line: 10 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'method2', + + range: [175, 182], + loc: { + start: { column: 9, line: 10 }, + end: { column: 16, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [182, 183], + loc: { + start: { column: 16, line: 10 }, + end: { column: 17, line: 10 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'this', + + range: [183, 187], + loc: { + start: { column: 17, line: 10 }, + end: { column: 21, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [187, 188], + loc: { + start: { column: 21, line: 10 }, + end: { column: 22, line: 10 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'A', + + range: [189, 190], + loc: { + start: { column: 23, line: 10 }, + end: { column: 24, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [190, 191], + loc: { + start: { column: 24, line: 10 }, + end: { column: 25, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [191, 192], + loc: { + start: { column: 25, line: 10 }, + end: { column: 26, line: 10 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'this', + + range: [193, 197], + loc: { + start: { column: 27, line: 10 }, + end: { column: 31, line: 10 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [198, 199], + loc: { + start: { column: 32, line: 10 }, + end: { column: 33, line: 10 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'return', + + range: [204, 210], + loc: { + start: { column: 4, line: 11 }, + end: { column: 10, line: 11 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'this', + + range: [211, 215], + loc: { + start: { column: 11, line: 11 }, + end: { column: 15, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '.', + + range: [215, 216], + loc: { + start: { column: 15, line: 11 }, + end: { column: 16, line: 11 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'a', + + range: [216, 217], + loc: { + start: { column: 16, line: 11 }, + end: { column: 17, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [217, 218], + loc: { + start: { column: 17, line: 11 }, + end: { column: 18, line: 11 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [221, 222], + loc: { + start: { column: 2, line: 12 }, + end: { column: 3, line: 12 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [226, 232], + loc: { + start: { column: 2, line: 14 }, + end: { column: 8, line: 14 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'method3', + + range: [233, 240], + loc: { + start: { column: 9, line: 14 }, + end: { column: 16, line: 14 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [240, 241], + loc: { + start: { column: 16, line: 14 }, + end: { column: 17, line: 14 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'this', + + range: [241, 245], + loc: { + start: { column: 17, line: 14 }, + end: { column: 21, line: 14 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [245, 246], + loc: { + start: { column: 21, line: 14 }, + end: { column: 22, line: 14 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'this', + + range: [247, 251], + loc: { + start: { column: 23, line: 14 }, + end: { column: 27, line: 14 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [251, 252], + loc: { + start: { column: 27, line: 14 }, + end: { column: 28, line: 14 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [252, 253], + loc: { + start: { column: 28, line: 14 }, + end: { column: 29, line: 14 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [254, 260], + loc: { + start: { column: 30, line: 14 }, + end: { column: 36, line: 14 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [261, 262], + loc: { + start: { column: 37, line: 14 }, + end: { column: 38, line: 14 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'var', + + range: [267, 270], + loc: { + start: { column: 4, line: 15 }, + end: { column: 7, line: 15 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'fn', + + range: [271, 273], + loc: { + start: { column: 8, line: 15 }, + end: { column: 10, line: 15 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [274, 275], + loc: { + start: { column: 11, line: 15 }, + end: { column: 12, line: 15 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [276, 277], + loc: { + start: { column: 13, line: 15 }, + end: { column: 14, line: 15 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [277, 278], + loc: { + start: { column: 14, line: 15 }, + end: { column: 15, line: 15 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=>', + + range: [279, 281], + loc: { + start: { column: 16, line: 15 }, + end: { column: 18, line: 15 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'this', + + range: [282, 286], + loc: { + start: { column: 19, line: 15 }, + end: { column: 23, line: 15 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '.', + + range: [286, 287], + loc: { + start: { column: 23, line: 15 }, + end: { column: 24, line: 15 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'a', + + range: [287, 288], + loc: { + start: { column: 24, line: 15 }, + end: { column: 25, line: 15 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [288, 289], + loc: { + start: { column: 25, line: 15 }, + end: { column: 26, line: 15 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'return', + + range: [294, 300], + loc: { + start: { column: 4, line: 16 }, + end: { column: 10, line: 16 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'fn', + + range: [301, 303], + loc: { + start: { column: 11, line: 16 }, + end: { column: 13, line: 16 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [303, 304], + loc: { + start: { column: 13, line: 16 }, + end: { column: 14, line: 16 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [304, 305], + loc: { + start: { column: 14, line: 16 }, + end: { column: 15, line: 16 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [305, 306], + loc: { + start: { column: 15, line: 16 }, + end: { column: 16, line: 16 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [309, 310], + loc: { + start: { column: 2, line: 17 }, + end: { column: 3, line: 17 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [314, 320], + loc: { + start: { column: 2, line: 19 }, + end: { column: 8, line: 19 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'method4', + + range: [321, 328], + loc: { + start: { column: 9, line: 19 }, + end: { column: 16, line: 19 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [328, 329], + loc: { + start: { column: 16, line: 19 }, + end: { column: 17, line: 19 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'this', + + range: [329, 333], + loc: { + start: { column: 17, line: 19 }, + end: { column: 21, line: 19 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [333, 334], + loc: { + start: { column: 21, line: 19 }, + end: { column: 22, line: 19 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'A', + + range: [335, 336], + loc: { + start: { column: 23, line: 19 }, + end: { column: 24, line: 19 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [336, 337], + loc: { + start: { column: 24, line: 19 }, + end: { column: 25, line: 19 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [337, 338], + loc: { + start: { column: 25, line: 19 }, + end: { column: 26, line: 19 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [339, 345], + loc: { + start: { column: 27, line: 19 }, + end: { column: 33, line: 19 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [346, 347], + loc: { + start: { column: 34, line: 19 }, + end: { column: 35, line: 19 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'var', + + range: [352, 355], + loc: { + start: { column: 4, line: 20 }, + end: { column: 7, line: 20 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'fn', + + range: [356, 358], + loc: { + start: { column: 8, line: 20 }, + end: { column: 10, line: 20 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [359, 360], + loc: { + start: { column: 11, line: 20 }, + end: { column: 12, line: 20 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [361, 362], + loc: { + start: { column: 13, line: 20 }, + end: { column: 14, line: 20 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [362, 363], + loc: { + start: { column: 14, line: 20 }, + end: { column: 15, line: 20 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=>', + + range: [364, 366], + loc: { + start: { column: 16, line: 20 }, + end: { column: 18, line: 20 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'this', + + range: [367, 371], + loc: { + start: { column: 19, line: 20 }, + end: { column: 23, line: 20 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '.', + + range: [371, 372], + loc: { + start: { column: 23, line: 20 }, + end: { column: 24, line: 20 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'a', + + range: [372, 373], + loc: { + start: { column: 24, line: 20 }, + end: { column: 25, line: 20 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [373, 374], + loc: { + start: { column: 25, line: 20 }, + end: { column: 26, line: 20 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'return', + + range: [379, 385], + loc: { + start: { column: 4, line: 21 }, + end: { column: 10, line: 21 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'fn', + + range: [386, 388], + loc: { + start: { column: 11, line: 21 }, + end: { column: 13, line: 21 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [388, 389], + loc: { + start: { column: 13, line: 21 }, + end: { column: 14, line: 21 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [389, 390], + loc: { + start: { column: 14, line: 21 }, + end: { column: 15, line: 21 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [390, 391], + loc: { + start: { column: 15, line: 21 }, + end: { column: 16, line: 21 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [394, 395], + loc: { + start: { column: 2, line: 22 }, + end: { column: 3, line: 22 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'static', + + range: [399, 405], + loc: { + start: { column: 2, line: 24 }, + end: { column: 8, line: 24 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'staticMethod', + + range: [406, 418], + loc: { + start: { column: 9, line: 24 }, + end: { column: 21, line: 24 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [418, 419], + loc: { + start: { column: 21, line: 24 }, + end: { column: 22, line: 24 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'this', + + range: [419, 423], + loc: { + start: { column: 22, line: 24 }, + end: { column: 26, line: 24 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [423, 424], + loc: { + start: { column: 26, line: 24 }, + end: { column: 27, line: 24 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'A', + + range: [425, 426], + loc: { + start: { column: 28, line: 24 }, + end: { column: 29, line: 24 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [426, 427], + loc: { + start: { column: 29, line: 24 }, + end: { column: 30, line: 24 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [427, 428], + loc: { + start: { column: 30, line: 24 }, + end: { column: 31, line: 24 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [429, 435], + loc: { + start: { column: 32, line: 24 }, + end: { column: 38, line: 24 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [436, 437], + loc: { + start: { column: 39, line: 24 }, + end: { column: 40, line: 24 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'return', + + range: [442, 448], + loc: { + start: { column: 4, line: 25 }, + end: { column: 10, line: 25 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'this', + + range: [449, 453], + loc: { + start: { column: 11, line: 25 }, + end: { column: 15, line: 25 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '.', + + range: [453, 454], + loc: { + start: { column: 15, line: 25 }, + end: { column: 16, line: 25 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'a', + + range: [454, 455], + loc: { + start: { column: 16, line: 25 }, + end: { column: 17, line: 25 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [455, 456], + loc: { + start: { column: 17, line: 25 }, + end: { column: 18, line: 25 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [459, 460], + loc: { + start: { column: 2, line: 26 }, + end: { column: 3, line: 26 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'static', + + range: [464, 470], + loc: { + start: { column: 2, line: 28 }, + end: { column: 8, line: 28 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'typeof', + + range: [471, 477], + loc: { + start: { column: 9, line: 28 }, + end: { column: 15, line: 28 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [477, 478], + loc: { + start: { column: 15, line: 28 }, + end: { column: 16, line: 28 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'this', + + range: [478, 482], + loc: { + start: { column: 16, line: 28 }, + end: { column: 20, line: 28 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [482, 483], + loc: { + start: { column: 20, line: 28 }, + end: { column: 21, line: 28 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'A', + + range: [484, 485], + loc: { + start: { column: 22, line: 28 }, + end: { column: 23, line: 28 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [485, 486], + loc: { + start: { column: 23, line: 28 }, + end: { column: 24, line: 28 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [486, 487], + loc: { + start: { column: 24, line: 28 }, + end: { column: 25, line: 28 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'this', + + range: [488, 492], + loc: { + start: { column: 26, line: 28 }, + end: { column: 30, line: 28 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [493, 494], + loc: { + start: { column: 31, line: 28 }, + end: { column: 32, line: 28 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'return', + + range: [499, 505], + loc: { + start: { column: 4, line: 29 }, + end: { column: 10, line: 29 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'typeof', + + range: [506, 512], + loc: { + start: { column: 11, line: 29 }, + end: { column: 17, line: 29 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'this', + + range: [513, 517], + loc: { + start: { column: 18, line: 29 }, + end: { column: 22, line: 29 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [517, 518], + loc: { + start: { column: 22, line: 29 }, + end: { column: 23, line: 29 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [521, 522], + loc: { + start: { column: 2, line: 30 }, + end: { column: 3, line: 30 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [523, 524], + loc: { + start: { column: 0, line: 31 }, + end: { column: 1, line: 31 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/fixture.ts new file mode 100644 index 000000000000..4957900f565c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/fixture.ts @@ -0,0 +1,7 @@ +// TODO: This fixture might be too large, and if so should be split up. + +class Message { + clone(): this { + return this; + } +} diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..6390741cd311 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,131 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types this-type TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "clone", + + range: [91, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: ThisExpression { + type: "ThisExpression", + + range: [118, 122], + loc: { + start: { column: 11, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [111, 123], + loc: { + start: { column: 4, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + ], + + range: [105, 127], + loc: { + start: { column: 16, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSThisType { + type: "TSThisType", + + range: [100, 104], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [98, 104], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [96, 127], + loc: { + start: { column: 7, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [91, 127], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + ], + + range: [87, 129], + loc: { + start: { column: 14, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Message", + + range: [79, 86], + loc: { + start: { column: 6, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + superClass: null, + + range: [73, 129], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 130], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..fa942749ffea --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types this-type TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Message", + + range: [79, 86], + loc: { + start: { column: 6, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "clone", + + range: [91, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [96, 97], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [97, 98], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [98, 99], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [100, 104], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [105, 106], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [111, 117], + loc: { + start: { column: 4, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [118, 122], + loc: { + start: { column: 11, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [122, 123], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [126, 127], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [128, 129], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..b61830c06aac --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/3-Babel-AST.shot @@ -0,0 +1,130 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types this-type Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "clone", + + range: [91, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [ + ReturnStatement { + type: "ReturnStatement", + argument: ThisExpression { + type: "ThisExpression", + + range: [118, 122], + loc: { + start: { column: 11, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [111, 123], + loc: { + start: { column: 4, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + ], + + range: [105, 127], + loc: { + start: { column: 16, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSThisType { + type: "TSThisType", + + range: [100, 104], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [98, 104], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [96, 127], + loc: { + start: { column: 7, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [91, 127], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + ], + + range: [87, 129], + loc: { + start: { column: 14, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Message", + + range: [79, 86], + loc: { + start: { column: 6, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + superClass: null, + + range: [73, 129], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: "script", + + range: [73, 130], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..3fe9000560e6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types this-type Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [73, 78], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Message", + + range: [79, 86], + loc: { + start: { column: 6, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "clone", + + range: [91, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [96, 97], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [97, 98], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [98, 99], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [100, 104], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [105, 106], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "return", + + range: [111, 117], + loc: { + start: { column: 4, line: 5 }, + end: { column: 10, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [118, 122], + loc: { + start: { column: 11, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [122, 123], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [126, 127], + loc: { + start: { column: 2, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [128, 129], + loc: { + start: { column: 0, line: 7 }, + end: { column: 1, line: 7 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..f4e9993acaef --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,135 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types this-type AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'clone', + + range: [91, 96], + loc: { + start: { column: 2, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [ + ReturnStatement { + type: 'ReturnStatement', + argument: ThisExpression { + type: 'ThisExpression', + + range: [118, 122], + loc: { + start: { column: 11, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + + range: [111, 123], + loc: { + start: { column: 4, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + ], + + range: [105, 127], + loc: { + start: { column: 16, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSThisType { + type: 'TSThisType', + + range: [100, 104], + loc: { + start: { column: 11, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [98, 104], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + + range: [96, 127], + loc: { + start: { column: 7, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + + range: [91, 127], + loc: { + start: { column: 2, line: 4 }, + end: { column: 3, line: 6 }, + }, + }, + ], + + range: [87, 129], + loc: { + start: { column: 14, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Message', + + range: [79, 86], + loc: { + start: { column: 6, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + superClass: null, + + range: [73, 129], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 7 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 130], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 8 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..ac05f79baab8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types this-type AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/fixture.ts new file mode 100644 index 000000000000..0716d468e487 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let x: []; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..be5220d25e37 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,67 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-empty TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [], + + range: [80, 82], + loc: { + start: { column: 7, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + + range: [78, 82], + loc: { + start: { column: 5, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + + range: [77, 82], + loc: { + start: { column: 4, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + init: null, + + range: [77, 82], + loc: { + start: { column: 4, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 83], + loc: { + start: { column: 0, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 84], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..e095c3d40173 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-empty TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..1d0291451c4a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/3-Babel-AST.shot @@ -0,0 +1,67 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-empty Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [], + + range: [80, 82], + loc: { + start: { column: 7, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + + range: [78, 82], + loc: { + start: { column: 5, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + + range: [77, 82], + loc: { + start: { column: 4, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + init: null, + + range: [77, 82], + loc: { + start: { column: 4, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 83], + loc: { + start: { column: 0, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 84], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..30831b226b8a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-empty Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..f467aab6aae7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-empty AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..0ba6dc820c4c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,72 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-empty AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/fixture.ts new file mode 100644 index 000000000000..847b0e812c35 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let x: [a: string, b?: number, c?: string | number]; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..5e1f88bf5755 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,175 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named-optional TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSNamedTupleMember { + type: "TSNamedTupleMember", + elementType: TSStringKeyword { + type: "TSStringKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + label: Identifier { + type: "Identifier", + name: "a", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + optional: false, + + range: [81, 90], + loc: { + start: { column: 8, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + TSNamedTupleMember { + type: "TSNamedTupleMember", + elementType: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + label: Identifier { + type: "Identifier", + name: "b", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + optional: true, + + range: [92, 102], + loc: { + start: { column: 19, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + TSNamedTupleMember { + type: "TSNamedTupleMember", + elementType: TSUnionType { + type: "TSUnionType", + types: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [117, 123], + loc: { + start: { column: 44, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + ], + + range: [108, 123], + loc: { + start: { column: 35, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + label: Identifier { + type: "Identifier", + name: "c", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + optional: true, + + range: [104, 123], + loc: { + start: { column: 31, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + ], + + range: [80, 124], + loc: { + start: { column: 7, line: 3 }, + end: { column: 51, line: 3 }, + }, + }, + + range: [78, 124], + loc: { + start: { column: 5, line: 3 }, + end: { column: 51, line: 3 }, + }, + }, + + range: [77, 124], + loc: { + start: { column: 4, line: 3 }, + end: { column: 51, line: 3 }, + }, + }, + init: null, + + range: [77, 124], + loc: { + start: { column: 4, line: 3 }, + end: { column: 51, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 125], + loc: { + start: { column: 0, line: 3 }, + end: { column: 52, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 126], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..33a75b4daaa9 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,216 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named-optional TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "c", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [117, 123], + loc: { + start: { column: 44, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [123, 124], + loc: { + start: { column: 50, line: 3 }, + end: { column: 51, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [124, 125], + loc: { + start: { column: 51, line: 3 }, + end: { column: 52, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..360657919cc7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/3-Babel-AST.shot @@ -0,0 +1,175 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named-optional Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSNamedTupleMember { + type: "TSNamedTupleMember", + elementType: TSStringKeyword { + type: "TSStringKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + label: Identifier { + type: "Identifier", + name: "a", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + optional: false, + + range: [81, 90], + loc: { + start: { column: 8, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + TSNamedTupleMember { + type: "TSNamedTupleMember", + elementType: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + label: Identifier { + type: "Identifier", + name: "b", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + optional: true, + + range: [92, 102], + loc: { + start: { column: 19, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + TSNamedTupleMember { + type: "TSNamedTupleMember", + elementType: TSUnionType { + type: "TSUnionType", + types: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [117, 123], + loc: { + start: { column: 44, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + ], + + range: [108, 123], + loc: { + start: { column: 35, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + label: Identifier { + type: "Identifier", + name: "c", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + optional: true, + + range: [104, 123], + loc: { + start: { column: 31, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + ], + + range: [80, 124], + loc: { + start: { column: 7, line: 3 }, + end: { column: 51, line: 3 }, + }, + }, + + range: [78, 124], + loc: { + start: { column: 5, line: 3 }, + end: { column: 51, line: 3 }, + }, + }, + + range: [77, 124], + loc: { + start: { column: 4, line: 3 }, + end: { column: 51, line: 3 }, + }, + }, + init: null, + + range: [77, 124], + loc: { + start: { column: 4, line: 3 }, + end: { column: 51, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 125], + loc: { + start: { column: 0, line: 3 }, + end: { column: 52, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 126], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..a0f1781cf8cb --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,216 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named-optional Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "c", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [117, 123], + loc: { + start: { column: 44, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [123, 124], + loc: { + start: { column: 50, line: 3 }, + end: { column: 51, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [124, 125], + loc: { + start: { column: 51, line: 3 }, + end: { column: 52, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..487dca4144bf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named-optional AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..fa0544faf55d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,222 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named-optional AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'a', + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'b', + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [96, 102], + loc: { + start: { column: 23, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [102, 103], + loc: { + start: { column: 29, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'c', + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '|', + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [117, 123], + loc: { + start: { column: 44, line: 3 }, + end: { column: 50, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [123, 124], + loc: { + start: { column: 50, line: 3 }, + end: { column: 51, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [124, 125], + loc: { + start: { column: 51, line: 3 }, + end: { column: 52, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/fixture.ts new file mode 100644 index 000000000000..548298467caf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let x: [a: string, ...b: number[]]; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..3f033ff3b4a3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,144 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named-rest TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSNamedTupleMember { + type: "TSNamedTupleMember", + elementType: TSStringKeyword { + type: "TSStringKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + label: Identifier { + type: "Identifier", + name: "a", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + optional: false, + + range: [81, 90], + loc: { + start: { column: 8, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + TSRestType { + type: "TSRestType", + typeAnnotation: TSNamedTupleMember { + type: "TSNamedTupleMember", + elementType: TSArrayType { + type: "TSArrayType", + elementType: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [98, 104], + loc: { + start: { column: 25, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [98, 106], + loc: { + start: { column: 25, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + label: Identifier { + type: "Identifier", + name: "b", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + optional: false, + + range: [95, 106], + loc: { + start: { column: 22, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [92, 106], + loc: { + start: { column: 19, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + ], + + range: [80, 107], + loc: { + start: { column: 7, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [78, 107], + loc: { + start: { column: 5, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [77, 107], + loc: { + start: { column: 4, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + init: null, + + range: [77, 107], + loc: { + start: { column: 4, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..cbb92a24f2f8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named-rest TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "...", + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [98, 104], + loc: { + start: { column: 25, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..5664ff39f398 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/3-Babel-AST.shot @@ -0,0 +1,144 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named-rest Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSNamedTupleMember { + type: "TSNamedTupleMember", + elementType: TSStringKeyword { + type: "TSStringKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + label: Identifier { + type: "Identifier", + name: "a", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + optional: false, + + range: [81, 90], + loc: { + start: { column: 8, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + TSRestType { + type: "TSRestType", + typeAnnotation: TSNamedTupleMember { + type: "TSNamedTupleMember", + elementType: TSArrayType { + type: "TSArrayType", + elementType: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [98, 104], + loc: { + start: { column: 25, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [98, 106], + loc: { + start: { column: 25, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + label: Identifier { + type: "Identifier", + name: "b", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + optional: false, + + range: [95, 106], + loc: { + start: { column: 22, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + + range: [92, 106], + loc: { + start: { column: 19, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + ], + + range: [80, 107], + loc: { + start: { column: 7, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [78, 107], + loc: { + start: { column: 5, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [77, 107], + loc: { + start: { column: 4, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + init: null, + + range: [77, 107], + loc: { + start: { column: 4, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..3f09f788b42a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named-rest Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "...", + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [98, 104], + loc: { + start: { column: 25, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..4355a551b828 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named-rest AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..de94d7315c7f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,172 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named-rest AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'a', + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '...', + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'b', + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [98, 104], + loc: { + start: { column: 25, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [105, 106], + loc: { + start: { column: 32, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/fixture.ts new file mode 100644 index 000000000000..87abc52f4631 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Foo = [a: string, b?: string]; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..cea3a5527f00 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,104 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named-type TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSNamedTupleMember { + type: "TSNamedTupleMember", + elementType: TSStringKeyword { + type: "TSStringKeyword", + + range: [88, 94], + loc: { + start: { column: 15, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + label: Identifier { + type: "Identifier", + name: "a", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + optional: false, + + range: [85, 94], + loc: { + start: { column: 12, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + TSNamedTupleMember { + type: "TSNamedTupleMember", + elementType: TSStringKeyword { + type: "TSStringKeyword", + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + label: Identifier { + type: "Identifier", + name: "b", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + optional: true, + + range: [96, 106], + loc: { + start: { column: 23, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + ], + + range: [84, 107], + loc: { + start: { column: 11, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..8e08a8c5928e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named-type TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [88, 94], + loc: { + start: { column: 15, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..eee15f41e956 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/3-Babel-AST.shot @@ -0,0 +1,104 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named-type Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSNamedTupleMember { + type: "TSNamedTupleMember", + elementType: TSStringKeyword { + type: "TSStringKeyword", + + range: [88, 94], + loc: { + start: { column: 15, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + label: Identifier { + type: "Identifier", + name: "a", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + optional: false, + + range: [85, 94], + loc: { + start: { column: 12, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + TSNamedTupleMember { + type: "TSNamedTupleMember", + elementType: TSStringKeyword { + type: "TSStringKeyword", + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + label: Identifier { + type: "Identifier", + name: "b", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + optional: true, + + range: [96, 106], + loc: { + start: { column: 23, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + ], + + range: [84, 107], + loc: { + start: { column: 11, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + + range: [73, 108], + loc: { + start: { column: 0, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 109], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..1d10bc474c74 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named-type Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [88, 94], + loc: { + start: { column: 15, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [97, 98], + loc: { + start: { column: 24, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [100, 106], + loc: { + start: { column: 27, line: 3 }, + end: { column: 33, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [107, 108], + loc: { + start: { column: 34, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..8767560841d4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named-type AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..30fb9c3d6b93 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named-type AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/fixture.ts new file mode 100644 index 000000000000..94231a93065e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let x: [a: number, b: number, c: number]; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..733eacf0a27d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,155 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSNamedTupleMember { + type: "TSNamedTupleMember", + elementType: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + label: Identifier { + type: "Identifier", + name: "a", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + optional: false, + + range: [81, 90], + loc: { + start: { column: 8, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + TSNamedTupleMember { + type: "TSNamedTupleMember", + elementType: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + label: Identifier { + type: "Identifier", + name: "b", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + optional: false, + + range: [92, 101], + loc: { + start: { column: 19, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + TSNamedTupleMember { + type: "TSNamedTupleMember", + elementType: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [106, 112], + loc: { + start: { column: 33, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + label: Identifier { + type: "Identifier", + name: "c", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + optional: false, + + range: [103, 112], + loc: { + start: { column: 30, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + ], + + range: [80, 113], + loc: { + start: { column: 7, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + + range: [78, 113], + loc: { + start: { column: 5, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + + range: [77, 113], + loc: { + start: { column: 4, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + init: null, + + range: [77, 113], + loc: { + start: { column: 4, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 114], + loc: { + start: { column: 0, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 115], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..52e363ecde59 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "c", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [106, 112], + loc: { + start: { column: 33, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [113, 114], + loc: { + start: { column: 40, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..5348248af00e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/3-Babel-AST.shot @@ -0,0 +1,155 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSNamedTupleMember { + type: "TSNamedTupleMember", + elementType: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + label: Identifier { + type: "Identifier", + name: "a", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + optional: false, + + range: [81, 90], + loc: { + start: { column: 8, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + TSNamedTupleMember { + type: "TSNamedTupleMember", + elementType: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + label: Identifier { + type: "Identifier", + name: "b", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + optional: false, + + range: [92, 101], + loc: { + start: { column: 19, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + TSNamedTupleMember { + type: "TSNamedTupleMember", + elementType: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [106, 112], + loc: { + start: { column: 33, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + label: Identifier { + type: "Identifier", + name: "c", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + optional: false, + + range: [103, 112], + loc: { + start: { column: 30, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + ], + + range: [80, 113], + loc: { + start: { column: 7, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + + range: [78, 113], + loc: { + start: { column: 5, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + + range: [77, 113], + loc: { + start: { column: 4, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + init: null, + + range: [77, 113], + loc: { + start: { column: 4, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 114], + loc: { + start: { column: 0, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 115], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..cdcbbd02ca78 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "c", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [106, 112], + loc: { + start: { column: 33, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [113, 114], + loc: { + start: { column: 40, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..99fb9783e7cf --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..9904d41a1a2b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,182 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-named AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'a', + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'b', + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [95, 101], + loc: { + start: { column: 22, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'c', + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [106, 112], + loc: { + start: { column: 33, line: 3 }, + end: { column: 39, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [112, 113], + loc: { + start: { column: 39, line: 3 }, + end: { column: 40, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [113, 114], + loc: { + start: { column: 40, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/fixture.ts new file mode 100644 index 000000000000..397b0405ee91 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let x: [string, number?, (string | number)?]; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..5036e8cb6373 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,133 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-optional TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + TSOptionalType { + type: "TSOptionalType", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [89, 96], + loc: { + start: { column: 16, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + TSOptionalType { + type: "TSOptionalType", + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + ], + + range: [99, 114], + loc: { + start: { column: 26, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + + range: [98, 116], + loc: { + start: { column: 25, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + ], + + range: [80, 117], + loc: { + start: { column: 7, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [78, 117], + loc: { + start: { column: 5, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [77, 117], + loc: { + start: { column: 4, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + init: null, + + range: [77, 117], + loc: { + start: { column: 4, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 119], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..0f1ac5a1622b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-optional TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..172d1e1a873c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/3-Babel-AST.shot @@ -0,0 +1,142 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-optional Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + TSOptionalType { + type: "TSOptionalType", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [89, 96], + loc: { + start: { column: 16, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + TSOptionalType { + type: "TSOptionalType", + typeAnnotation: TSParenthesizedType { + type: "TSParenthesizedType", + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + ], + + range: [99, 114], + loc: { + start: { column: 26, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + + range: [98, 115], + loc: { + start: { column: 25, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + + range: [98, 116], + loc: { + start: { column: 25, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + ], + + range: [80, 117], + loc: { + start: { column: 7, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [78, 117], + loc: { + start: { column: 5, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [77, 117], + loc: { + start: { column: 4, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + init: null, + + range: [77, 117], + loc: { + start: { column: 4, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 119], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..7227aaba06d7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-optional Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..92d042d52fb2 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-optional AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'x', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTupleType { + type: 'TSTupleType', + elementTypes: Array [ + TSStringKeyword { + type: 'TSStringKeyword', + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + TSOptionalType { + type: 'TSOptionalType', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [89, 96], + loc: { + start: { column: 16, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + TSOptionalType { + type: 'TSOptionalType', +- typeAnnotation: TSUnionType { +- type: 'TSUnionType', +- types: Array [ +- TSStringKeyword { +- type: 'TSStringKeyword', ++ typeAnnotation: TSParenthesizedType { ++ type: 'TSParenthesizedType', ++ typeAnnotation: TSUnionType { ++ type: 'TSUnionType', ++ types: Array [ ++ TSStringKeyword { ++ type: 'TSStringKeyword', + +- range: [99, 105], +- loc: { +- start: { column: 26, line: 3 }, +- end: { column: 32, line: 3 }, ++ range: [99, 105], ++ loc: { ++ start: { column: 26, line: 3 }, ++ end: { column: 32, line: 3 }, ++ }, + }, +- }, +- TSNumberKeyword { +- type: 'TSNumberKeyword', ++ TSNumberKeyword { ++ type: 'TSNumberKeyword', + +- range: [108, 114], +- loc: { +- start: { column: 35, line: 3 }, +- end: { column: 41, line: 3 }, ++ range: [108, 114], ++ loc: { ++ start: { column: 35, line: 3 }, ++ end: { column: 41, line: 3 }, ++ }, + }, ++ ], ++ ++ range: [99, 114], ++ loc: { ++ start: { column: 26, line: 3 }, ++ end: { column: 41, line: 3 }, + }, +- ], ++ }, + +- range: [99, 114], ++ range: [98, 115], + loc: { +- start: { column: 26, line: 3 }, +- end: { column: 41, line: 3 }, ++ start: { column: 25, line: 3 }, ++ end: { column: 42, line: 3 }, + }, + }, + + range: [98, 116], + loc: { + start: { column: 25, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + ], + + range: [80, 117], + loc: { + start: { column: 7, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [78, 117], + loc: { + start: { column: 5, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + + range: [77, 117], + loc: { + start: { column: 4, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + init: null, + + range: [77, 117], + loc: { + start: { column: 4, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + ], + kind: 'let', + + range: [73, 118], + loc: { + start: { column: 0, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 119], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..3095bf123182 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,182 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-optional AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [96, 97], + loc: { + start: { column: 23, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [99, 105], + loc: { + start: { column: 26, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '|', + + range: [106, 107], + loc: { + start: { column: 33, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [108, 114], + loc: { + start: { column: 35, line: 3 }, + end: { column: 41, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [114, 115], + loc: { + start: { column: 41, line: 3 }, + end: { column: 42, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '?', + + range: [115, 116], + loc: { + start: { column: 42, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [116, 117], + loc: { + start: { column: 43, line: 3 }, + end: { column: 44, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [117, 118], + loc: { + start: { column: 44, line: 3 }, + end: { column: 45, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/fixture.ts new file mode 100644 index 000000000000..40373b25bce5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let x: [string, ...number[]]; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..3577cb828c0f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,104 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-rest TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + TSRestType { + type: "TSRestType", + typeAnnotation: TSArrayType { + type: "TSArrayType", + elementType: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [92, 98], + loc: { + start: { column: 19, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [92, 100], + loc: { + start: { column: 19, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [89, 100], + loc: { + start: { column: 16, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + + range: [80, 101], + loc: { + start: { column: 7, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [78, 101], + loc: { + start: { column: 5, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [77, 101], + loc: { + start: { column: 4, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + init: null, + + range: [77, 101], + loc: { + start: { column: 4, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..0a5734141485 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-rest TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "...", + + range: [89, 92], + loc: { + start: { column: 16, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [92, 98], + loc: { + start: { column: 19, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..9b196dce9b5e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/3-Babel-AST.shot @@ -0,0 +1,104 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-rest Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + TSRestType { + type: "TSRestType", + typeAnnotation: TSArrayType { + type: "TSArrayType", + elementType: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [92, 98], + loc: { + start: { column: 19, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + + range: [92, 100], + loc: { + start: { column: 19, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [89, 100], + loc: { + start: { column: 16, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + + range: [80, 101], + loc: { + start: { column: 7, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [78, 101], + loc: { + start: { column: 5, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [77, 101], + loc: { + start: { column: 4, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + init: null, + + range: [77, 101], + loc: { + start: { column: 4, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..9579e04cdc0d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-rest Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "...", + + range: [89, 92], + loc: { + start: { column: 16, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [92, 98], + loc: { + start: { column: 19, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..f5b3150c2e71 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-rest AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..64dc8089180e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,132 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-rest AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '...', + + range: [89, 92], + loc: { + start: { column: 16, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [92, 98], + loc: { + start: { column: 19, line: 3 }, + end: { column: 25, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/fixture.ts new file mode 100644 index 000000000000..dea9cb7b7b25 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Foo = [string, string?]; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..5349bd45b02a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,73 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-type TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [85, 91], + loc: { + start: { column: 12, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + TSOptionalType { + type: "TSOptionalType", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [93, 99], + loc: { + start: { column: 20, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [93, 100], + loc: { + start: { column: 20, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + + range: [84, 101], + loc: { + start: { column: 11, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..7e1ce1cf174f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-type TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [85, 91], + loc: { + start: { column: 12, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [93, 99], + loc: { + start: { column: 20, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..8e4d637cbced --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/3-Babel-AST.shot @@ -0,0 +1,73 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-type Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [85, 91], + loc: { + start: { column: 12, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + TSOptionalType { + type: "TSOptionalType", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [93, 99], + loc: { + start: { column: 20, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [93, 100], + loc: { + start: { column: 20, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + + range: [84, 101], + loc: { + start: { column: 11, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + + range: [73, 102], + loc: { + start: { column: 0, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 103], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..ec7d44913700 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-type Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [85, 91], + loc: { + start: { column: 12, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [93, 99], + loc: { + start: { column: 20, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [100, 101], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [101, 102], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..861edac4e34b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-type AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..fa6b8592e157 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple-type AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/fixture.ts new file mode 100644 index 000000000000..204755c6d338 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let x: [number, number, number]; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..674810200f71 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,95 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [97, 103], + loc: { + start: { column: 24, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + + range: [80, 104], + loc: { + start: { column: 7, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [78, 104], + loc: { + start: { column: 5, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [77, 104], + loc: { + start: { column: 4, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + init: null, + + range: [77, 104], + loc: { + start: { column: 4, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..9b2d42414b16 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [97, 103], + loc: { + start: { column: 24, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..12b658861222 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/3-Babel-AST.shot @@ -0,0 +1,95 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [97, 103], + loc: { + start: { column: 24, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + ], + + range: [80, 104], + loc: { + start: { column: 7, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [78, 104], + loc: { + start: { column: 5, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + + range: [77, 104], + loc: { + start: { column: 4, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + init: null, + + range: [77, 104], + loc: { + start: { column: 4, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..ed70d59f7602 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [97, 103], + loc: { + start: { column: 24, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..9daf8bf8637f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..01bc1c8a1788 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,122 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types tuple AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '[', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [89, 95], + loc: { + start: { column: 16, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [97, 103], + loc: { + start: { column: 24, line: 3 }, + end: { column: 30, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ']', + + range: [103, 104], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [104, 105], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/fixture.ts new file mode 100644 index 000000000000..2fde8ef41f25 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let obj: { x: number }; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..9b45172d796a --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types type-literal TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "obj", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "x", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [87, 93], + loc: { + start: { column: 14, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [84, 93], + loc: { + start: { column: 11, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + + range: [82, 95], + loc: { + start: { column: 9, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [80, 95], + loc: { + start: { column: 7, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [77, 95], + loc: { + start: { column: 4, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + init: null, + + range: [77, 95], + loc: { + start: { column: 4, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 96], + loc: { + start: { column: 0, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 97], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..3dfb334346c5 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types type-literal TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "obj", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [87, 93], + loc: { + start: { column: 14, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..a88ef47daa45 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/3-Babel-AST.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types type-literal Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "obj", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "x", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [87, 93], + loc: { + start: { column: 14, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [85, 93], + loc: { + start: { column: 12, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [84, 93], + loc: { + start: { column: 11, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + + range: [82, 95], + loc: { + start: { column: 9, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [80, 95], + loc: { + start: { column: 7, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + + range: [77, 95], + loc: { + start: { column: 4, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + init: null, + + range: [77, 95], + loc: { + start: { column: 4, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 96], + loc: { + start: { column: 0, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 97], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..0e26849ea696 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types type-literal Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "obj", + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [87, 93], + loc: { + start: { column: 14, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..f7e7f8866014 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types type-literal AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..c342a02e96df --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,102 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types type-literal AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'obj', + + range: [77, 80], + loc: { + start: { column: 4, line: 3 }, + end: { column: 7, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [84, 85], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [85, 86], + loc: { + start: { column: 12, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [87, 93], + loc: { + start: { column: 14, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/fixture.ts new file mode 100644 index 000000000000..3660dae83bce --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/fixture.ts @@ -0,0 +1,4 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let x: keyof T; +let y: unique symbol; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..66c567c2304d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types type-operator TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeOperator { + type: "TSTypeOperator", + operator: "keyof", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [80, 87], + loc: { + start: { column: 7, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [78, 87], + loc: { + start: { column: 5, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [77, 87], + loc: { + start: { column: 4, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + init: null, + + range: [77, 87], + loc: { + start: { column: 4, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 88], + loc: { + start: { column: 0, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "y", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeOperator { + type: "TSTypeOperator", + operator: "unique", + typeAnnotation: TSSymbolKeyword { + type: "TSSymbolKeyword", + + range: [103, 109], + loc: { + start: { column: 14, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [96, 109], + loc: { + start: { column: 7, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [94, 109], + loc: { + start: { column: 5, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [93, 109], + loc: { + start: { column: 4, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + init: null, + + range: [93, 109], + loc: { + start: { column: 4, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + kind: "let", + + range: [89, 110], + loc: { + start: { column: 0, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 111], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..622050dd3f87 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types type-operator TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "keyof", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "let", + + range: [89, 92], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "y", + + range: [93, 94], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [94, 95], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "unique", + + range: [96, 102], + loc: { + start: { column: 7, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "symbol", + + range: [103, 109], + loc: { + start: { column: 14, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [109, 110], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..b5adcfa7fcb1 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/3-Babel-AST.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types type-operator Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeOperator { + type: "TSTypeOperator", + operator: "keyof", + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [80, 87], + loc: { + start: { column: 7, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [78, 87], + loc: { + start: { column: 5, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + + range: [77, 87], + loc: { + start: { column: 4, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + init: null, + + range: [77, 87], + loc: { + start: { column: 4, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 88], + loc: { + start: { column: 0, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "y", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeOperator { + type: "TSTypeOperator", + operator: "unique", + typeAnnotation: TSSymbolKeyword { + type: "TSSymbolKeyword", + + range: [103, 109], + loc: { + start: { column: 14, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [96, 109], + loc: { + start: { column: 7, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [94, 109], + loc: { + start: { column: 5, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [93, 109], + loc: { + start: { column: 4, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + init: null, + + range: [93, 109], + loc: { + start: { column: 4, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + ], + kind: "let", + + range: [89, 110], + loc: { + start: { column: 0, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 111], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..abbbeabb5075 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types type-operator Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "keyof", + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "let", + + range: [89, 92], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "y", + + range: [93, 94], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [94, 95], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "unique", + + range: [96, 102], + loc: { + start: { column: 7, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "symbol", + + range: [103, 109], + loc: { + start: { column: 14, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [109, 110], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..ae11f119f07d --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types type-operator AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..0447c69e1c2f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,134 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types type-operator AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'keyof', + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [86, 87], + loc: { + start: { column: 13, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [89, 92], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'y', + + range: [93, 94], + loc: { + start: { column: 4, line: 4 }, + end: { column: 5, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [94, 95], + loc: { + start: { column: 5, line: 4 }, + end: { column: 6, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'unique', + + range: [96, 102], + loc: { + start: { column: 7, line: 4 }, + end: { column: 13, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'symbol', + + range: [103, 109], + loc: { + start: { column: 14, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [109, 110], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/fixture.ts new file mode 100644 index 000000000000..c51dd58ef3cc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/fixture.ts @@ -0,0 +1,4 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let self: typeof this; +let foo: typeof this.foo; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..7a8b4111b0dc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,153 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types typeof-this TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "self", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeQuery { + type: "TSTypeQuery", + exprName: ThisExpression { + type: "ThisExpression", + + range: [90, 94], + loc: { + start: { column: 17, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [83, 94], + loc: { + start: { column: 10, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [81, 94], + loc: { + start: { column: 8, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [77, 94], + loc: { + start: { column: 4, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + init: null, + + range: [77, 94], + loc: { + start: { column: 4, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "foo", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeQuery { + type: "TSTypeQuery", + exprName: TSQualifiedName { + type: "TSQualifiedName", + left: ThisExpression { + type: "ThisExpression", + + range: [112, 116], + loc: { + start: { column: 16, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + right: Identifier { + type: "Identifier", + name: "foo", + + range: [117, 120], + loc: { + start: { column: 21, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [112, 120], + loc: { + start: { column: 16, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [105, 120], + loc: { + start: { column: 9, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [103, 120], + loc: { + start: { column: 7, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [100, 120], + loc: { + start: { column: 4, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + init: null, + + range: [100, 120], + loc: { + start: { column: 4, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + ], + kind: "let", + + range: [96, 121], + loc: { + start: { column: 0, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..504d48d07595 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types typeof-this TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "self", + + range: [77, 81], + loc: { + start: { column: 4, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "typeof", + + range: [83, 89], + loc: { + start: { column: 10, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [90, 94], + loc: { + start: { column: 17, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "let", + + range: [96, 99], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [100, 103], + loc: { + start: { column: 4, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [103, 104], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "typeof", + + range: [105, 111], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "this", + + range: [112, 116], + loc: { + start: { column: 16, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [116, 117], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [117, 120], + loc: { + start: { column: 21, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [120, 121], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..ac5fb2d72e3b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/3-Babel-AST.shot @@ -0,0 +1,155 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types typeof-this Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "self", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeQuery { + type: "TSTypeQuery", + exprName: Identifier { + type: "Identifier", + name: "this", + + range: [90, 94], + loc: { + start: { column: 17, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [83, 94], + loc: { + start: { column: 10, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [81, 94], + loc: { + start: { column: 8, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [77, 94], + loc: { + start: { column: 4, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + init: null, + + range: [77, 94], + loc: { + start: { column: 4, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "foo", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeQuery { + type: "TSTypeQuery", + exprName: TSQualifiedName { + type: "TSQualifiedName", + left: Identifier { + type: "Identifier", + name: "this", + + range: [112, 116], + loc: { + start: { column: 16, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + right: Identifier { + type: "Identifier", + name: "foo", + + range: [117, 120], + loc: { + start: { column: 21, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [112, 120], + loc: { + start: { column: 16, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [105, 120], + loc: { + start: { column: 9, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [103, 120], + loc: { + start: { column: 7, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [100, 120], + loc: { + start: { column: 4, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + init: null, + + range: [100, 120], + loc: { + start: { column: 4, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + ], + kind: "let", + + range: [96, 121], + loc: { + start: { column: 0, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + ], + sourceType: "script", + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..9d99f0c92e32 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types typeof-this Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "self", + + range: [77, 81], + loc: { + start: { column: 4, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "typeof", + + range: [83, 89], + loc: { + start: { column: 10, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "this", + + range: [90, 94], + loc: { + start: { column: 17, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "let", + + range: [96, 99], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [100, 103], + loc: { + start: { column: 4, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [103, 104], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "typeof", + + range: [105, 111], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "this", + + range: [112, 116], + loc: { + start: { column: 16, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [116, 117], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [117, 120], + loc: { + start: { column: 21, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [120, 121], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..742698e35d82 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,163 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types typeof-this AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'self', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeQuery { + type: 'TSTypeQuery', +- exprName: ThisExpression { +- type: 'ThisExpression', ++ exprName: Identifier { ++ type: 'Identifier', ++ name: 'this', + + range: [90, 94], + loc: { + start: { column: 17, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [83, 94], + loc: { + start: { column: 10, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [81, 94], + loc: { + start: { column: 8, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + + range: [77, 94], + loc: { + start: { column: 4, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + init: null, + + range: [77, 94], + loc: { + start: { column: 4, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + kind: 'let', + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'foo', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSTypeQuery { + type: 'TSTypeQuery', + exprName: TSQualifiedName { + type: 'TSQualifiedName', +- left: ThisExpression { +- type: 'ThisExpression', ++ left: Identifier { ++ type: 'Identifier', ++ name: 'this', + + range: [112, 116], + loc: { + start: { column: 16, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + right: Identifier { + type: 'Identifier', + name: 'foo', + + range: [117, 120], + loc: { + start: { column: 21, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [112, 120], + loc: { + start: { column: 16, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [105, 120], + loc: { + start: { column: 9, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [103, 120], + loc: { + start: { column: 7, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + + range: [100, 120], + loc: { + start: { column: 4, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + init: null, + + range: [100, 120], + loc: { + start: { column: 4, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + ], + kind: 'let', + + range: [96, 121], + loc: { + start: { column: 0, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 122], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 5 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..fac88176603f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,158 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types typeof-this AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'self', + + range: [77, 81], + loc: { + start: { column: 4, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [81, 82], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'typeof', + + range: [83, 89], + loc: { + start: { column: 10, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'this', + + range: [90, 94], + loc: { + start: { column: 17, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [94, 95], + loc: { + start: { column: 21, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [96, 99], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'foo', + + range: [100, 103], + loc: { + start: { column: 4, line: 4 }, + end: { column: 7, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [103, 104], + loc: { + start: { column: 7, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'typeof', + + range: [105, 111], + loc: { + start: { column: 9, line: 4 }, + end: { column: 15, line: 4 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'this', + + range: [112, 116], + loc: { + start: { column: 16, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '.', + + range: [116, 117], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'foo', + + range: [117, 120], + loc: { + start: { column: 21, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [120, 121], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/fixture.ts new file mode 100644 index 000000000000..5c399ffc5c07 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let x: typeof y.z; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..95aaa57fb37f --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,125 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types typeof-with-type-parameters TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeQuery { + type: "TSTypeQuery", + exprName: TSQualifiedName { + type: "TSQualifiedName", + left: Identifier { + type: "Identifier", + name: "y", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + right: Identifier { + type: "Identifier", + name: "z", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "w", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ], + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [80, 93], + loc: { + start: { column: 7, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [78, 93], + loc: { + start: { column: 5, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [77, 93], + loc: { + start: { column: 4, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + init: null, + + range: [77, 93], + loc: { + start: { column: 4, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..62cf9c2c52a7 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types typeof-with-type-parameters TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "typeof", + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "y", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "z", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "w", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..7b2d01aa6442 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/3-Babel-AST.shot @@ -0,0 +1,125 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types typeof-with-type-parameters Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeQuery { + type: "TSTypeQuery", + exprName: TSQualifiedName { + type: "TSQualifiedName", + left: Identifier { + type: "Identifier", + name: "y", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + right: Identifier { + type: "Identifier", + name: "z", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "w", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + ], + + range: [90, 93], + loc: { + start: { column: 17, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [80, 93], + loc: { + start: { column: 7, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [78, 93], + loc: { + start: { column: 5, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + + range: [77, 93], + loc: { + start: { column: 4, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + init: null, + + range: [77, 93], + loc: { + start: { column: 4, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..58e5c37dd22e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types typeof-with-type-parameters Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "typeof", + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "y", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "z", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "w", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..1ad2b5d62c40 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types typeof-with-type-parameters AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..439effa84184 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,122 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types typeof-with-type-parameters AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'typeof', + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'y', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '.', + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'z', + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'w', + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [92, 93], + loc: { + start: { column: 19, line: 3 }, + end: { column: 20, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [93, 94], + loc: { + start: { column: 20, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/fixture.ts new file mode 100644 index 000000000000..2c6b58071bbc --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let x: typeof y.z; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..94086e9e3212 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,95 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types typeof TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeQuery { + type: "TSTypeQuery", + exprName: TSQualifiedName { + type: "TSQualifiedName", + left: Identifier { + type: "Identifier", + name: "y", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + right: Identifier { + type: "Identifier", + name: "z", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [80, 90], + loc: { + start: { column: 7, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [78, 90], + loc: { + start: { column: 5, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [77, 90], + loc: { + start: { column: 4, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + init: null, + + range: [77, 90], + loc: { + start: { column: 4, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..0d70b6e07451 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types typeof TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "typeof", + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "y", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "z", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..cfbb75087901 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/3-Babel-AST.shot @@ -0,0 +1,95 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types typeof Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSTypeQuery { + type: "TSTypeQuery", + exprName: TSQualifiedName { + type: "TSQualifiedName", + left: Identifier { + type: "Identifier", + name: "y", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + right: Identifier { + type: "Identifier", + name: "z", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [87, 90], + loc: { + start: { column: 14, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [80, 90], + loc: { + start: { column: 7, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [78, 90], + loc: { + start: { column: 5, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + + range: [77, 90], + loc: { + start: { column: 4, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + init: null, + + range: [77, 90], + loc: { + start: { column: 4, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 91], + loc: { + start: { column: 0, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 92], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..c171e99131c6 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types typeof Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "typeof", + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "y", + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ".", + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "z", + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..27f2e96b44e8 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types typeof AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..ac369cf300af --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,92 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types typeof AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'x', + + range: [77, 78], + loc: { + start: { column: 4, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [78, 79], + loc: { + start: { column: 5, line: 3 }, + end: { column: 6, line: 3 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'typeof', + + range: [80, 86], + loc: { + start: { column: 7, line: 3 }, + end: { column: 13, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'y', + + range: [87, 88], + loc: { + start: { column: 14, line: 3 }, + end: { column: 15, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '.', + + range: [88, 89], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'z', + + range: [89, 90], + loc: { + start: { column: 16, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [90, 91], + loc: { + start: { column: 17, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/fixture.ts new file mode 100644 index 000000000000..81007df0419c --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/fixture.ts @@ -0,0 +1,6 @@ +// TODO: This fixture might be too large, and if so should be split up. + +let union: number | null | undefined; +let intersection: number & string; +let precedence1: number | (string & boolean); +let precedence2: (number & string) | boolean; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..22265118d1ff --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,345 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types union-intersection TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "union", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + TSNullKeyword { + type: "TSNullKeyword", + + range: [93, 97], + loc: { + start: { column: 20, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + TSUndefinedKeyword { + type: "TSUndefinedKeyword", + + range: [100, 109], + loc: { + start: { column: 27, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + + range: [84, 109], + loc: { + start: { column: 11, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [82, 109], + loc: { + start: { column: 9, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [77, 109], + loc: { + start: { column: 4, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + init: null, + + range: [77, 109], + loc: { + start: { column: 4, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "intersection", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSIntersectionType { + type: "TSIntersectionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [129, 135], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + TSStringKeyword { + type: "TSStringKeyword", + + range: [138, 144], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + + range: [129, 144], + loc: { + start: { column: 18, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [127, 144], + loc: { + start: { column: 16, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [115, 144], + loc: { + start: { column: 4, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + init: null, + + range: [115, 144], + loc: { + start: { column: 4, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + kind: "let", + + range: [111, 145], + loc: { + start: { column: 0, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "precedence1", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [163, 169], + loc: { + start: { column: 17, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + TSIntersectionType { + type: "TSIntersectionType", + types: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [173, 179], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [182, 189], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + ], + + range: [173, 189], + loc: { + start: { column: 27, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + ], + + range: [163, 190], + loc: { + start: { column: 17, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + + range: [161, 190], + loc: { + start: { column: 15, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + + range: [150, 190], + loc: { + start: { column: 4, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + init: null, + + range: [150, 190], + loc: { + start: { column: 4, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + ], + kind: "let", + + range: [146, 191], + loc: { + start: { column: 0, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "precedence2", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSIntersectionType { + type: "TSIntersectionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [210, 216], + loc: { + start: { column: 18, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + TSStringKeyword { + type: "TSStringKeyword", + + range: [219, 225], + loc: { + start: { column: 27, line: 6 }, + end: { column: 33, line: 6 }, + }, + }, + ], + + range: [210, 225], + loc: { + start: { column: 18, line: 6 }, + end: { column: 33, line: 6 }, + }, + }, + TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [229, 236], + loc: { + start: { column: 37, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + ], + + range: [209, 236], + loc: { + start: { column: 17, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + + range: [207, 236], + loc: { + start: { column: 15, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + + range: [196, 236], + loc: { + start: { column: 4, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + init: null, + + range: [196, 236], + loc: { + start: { column: 4, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + ], + kind: "let", + + range: [192, 237], + loc: { + start: { column: 0, line: 6 }, + end: { column: 45, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 238], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..4451c3d6aee3 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,386 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types union-intersection TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "union", + + range: [77, 82], + loc: { + start: { column: 4, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "null", + + range: [93, 97], + loc: { + start: { column: 20, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "undefined", + + range: [100, 109], + loc: { + start: { column: 27, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "let", + + range: [111, 114], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "intersection", + + range: [115, 127], + loc: { + start: { column: 4, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [127, 128], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [129, 135], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&", + + range: [136, 137], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [138, 144], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [144, 145], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "let", + + range: [146, 149], + loc: { + start: { column: 0, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "precedence1", + + range: [150, 161], + loc: { + start: { column: 4, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [161, 162], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [163, 169], + loc: { + start: { column: 17, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [170, 171], + loc: { + start: { column: 24, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [172, 173], + loc: { + start: { column: 26, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [173, 179], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&", + + range: [180, 181], + loc: { + start: { column: 34, line: 5 }, + end: { column: 35, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [182, 189], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [189, 190], + loc: { + start: { column: 43, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [190, 191], + loc: { + start: { column: 44, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + Keyword { + type: "Keyword", + value: "let", + + range: [192, 195], + loc: { + start: { column: 0, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "precedence2", + + range: [196, 207], + loc: { + start: { column: 4, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [207, 208], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [209, 210], + loc: { + start: { column: 17, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [210, 216], + loc: { + start: { column: 18, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&", + + range: [217, 218], + loc: { + start: { column: 25, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [219, 225], + loc: { + start: { column: 27, line: 6 }, + end: { column: 33, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [225, 226], + loc: { + start: { column: 33, line: 6 }, + end: { column: 34, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [227, 228], + loc: { + start: { column: 35, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [229, 236], + loc: { + start: { column: 37, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [236, 237], + loc: { + start: { column: 44, line: 6 }, + end: { column: 45, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..1e1857f742a0 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/3-Babel-AST.shot @@ -0,0 +1,363 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types union-intersection Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "union", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + TSNullKeyword { + type: "TSNullKeyword", + + range: [93, 97], + loc: { + start: { column: 20, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + TSUndefinedKeyword { + type: "TSUndefinedKeyword", + + range: [100, 109], + loc: { + start: { column: 27, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + + range: [84, 109], + loc: { + start: { column: 11, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [82, 109], + loc: { + start: { column: 9, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [77, 109], + loc: { + start: { column: 4, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + init: null, + + range: [77, 109], + loc: { + start: { column: 4, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + kind: "let", + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "intersection", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSIntersectionType { + type: "TSIntersectionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [129, 135], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + TSStringKeyword { + type: "TSStringKeyword", + + range: [138, 144], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + + range: [129, 144], + loc: { + start: { column: 18, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [127, 144], + loc: { + start: { column: 16, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [115, 144], + loc: { + start: { column: 4, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + init: null, + + range: [115, 144], + loc: { + start: { column: 4, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + kind: "let", + + range: [111, 145], + loc: { + start: { column: 0, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "precedence1", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [163, 169], + loc: { + start: { column: 17, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + TSParenthesizedType { + type: "TSParenthesizedType", + typeAnnotation: TSIntersectionType { + type: "TSIntersectionType", + types: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [173, 179], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [182, 189], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + ], + + range: [173, 189], + loc: { + start: { column: 27, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + + range: [172, 190], + loc: { + start: { column: 26, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + ], + + range: [163, 190], + loc: { + start: { column: 17, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + + range: [161, 190], + loc: { + start: { column: 15, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + + range: [150, 190], + loc: { + start: { column: 4, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + init: null, + + range: [150, 190], + loc: { + start: { column: 4, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + ], + kind: "let", + + range: [146, 191], + loc: { + start: { column: 0, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "precedence2", + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSUnionType { + type: "TSUnionType", + types: Array [ + TSParenthesizedType { + type: "TSParenthesizedType", + typeAnnotation: TSIntersectionType { + type: "TSIntersectionType", + types: Array [ + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [210, 216], + loc: { + start: { column: 18, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + TSStringKeyword { + type: "TSStringKeyword", + + range: [219, 225], + loc: { + start: { column: 27, line: 6 }, + end: { column: 33, line: 6 }, + }, + }, + ], + + range: [210, 225], + loc: { + start: { column: 18, line: 6 }, + end: { column: 33, line: 6 }, + }, + }, + + range: [209, 226], + loc: { + start: { column: 17, line: 6 }, + end: { column: 34, line: 6 }, + }, + }, + TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [229, 236], + loc: { + start: { column: 37, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + ], + + range: [209, 236], + loc: { + start: { column: 17, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + + range: [207, 236], + loc: { + start: { column: 15, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + + range: [196, 236], + loc: { + start: { column: 4, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + init: null, + + range: [196, 236], + loc: { + start: { column: 4, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + ], + kind: "let", + + range: [192, 237], + loc: { + start: { column: 0, line: 6 }, + end: { column: 45, line: 6 }, + }, + }, + ], + sourceType: "script", + + range: [73, 238], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..34dd032c8759 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,386 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types union-intersection Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "let", + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "union", + + range: [77, 82], + loc: { + start: { column: 4, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Null { + type: "Null", + value: "null", + + range: [93, 97], + loc: { + start: { column: 20, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "undefined", + + range: [100, 109], + loc: { + start: { column: 27, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "let", + + range: [111, 114], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "intersection", + + range: [115, 127], + loc: { + start: { column: 4, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [127, 128], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [129, 135], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&", + + range: [136, 137], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [138, 144], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [144, 145], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "let", + + range: [146, 149], + loc: { + start: { column: 0, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "precedence1", + + range: [150, 161], + loc: { + start: { column: 4, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [161, 162], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [163, 169], + loc: { + start: { column: 17, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [170, 171], + loc: { + start: { column: 24, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [172, 173], + loc: { + start: { column: 26, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [173, 179], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&", + + range: [180, 181], + loc: { + start: { column: 34, line: 5 }, + end: { column: 35, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [182, 189], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [189, 190], + loc: { + start: { column: 43, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [190, 191], + loc: { + start: { column: 44, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + Identifier { + type: "Identifier", + value: "let", + + range: [192, 195], + loc: { + start: { column: 0, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "precedence2", + + range: [196, 207], + loc: { + start: { column: 4, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [207, 208], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [209, 210], + loc: { + start: { column: 17, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [210, 216], + loc: { + start: { column: 18, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&", + + range: [217, 218], + loc: { + start: { column: 25, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [219, 225], + loc: { + start: { column: 27, line: 6 }, + end: { column: 33, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [225, 226], + loc: { + start: { column: 33, line: 6 }, + end: { column: 34, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "|", + + range: [227, 228], + loc: { + start: { column: 35, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [229, 236], + loc: { + start: { column: 37, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [236, 237], + loc: { + start: { column: 44, line: 6 }, + end: { column: 45, line: 6 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..ab9ae31400d4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,407 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types union-intersection AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'union', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSUnionType { + type: 'TSUnionType', + types: Array [ + TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + TSNullKeyword { + type: 'TSNullKeyword', + + range: [93, 97], + loc: { + start: { column: 20, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + TSUndefinedKeyword { + type: 'TSUndefinedKeyword', + + range: [100, 109], + loc: { + start: { column: 27, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + + range: [84, 109], + loc: { + start: { column: 11, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [82, 109], + loc: { + start: { column: 9, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + + range: [77, 109], + loc: { + start: { column: 4, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + init: null, + + range: [77, 109], + loc: { + start: { column: 4, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + ], + kind: 'let', + + range: [73, 110], + loc: { + start: { column: 0, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'intersection', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSIntersectionType { + type: 'TSIntersectionType', + types: Array [ + TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [129, 135], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + TSStringKeyword { + type: 'TSStringKeyword', + + range: [138, 144], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + + range: [129, 144], + loc: { + start: { column: 18, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [127, 144], + loc: { + start: { column: 16, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + + range: [115, 144], + loc: { + start: { column: 4, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + init: null, + + range: [115, 144], + loc: { + start: { column: 4, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + ], + kind: 'let', + + range: [111, 145], + loc: { + start: { column: 0, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'precedence1', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSUnionType { + type: 'TSUnionType', + types: Array [ + TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [163, 169], + loc: { + start: { column: 17, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, +- TSIntersectionType { +- type: 'TSIntersectionType', +- types: Array [ +- TSStringKeyword { +- type: 'TSStringKeyword', ++ TSParenthesizedType { ++ type: 'TSParenthesizedType', ++ typeAnnotation: TSIntersectionType { ++ type: 'TSIntersectionType', ++ types: Array [ ++ TSStringKeyword { ++ type: 'TSStringKeyword', + +- range: [173, 179], +- loc: { +- start: { column: 27, line: 5 }, +- end: { column: 33, line: 5 }, ++ range: [173, 179], ++ loc: { ++ start: { column: 27, line: 5 }, ++ end: { column: 33, line: 5 }, ++ }, + }, +- }, +- TSBooleanKeyword { +- type: 'TSBooleanKeyword', ++ TSBooleanKeyword { ++ type: 'TSBooleanKeyword', + +- range: [182, 189], +- loc: { +- start: { column: 36, line: 5 }, +- end: { column: 43, line: 5 }, ++ range: [182, 189], ++ loc: { ++ start: { column: 36, line: 5 }, ++ end: { column: 43, line: 5 }, ++ }, + }, ++ ], ++ ++ range: [173, 189], ++ loc: { ++ start: { column: 27, line: 5 }, ++ end: { column: 43, line: 5 }, + }, +- ], ++ }, + +- range: [173, 189], ++ range: [172, 190], + loc: { +- start: { column: 27, line: 5 }, +- end: { column: 43, line: 5 }, ++ start: { column: 26, line: 5 }, ++ end: { column: 44, line: 5 }, + }, + }, + ], + + range: [163, 190], + loc: { + start: { column: 17, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + + range: [161, 190], + loc: { + start: { column: 15, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + + range: [150, 190], + loc: { + start: { column: 4, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + init: null, + + range: [150, 190], + loc: { + start: { column: 4, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + ], + kind: 'let', + + range: [146, 191], + loc: { + start: { column: 0, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, + VariableDeclaration { + type: 'VariableDeclaration', + declarations: Array [ + VariableDeclarator { + type: 'VariableDeclarator', + id: Identifier { + type: 'Identifier', + name: 'precedence2', + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSUnionType { + type: 'TSUnionType', + types: Array [ +- TSIntersectionType { +- type: 'TSIntersectionType', +- types: Array [ +- TSNumberKeyword { +- type: 'TSNumberKeyword', ++ TSParenthesizedType { ++ type: 'TSParenthesizedType', ++ typeAnnotation: TSIntersectionType { ++ type: 'TSIntersectionType', ++ types: Array [ ++ TSNumberKeyword { ++ type: 'TSNumberKeyword', + +- range: [210, 216], +- loc: { +- start: { column: 18, line: 6 }, +- end: { column: 24, line: 6 }, ++ range: [210, 216], ++ loc: { ++ start: { column: 18, line: 6 }, ++ end: { column: 24, line: 6 }, ++ }, + }, +- }, +- TSStringKeyword { +- type: 'TSStringKeyword', ++ TSStringKeyword { ++ type: 'TSStringKeyword', + +- range: [219, 225], +- loc: { +- start: { column: 27, line: 6 }, +- end: { column: 33, line: 6 }, ++ range: [219, 225], ++ loc: { ++ start: { column: 27, line: 6 }, ++ end: { column: 33, line: 6 }, ++ }, + }, ++ ], ++ ++ range: [210, 225], ++ loc: { ++ start: { column: 18, line: 6 }, ++ end: { column: 33, line: 6 }, + }, +- ], ++ }, + +- range: [210, 225], ++ range: [209, 226], + loc: { +- start: { column: 18, line: 6 }, +- end: { column: 33, line: 6 }, ++ start: { column: 17, line: 6 }, ++ end: { column: 34, line: 6 }, + }, + }, + TSBooleanKeyword { + type: 'TSBooleanKeyword', + + range: [229, 236], + loc: { + start: { column: 37, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + ], + + range: [209, 236], + loc: { + start: { column: 17, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + + range: [207, 236], + loc: { + start: { column: 15, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + + range: [196, 236], + loc: { + start: { column: 4, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + init: null, + + range: [196, 236], + loc: { + start: { column: 4, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + ], + kind: 'let', + + range: [192, 237], + loc: { + start: { column: 0, line: 6 }, + end: { column: 45, line: 6 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 238], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..d3ce54064927 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,400 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types union-intersection AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [73, 76], + loc: { + start: { column: 0, line: 3 }, + end: { column: 3, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'union', + + range: [77, 82], + loc: { + start: { column: 4, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '|', + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Null { ++ type: 'Null', + value: 'null', + + range: [93, 97], + loc: { + start: { column: 20, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '|', + + range: [98, 99], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'undefined', + + range: [100, 109], + loc: { + start: { column: 27, line: 3 }, + end: { column: 36, line: 3 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [109, 110], + loc: { + start: { column: 36, line: 3 }, + end: { column: 37, line: 3 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [111, 114], + loc: { + start: { column: 0, line: 4 }, + end: { column: 3, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'intersection', + + range: [115, 127], + loc: { + start: { column: 4, line: 4 }, + end: { column: 16, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [127, 128], + loc: { + start: { column: 16, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [129, 135], + loc: { + start: { column: 18, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '&', + + range: [136, 137], + loc: { + start: { column: 25, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [138, 144], + loc: { + start: { column: 27, line: 4 }, + end: { column: 33, line: 4 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [144, 145], + loc: { + start: { column: 33, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [146, 149], + loc: { + start: { column: 0, line: 5 }, + end: { column: 3, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'precedence1', + + range: [150, 161], + loc: { + start: { column: 4, line: 5 }, + end: { column: 15, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [161, 162], + loc: { + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [163, 169], + loc: { + start: { column: 17, line: 5 }, + end: { column: 23, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '|', + + range: [170, 171], + loc: { + start: { column: 24, line: 5 }, + end: { column: 25, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [172, 173], + loc: { + start: { column: 26, line: 5 }, + end: { column: 27, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [173, 179], + loc: { + start: { column: 27, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '&', + + range: [180, 181], + loc: { + start: { column: 34, line: 5 }, + end: { column: 35, line: 5 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'boolean', + + range: [182, 189], + loc: { + start: { column: 36, line: 5 }, + end: { column: 43, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [189, 190], + loc: { + start: { column: 43, line: 5 }, + end: { column: 44, line: 5 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [190, 191], + loc: { + start: { column: 44, line: 5 }, + end: { column: 45, line: 5 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'let', + + range: [192, 195], + loc: { + start: { column: 0, line: 6 }, + end: { column: 3, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'precedence2', + + range: [196, 207], + loc: { + start: { column: 4, line: 6 }, + end: { column: 15, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ':', + + range: [207, 208], + loc: { + start: { column: 15, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '(', + + range: [209, 210], + loc: { + start: { column: 17, line: 6 }, + end: { column: 18, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'number', + + range: [210, 216], + loc: { + start: { column: 18, line: 6 }, + end: { column: 24, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '&', + + range: [217, 218], + loc: { + start: { column: 25, line: 6 }, + end: { column: 26, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'string', + + range: [219, 225], + loc: { + start: { column: 27, line: 6 }, + end: { column: 33, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ')', + + range: [225, 226], + loc: { + start: { column: 33, line: 6 }, + end: { column: 34, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '|', + + range: [227, 228], + loc: { + start: { column: 35, line: 6 }, + end: { column: 36, line: 6 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'boolean', + + range: [229, 236], + loc: { + start: { column: 37, line: 6 }, + end: { column: 44, line: 6 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [236, 237], + loc: { + start: { column: 44, line: 6 }, + end: { column: 45, line: 6 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/fixture.ts b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/fixture.ts new file mode 100644 index 000000000000..6ae2c8128904 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +type Foo = string & number; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..e96cd3e66744 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,64 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types union-type TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSIntersectionType { + type: "TSIntersectionType", + types: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [93, 99], + loc: { + start: { column: 20, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + + range: [84, 99], + loc: { + start: { column: 11, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..f45ec2978a67 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types union-type TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [93, 99], + loc: { + start: { column: 20, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..60917914e54e --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/3-Babel-AST.shot @@ -0,0 +1,64 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types union-type Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeAnnotation: TSIntersectionType { + type: "TSIntersectionType", + types: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + TSNumberKeyword { + type: "TSNumberKeyword", + + range: [93, 99], + loc: { + start: { column: 20, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + + range: [84, 99], + loc: { + start: { column: 11, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [73, 100], + loc: { + start: { column: 0, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [73, 101], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..084fdec7fb33 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types union-type Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "type", + + range: [73, 77], + loc: { + start: { column: 0, line: 3 }, + end: { column: 4, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [78, 81], + loc: { + start: { column: 5, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [84, 90], + loc: { + start: { column: 11, line: 3 }, + end: { column: 17, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "&", + + range: [91, 92], + loc: { + start: { column: 18, line: 3 }, + end: { column: 19, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [93, 99], + loc: { + start: { column: 20, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [99, 100], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..9bf8457567f4 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types union-type AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..9c6a6333543b --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures types union-type AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/tests/fixtures-with-differences-ast.shot b/packages/ast-spec/tests/fixtures-with-differences-ast.shot index 233fc7f4f95e..1f4ef6902086 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-ast.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-ast.shot @@ -43,5 +43,180 @@ Set { "element/AccessorProperty/fixtures/with-annotation-no-value/fixture.ts", "element/AccessorProperty/fixtures/with-annotation-with-value/fixture.ts", "expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/fixture.ts", + "legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/fixture.ts", + "legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/fixture.ts", + "legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/fixture.ts", + "legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/fixture.ts", + "legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/fixture.ts", + "legacy-fixtures/babylon-convergence/fixtures/type-parameters/fixture.ts", + "legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/fixture.ts", + "legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/fixture.ts", + "legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/fixture.ts", + "legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/fixture.ts", + "legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/fixture.ts", + "legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/fixture.ts", + "legacy-fixtures/basics/fixtures/abstract-class-with-override-method/fixture.ts", + "legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/fixture.ts", + "legacy-fixtures/basics/fixtures/call-signatures-with-generics/fixture.ts", + "legacy-fixtures/basics/fixtures/call-signatures/fixture.ts", + "legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/fixture.ts", + "legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/fixture.ts", + "legacy-fixtures/basics/fixtures/class-static-blocks/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-declare-properties/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-definite-assignment/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-extends-and-implements/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-extends-generic/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-generic-method-default/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-generic-method/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-implements-generic/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-implements/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-method/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-mixin-reference/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-mixin/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-optional-computed-method/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-optional-computed-property/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-optional-methods/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-optional-properties/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-override-property/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-private-optional-property/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-property-function/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-property-values/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-readonly-property/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-type-parameter-default/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-type-parameter/fixture.ts", + "legacy-fixtures/basics/fixtures/declare-class-with-optional-method/fixture.ts", + "legacy-fixtures/basics/fixtures/directive-in-module/fixture.ts", + "legacy-fixtures/basics/fixtures/directive-in-namespace/fixture.ts", + "legacy-fixtures/basics/fixtures/export-assignment/fixture.ts", + "legacy-fixtures/basics/fixtures/export-declare-const-named-enum/fixture.ts", + "legacy-fixtures/basics/fixtures/export-declare-named-enum/fixture.ts", + "legacy-fixtures/basics/fixtures/export-default-class-with-generic/fixture.ts", + "legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/fixture.ts", + "legacy-fixtures/basics/fixtures/export-default-interface/fixture.ts", + "legacy-fixtures/basics/fixtures/export-named-class-with-generic/fixture.ts", + "legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/fixture.ts", + "legacy-fixtures/basics/fixtures/export-type-as/fixture.ts", + "legacy-fixtures/basics/fixtures/export-type-from-as/fixture.ts", + "legacy-fixtures/basics/fixtures/export-type-from/fixture.ts", + "legacy-fixtures/basics/fixtures/export-type/fixture.ts", + "legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/fixture.ts", + "legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/fixture.ts", + "legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/fixture.ts", + "legacy-fixtures/basics/fixtures/function-with-type-parameters/fixture.ts", + "legacy-fixtures/basics/fixtures/import-equal-declaration/fixture.ts", + "legacy-fixtures/basics/fixtures/import-equal-type-declaration/fixture.ts", + "legacy-fixtures/basics/fixtures/import-export-equal-declaration/fixture.ts", + "legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/fixture.ts", + "legacy-fixtures/basics/fixtures/import-type-default/fixture.ts", + "legacy-fixtures/basics/fixtures/import-type-named-as/fixture.ts", + "legacy-fixtures/basics/fixtures/import-type-named/fixture.ts", + "legacy-fixtures/basics/fixtures/import-type-star-as-ns/fixture.ts", + "legacy-fixtures/basics/fixtures/interface-extends-multiple/fixture.ts", + "legacy-fixtures/basics/fixtures/interface-extends/fixture.ts", + "legacy-fixtures/basics/fixtures/interface-type-parameters/fixture.ts", + "legacy-fixtures/basics/fixtures/interface-with-all-property-types/fixture.ts", + "legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/fixture.ts", + "legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/fixture.ts", + "legacy-fixtures/basics/fixtures/interface-with-generic/fixture.ts", + "legacy-fixtures/basics/fixtures/interface-with-jsdoc/fixture.ts", + "legacy-fixtures/basics/fixtures/interface-with-method/fixture.ts", + "legacy-fixtures/basics/fixtures/interface-with-optional-properties/fixture.ts", + "legacy-fixtures/basics/fixtures/intrinsic-keyword/fixture.ts", + "legacy-fixtures/basics/fixtures/keyword-variables/fixture.ts", + "legacy-fixtures/basics/fixtures/object-with-escaped-properties/fixture.ts", + "legacy-fixtures/basics/fixtures/object-with-typed-methods/fixture.ts", + "legacy-fixtures/basics/fixtures/private-fields-in-in/fixture.ts", + "legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/fixture.ts", + "legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/fixture.ts", + "legacy-fixtures/basics/fixtures/type-alias-declaration-export/fixture.ts", + "legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/fixture.ts", + "legacy-fixtures/basics/fixtures/type-alias-declaration/fixture.ts", + "legacy-fixtures/basics/fixtures/type-assertion-in-interface/fixture.ts", + "legacy-fixtures/basics/fixtures/type-assertion-in-method/fixture.ts", + "legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/fixture.ts", + "legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/fixture.ts", + "legacy-fixtures/basics/fixtures/type-guard-in-interface/fixture.ts", + "legacy-fixtures/basics/fixtures/type-guard-in-method/fixture.ts", + "legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/fixture.ts", + "legacy-fixtures/basics/fixtures/type-import-type/fixture.ts", + "legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/fixture.ts", + "legacy-fixtures/basics/fixtures/type-parameters-comments/fixture.ts", + "legacy-fixtures/basics/fixtures/type-reference-comments/fixture.ts", + "legacy-fixtures/basics/fixtures/typed-method-signature/fixture.ts", + "legacy-fixtures/basics/fixtures/typed-this/fixture.ts", + "legacy-fixtures/basics/fixtures/union-intersection/fixture.ts", + "legacy-fixtures/class-decorators/fixtures/class-parameter-property/fixture.ts", + "legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/fixture.ts", + "legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/fixture.ts", + "legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/fixture.ts", + "legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/fixture.ts", + "legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/fixture.ts", + "legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/fixture.ts", + "legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/fixture.ts", + "legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/fixture.ts", + "legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/fixture.ts", + "legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/fixture.ts", + "legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/fixture.ts", + "legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/fixture.ts", + "legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/fixture.ts", + "legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/fixture.ts", + "legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/fixture.ts", + "legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/fixture.ts", + "legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/fixture.ts", + "legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/fixture.ts", + "legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/fixture.ts", + "legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/fixture.ts", + "legacy-fixtures/types/fixtures/conditional-infer-nested/fixture.ts", + "legacy-fixtures/types/fixtures/conditional-infer-simple/fixture.ts", + "legacy-fixtures/types/fixtures/conditional-infer-with-constraint/fixture.ts", + "legacy-fixtures/types/fixtures/conditional-infer/fixture.ts", + "legacy-fixtures/types/fixtures/constructor-abstract/fixture.ts", + "legacy-fixtures/types/fixtures/constructor-empty/fixture.ts", + "legacy-fixtures/types/fixtures/constructor-generic/fixture.ts", + "legacy-fixtures/types/fixtures/constructor-in-generic/fixture.ts", + "legacy-fixtures/types/fixtures/constructor-with-rest/fixture.ts", + "legacy-fixtures/types/fixtures/constructor/fixture.ts", + "legacy-fixtures/types/fixtures/function-generic/fixture.ts", + "legacy-fixtures/types/fixtures/function-in-generic/fixture.ts", + "legacy-fixtures/types/fixtures/function-with-array-destruction/fixture.ts", + "legacy-fixtures/types/fixtures/function-with-object-destruction/fixture.ts", + "legacy-fixtures/types/fixtures/function-with-rest/fixture.ts", + "legacy-fixtures/types/fixtures/function-with-this/fixture.ts", + "legacy-fixtures/types/fixtures/function/fixture.ts", + "legacy-fixtures/types/fixtures/interface-with-accessors/fixture.ts", + "legacy-fixtures/types/fixtures/intersection-type/fixture.ts", + "legacy-fixtures/types/fixtures/mapped-named-type/fixture.ts", + "legacy-fixtures/types/fixtures/mapped-readonly-minus/fixture.ts", + "legacy-fixtures/types/fixtures/mapped-readonly-plus/fixture.ts", + "legacy-fixtures/types/fixtures/mapped-readonly/fixture.ts", + "legacy-fixtures/types/fixtures/mapped-untypped/fixture.ts", + "legacy-fixtures/types/fixtures/mapped/fixture.ts", + "legacy-fixtures/types/fixtures/nested-types/fixture.ts", + "legacy-fixtures/types/fixtures/object-literal-type-with-accessors/fixture.ts", + "legacy-fixtures/types/fixtures/optional-variance-in-and-out/fixture.ts", + "legacy-fixtures/types/fixtures/optional-variance-in-out/fixture.ts", + "legacy-fixtures/types/fixtures/optional-variance-in/fixture.ts", + "legacy-fixtures/types/fixtures/optional-variance-out/fixture.ts", + "legacy-fixtures/types/fixtures/template-literal-type-2/fixture.ts", + "legacy-fixtures/types/fixtures/template-literal-type-3/fixture.ts", + "legacy-fixtures/types/fixtures/template-literal-type-4/fixture.ts", + "legacy-fixtures/types/fixtures/this-type-expanded/fixture.ts", + "legacy-fixtures/types/fixtures/this-type/fixture.ts", + "legacy-fixtures/types/fixtures/tuple-optional/fixture.ts", + "legacy-fixtures/types/fixtures/typeof-this/fixture.ts", + "legacy-fixtures/types/fixtures/union-intersection/fixture.ts", } `; diff --git a/packages/ast-spec/tests/fixtures-with-differences-errors.shot b/packages/ast-spec/tests/fixtures-with-differences-errors.shot index ad9289156df8..b57d165dd07d 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-errors.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot @@ -22,10 +22,76 @@ Object { "declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/fixture.ts", "declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/fixture.ts", "element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/fixture.ts", + "legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/fixture.ts", + "legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/fixture.ts", + "legacy-fixtures/basics/fixtures/_error_/abstract-interface/fixture.ts", + "legacy-fixtures/basics/fixtures/_error_/await-without-async-function/fixture.ts", + "legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/fixture.ts", + "legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/fixture.ts", + "legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/fixture.ts", + "legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/fixture.ts", + "legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/fixture.ts", + "legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/fixture.ts", + "legacy-fixtures/basics/fixtures/_error_/const-assertions/fixture.ts", + "legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/fixture.ts", + "legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/fixture.ts", + "legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/fixture.ts", + "legacy-fixtures/basics/fixtures/_error_/export-type-star-from/fixture.ts", + "legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/fixture.ts", + "legacy-fixtures/basics/fixtures/_error_/import-type-error/fixture.ts", + "legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/fixture.ts", + "legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/fixture.ts", + "legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/fixture.ts", + "legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/fixture.ts", + "legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/fixture.ts", + "legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/fixture.ts", }, "TSESTree errored but Babel didn't": Set { "declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/fixture.ts", "declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/fixture.ts", + "legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/fixture.ts", }, } `; diff --git a/packages/ast-spec/tests/fixtures-with-differences-tokens.shot b/packages/ast-spec/tests/fixtures-with-differences-tokens.shot index c9796a384595..78042128e16c 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-tokens.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-tokens.shot @@ -26,5 +26,103 @@ Set { "element/AccessorProperty/fixtures/modifier-private/fixture.ts", "element/AccessorProperty/fixtures/modifier-protected/fixture.ts", "element/AccessorProperty/fixtures/modifier-public/fixture.ts", + "legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/fixture.ts", + "legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/fixture.ts", + "legacy-fixtures/basics/fixtures/async-function-with-var-declaration/fixture.ts", + "legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/fixture.ts", + "legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-declare-properties/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-extends-and-implements/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-implements-generic/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-implements/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-mixin/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-optional-computed-property/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-optional-methods/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-optional-properties/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-private-optional-property/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/fixture.ts", + "legacy-fixtures/basics/fixtures/class-with-readonly-property/fixture.ts", + "legacy-fixtures/basics/fixtures/const-enum/fixture.ts", + "legacy-fixtures/basics/fixtures/export-declare-const-named-enum/fixture.ts", + "legacy-fixtures/basics/fixtures/export-declare-named-enum/fixture.ts", + "legacy-fixtures/basics/fixtures/export-default-interface/fixture.ts", + "legacy-fixtures/basics/fixtures/export-named-enum/fixture.ts", + "legacy-fixtures/basics/fixtures/global-this/fixture.ts", + "legacy-fixtures/basics/fixtures/interface-extends-multiple/fixture.ts", + "legacy-fixtures/basics/fixtures/interface-extends/fixture.ts", + "legacy-fixtures/basics/fixtures/interface-type-parameters/fixture.ts", + "legacy-fixtures/basics/fixtures/interface-with-all-property-types/fixture.ts", + "legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/fixture.ts", + "legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/fixture.ts", + "legacy-fixtures/basics/fixtures/interface-with-generic/fixture.ts", + "legacy-fixtures/basics/fixtures/interface-with-jsdoc/fixture.ts", + "legacy-fixtures/basics/fixtures/interface-with-method/fixture.ts", + "legacy-fixtures/basics/fixtures/interface-with-optional-properties/fixture.ts", + "legacy-fixtures/basics/fixtures/interface-without-type-annotation/fixture.ts", + "legacy-fixtures/basics/fixtures/keyword-variables/fixture.ts", + "legacy-fixtures/basics/fixtures/non-null-assertion-operator/fixture.ts", + "legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/fixture.ts", + "legacy-fixtures/basics/fixtures/nullish-coalescing/fixture.ts", + "legacy-fixtures/basics/fixtures/object-with-escaped-properties/fixture.ts", + "legacy-fixtures/basics/fixtures/private-fields-in-in/fixture.ts", + "legacy-fixtures/basics/fixtures/type-assertion-in-interface/fixture.ts", + "legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/fixture.ts", + "legacy-fixtures/basics/fixtures/type-guard-in-interface/fixture.ts", + "legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/fixture.ts", + "legacy-fixtures/basics/fixtures/typed-keyword-null/fixture.ts", + "legacy-fixtures/basics/fixtures/typed-this/fixture.ts", + "legacy-fixtures/basics/fixtures/union-intersection/fixture.ts", + "legacy-fixtures/basics/fixtures/unknown-type-annotation/fixture.ts", + "legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/fixture.ts", + "legacy-fixtures/class-decorators/fixtures/class-parameter-property/fixture.ts", + "legacy-fixtures/declare/fixtures/enum/fixture.ts", + "legacy-fixtures/declare/fixtures/interface/fixture.ts", + "legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/fixture.ts", + "legacy-fixtures/types/fixtures/conditional-with-null/fixture.ts", + "legacy-fixtures/types/fixtures/conditional/fixture.ts", + "legacy-fixtures/types/fixtures/constructor-generic/fixture.ts", + "legacy-fixtures/types/fixtures/constructor-in-generic/fixture.ts", + "legacy-fixtures/types/fixtures/constructor-with-rest/fixture.ts", + "legacy-fixtures/types/fixtures/constructor/fixture.ts", + "legacy-fixtures/types/fixtures/function-generic/fixture.ts", + "legacy-fixtures/types/fixtures/function-in-generic/fixture.ts", + "legacy-fixtures/types/fixtures/function-with-rest/fixture.ts", + "legacy-fixtures/types/fixtures/function-with-this/fixture.ts", + "legacy-fixtures/types/fixtures/function/fixture.ts", + "legacy-fixtures/types/fixtures/indexed/fixture.ts", + "legacy-fixtures/types/fixtures/interface-with-accessors/fixture.ts", + "legacy-fixtures/types/fixtures/literal-number-negative/fixture.ts", + "legacy-fixtures/types/fixtures/literal-number/fixture.ts", + "legacy-fixtures/types/fixtures/literal-string/fixture.ts", + "legacy-fixtures/types/fixtures/mapped-readonly-minus/fixture.ts", + "legacy-fixtures/types/fixtures/mapped-readonly-plus/fixture.ts", + "legacy-fixtures/types/fixtures/mapped-readonly/fixture.ts", + "legacy-fixtures/types/fixtures/mapped-untypped/fixture.ts", + "legacy-fixtures/types/fixtures/mapped/fixture.ts", + "legacy-fixtures/types/fixtures/nested-types/fixture.ts", + "legacy-fixtures/types/fixtures/reference-generic-nested/fixture.ts", + "legacy-fixtures/types/fixtures/reference-generic/fixture.ts", + "legacy-fixtures/types/fixtures/reference/fixture.ts", + "legacy-fixtures/types/fixtures/this-type-expanded/fixture.ts", + "legacy-fixtures/types/fixtures/tuple-empty/fixture.ts", + "legacy-fixtures/types/fixtures/tuple-named-optional/fixture.ts", + "legacy-fixtures/types/fixtures/tuple-named-rest/fixture.ts", + "legacy-fixtures/types/fixtures/tuple-named/fixture.ts", + "legacy-fixtures/types/fixtures/tuple-optional/fixture.ts", + "legacy-fixtures/types/fixtures/tuple-rest/fixture.ts", + "legacy-fixtures/types/fixtures/tuple/fixture.ts", + "legacy-fixtures/types/fixtures/type-literal/fixture.ts", + "legacy-fixtures/types/fixtures/type-operator/fixture.ts", + "legacy-fixtures/types/fixtures/typeof-this/fixture.ts", + "legacy-fixtures/types/fixtures/typeof-with-type-parameters/fixture.ts", + "legacy-fixtures/types/fixtures/typeof/fixture.ts", + "legacy-fixtures/types/fixtures/union-intersection/fixture.ts", } `; diff --git a/packages/shared-fixtures/CHANGELOG.md b/packages/shared-fixtures/CHANGELOG.md deleted file mode 100644 index 62cf64f412a2..000000000000 --- a/packages/shared-fixtures/CHANGELOG.md +++ /dev/null @@ -1,986 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -# [5.51.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.50.0...v5.51.0) (2023-02-06) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [5.50.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.49.0...v5.50.0) (2023-01-31) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [5.49.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.2...v5.49.0) (2023-01-23) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -## [5.48.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.1...v5.48.2) (2023-01-16) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -## [5.48.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.0...v5.48.1) (2023-01-09) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [5.48.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.1...v5.48.0) (2023-01-02) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [5.47.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.0...v5.47.1) (2022-12-26) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.47.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.1...v5.47.0) (2022-12-19) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [5.46.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.0...v5.46.1) (2022-12-12) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.46.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.1...v5.46.0) (2022-12-08) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [5.45.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.0...v5.45.1) (2022-12-05) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.45.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.44.0...v5.45.0) (2022-11-28) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.44.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.43.0...v5.44.0) (2022-11-21) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.43.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.1...v5.43.0) (2022-11-14) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [5.42.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.0...v5.42.1) (2022-11-07) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.42.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.41.0...v5.42.0) (2022-10-31) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.41.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.1...v5.41.0) (2022-10-24) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [5.40.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.0...v5.40.1) (2022-10-17) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.40.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.39.0...v5.40.0) (2022-10-10) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.39.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.1...v5.39.0) (2022-10-03) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [5.38.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.0...v5.38.1) (2022-09-26) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.38.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.37.0...v5.38.0) (2022-09-19) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.37.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.2...v5.37.0) (2022-09-12) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) - -### Bug Fixes - -- **typescript-estree:** don't double add decorators to a parameter property's parameter ([#5582](https://github.com/typescript-eslint/typescript-eslint/issues/5582)) ([863694c](https://github.com/typescript-eslint/typescript-eslint/commit/863694cbc71b5158ca6a018de8707c9f9fbc22c3)) - -## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.35.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.34.0...v5.35.0) (2022-08-24) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.1...v5.34.0) (2022-08-22) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [5.33.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.0...v5.33.1) (2022-08-15) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.32.0...v5.33.0) (2022-08-08) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.31.0...v5.32.0) (2022-08-01) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## 5.30.1 (2022-07-01) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) - -### Features - -- treat `this` in `typeof this` as a `ThisExpression` ([#4382](https://github.com/typescript-eslint/typescript-eslint/issues/4382)) ([b04b2ce](https://github.com/typescript-eslint/typescript-eslint/commit/b04b2ce1ba90d94718891f2562dd210a6d7b8609)) - -# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) - -### Features - -- [TS4.7] support type parameters for `typeof` ([#5067](https://github.com/typescript-eslint/typescript-eslint/issues/5067)) ([836de79](https://github.com/typescript-eslint/typescript-eslint/commit/836de79e8d1bff43149168cc913a4c2b60e79bf6)) - -# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) - -### Features - -- [4.7] support instantiation expressions ([#4938](https://github.com/typescript-eslint/typescript-eslint/issues/4938)) ([79fbc77](https://github.com/typescript-eslint/typescript-eslint/commit/79fbc7743ae5dce3190f8168776e0204755390ad)) -- [4.7] support optional variance annotation ([#4831](https://github.com/typescript-eslint/typescript-eslint/issues/4831)) ([7e7b24c](https://github.com/typescript-eslint/typescript-eslint/commit/7e7b24c196e6d968e48f97f46feae5e7027e22d2)) -- **typescript-estree:** `extends` constraints for `infer` ([#4830](https://github.com/typescript-eslint/typescript-eslint/issues/4830)) ([8cbbcc3](https://github.com/typescript-eslint/typescript-eslint/commit/8cbbcc3d317779e0dcba15d3835137f38383de34)) - -# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.16.0...v5.17.0) (2022-03-28) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.15.0...v5.16.0) (2022-03-21) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.14.0...v5.15.0) (2022-03-14) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.13.0...v5.14.0) (2022-03-07) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.1...v5.13.0) (2022-02-28) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [5.12.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.0...v5.12.1) (2022-02-21) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.2...v5.11.0) (2022-02-07) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.1...v5.9.0) (2022-01-03) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [5.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) (2021-12-27) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.7.0...v5.8.0) (2021-12-20) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.4.0...v5.5.0) (2021-11-29) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.1...v5.4.0) (2021-11-15) - -### Features - -- **typescript-estree:** support Import Assertions ([#4074](https://github.com/typescript-eslint/typescript-eslint/issues/4074)) ([ae0fb5a](https://github.com/typescript-eslint/typescript-eslint/commit/ae0fb5a591958216b7df656e66b1dfe464898167)) -- **typescript-estree:** support private fields in-in syntax ([#4075](https://github.com/typescript-eslint/typescript-eslint/issues/4075)) ([939d8ea](https://github.com/typescript-eslint/typescript-eslint/commit/939d8eac547fb1734aa00f1ea01cc6eae0b4280a)) -- **typescript-estree:** support type-only module specifiers ([#4076](https://github.com/typescript-eslint/typescript-eslint/issues/4076)) ([77baa92](https://github.com/typescript-eslint/typescript-eslint/commit/77baa9203638e888a76e21003a278a8da386e133)) - -## [5.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.0...v5.3.1) (2021-11-08) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.2.0...v5.3.0) (2021-11-01) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.1.0...v5.2.0) (2021-10-25) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [5.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.0.0...v5.1.0) (2021-10-18) - -### Bug Fixes - -- **typescript-estree:** support private optional property definition ([#3997](https://github.com/typescript-eslint/typescript-eslint/issues/3997)) ([8605e08](https://github.com/typescript-eslint/typescript-eslint/commit/8605e080a4dac4a277e6108cd9ed1e5a707302fa)) - -# [5.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.33.0...v5.0.0) (2021-10-11) - -### Bug Fixes - -- **typescript-estree:** change `source` of ExportNamedDeclaration to Literal from Expression ([#3763](https://github.com/typescript-eslint/typescript-eslint/issues/3763)) ([dc5a0f5](https://github.com/typescript-eslint/typescript-eslint/commit/dc5a0f5104b400f4422b8d67ecfc6cc7a32613a2)) - -### Features - -- support `PrivateIdentifier` ([#3808](https://github.com/typescript-eslint/typescript-eslint/issues/3808)) ([0eefe5e](https://github.com/typescript-eslint/typescript-eslint/commit/0eefe5e49d21af3f1e3e2d9a90c2e49929863ac2)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#2933](https://github.com/typescript-eslint/typescript-eslint/issues/2933) -- **eslint-plugin:** removed value from abstract property nodes ([#3765](https://github.com/typescript-eslint/typescript-eslint/issues/3765)) ([5823524](https://github.com/typescript-eslint/typescript-eslint/commit/58235241714596b641a1e8b39c569e561e0039b4)), closes [#3748](https://github.com/typescript-eslint/typescript-eslint/issues/3748) - -# [4.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.32.0...v4.33.0) (2021-10-04) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.2...v4.32.0) (2021-09-27) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [4.31.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.1...v4.31.2) (2021-09-20) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [4.31.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.0...v4.31.1) (2021-09-13) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.30.0...v4.31.0) (2021-09-06) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.3...v4.30.0) (2021-08-30) - -### Features - -- **typescript-estree:** add support for class static blocks ([#3730](https://github.com/typescript-eslint/typescript-eslint/issues/3730)) ([f81831b](https://github.com/typescript-eslint/typescript-eslint/commit/f81831bd279a32da6dbab0f1c061053ea43965f6)) - -## [4.29.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.2...v4.29.3) (2021-08-23) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [4.29.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.1...v4.29.2) (2021-08-16) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [4.29.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.0...v4.29.1) (2021-08-09) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.5...v4.29.0) (2021-08-02) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [4.28.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.0...v4.28.1) (2021-06-28) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.27.0...v4.28.0) (2021-06-21) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.1...v4.27.0) (2021-06-14) - -### Bug Fixes - -- **typescript-estree:** support override modifier for parameter property ([#3485](https://github.com/typescript-eslint/typescript-eslint/issues/3485)) ([33b9f69](https://github.com/typescript-eslint/typescript-eslint/commit/33b9f69a681cd3219a2acca5b0b2fa67609f099e)) - -## [4.26.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.0...v4.26.1) (2021-06-07) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.25.0...v4.26.0) (2021-05-31) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.24.0...v4.25.0) (2021-05-24) - -### Features - -- **typescript-estree:** [TS4.3] support overrides on class members ([#3429](https://github.com/typescript-eslint/typescript-eslint/issues/3429)) ([21d1b62](https://github.com/typescript-eslint/typescript-eslint/commit/21d1b62a0b84b502d2cf12674b3d141994a3ffd4)) -- **typescript-estree:** add support for getter/setter signatures on types ([#3427](https://github.com/typescript-eslint/typescript-eslint/issues/3427)) ([b830b7f](https://github.com/typescript-eslint/typescript-eslint/commit/b830b7f4e8a99affc8af8b53cb83371ef81d7032)), closes [#3272](https://github.com/typescript-eslint/typescript-eslint/issues/3272) [#3272](https://github.com/typescript-eslint/typescript-eslint/issues/3272) - -# [4.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.23.0...v4.24.0) (2021-05-17) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.21.0...v4.22.0) (2021-04-12) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.20.0...v4.21.0) (2021-04-05) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.19.0...v4.20.0) (2021-03-29) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.18.0...v4.19.0) (2021-03-22) - -### Bug Fixes - -- **typescript-estree:** [ts 4.2] add support for import type equal declaration ([#3189](https://github.com/typescript-eslint/typescript-eslint/issues/3189)) ([6a25faf](https://github.com/typescript-eslint/typescript-eslint/commit/6a25faf5cfa4d21a7546d9866819f4e017308fb2)) - -# [4.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.17.0...v4.18.0) (2021-03-15) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.1...v4.17.0) (2021-03-08) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [4.16.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.0...v4.16.1) (2021-03-01) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.2...v4.16.0) (2021-03-01) - -### Features - -- TypeScript 4.2 syntax support ([#3112](https://github.com/typescript-eslint/typescript-eslint/issues/3112)) ([2ebfb21](https://github.com/typescript-eslint/typescript-eslint/commit/2ebfb21ba6c88c793cfbd0e231e5803b2381694c)) - -## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) - -### Bug Fixes - -- add missing intrinsic keyword node to AST ([#3081](https://github.com/typescript-eslint/typescript-eslint/issues/3081)) ([409bf0b](https://github.com/typescript-eslint/typescript-eslint/commit/409bf0bb3e2ac4d8782408d436ebdefb42dba38b)) - -## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.2...v4.15.0) (2021-02-08) - -### Features - -- **typescript-estree:** improve logic used to escape string literals in jsx ([#2995](https://github.com/typescript-eslint/typescript-eslint/issues/2995)) ([3cb3aad](https://github.com/typescript-eslint/typescript-eslint/commit/3cb3aade2864bab15ed1ff8d7cd32766aa57152f)) - -## [4.14.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.1...v4.14.2) (2021-02-01) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [4.14.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.0...v4.14.1) (2021-01-25) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.13.0...v4.14.0) (2021-01-18) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.12.0...v4.13.0) (2021-01-11) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.1...v4.12.0) (2021-01-04) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [4.11.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.0...v4.11.1) (2020-12-28) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.10.0...v4.11.0) (2020-12-21) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.1...v4.10.0) (2020-12-14) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [4.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.0...v4.9.1) (2020-12-07) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.2...v4.9.0) (2020-11-30) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [4.8.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.1...v4.8.2) (2020-11-23) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [4.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.0...v4.8.1) (2020-11-17) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.7.0...v4.8.0) (2020-11-16) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.1...v4.7.0) (2020-11-09) - -### Features - -- support TS4.1 features ([#2748](https://github.com/typescript-eslint/typescript-eslint/issues/2748)) ([2be354b](https://github.com/typescript-eslint/typescript-eslint/commit/2be354bb15f9013a2da1b13a0c0836e9ef057e16)), closes [#2583](https://github.com/typescript-eslint/typescript-eslint/issues/2583) - -## [4.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.0...v4.6.1) (2020-11-02) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.5.0...v4.6.0) (2020-10-26) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.1...v4.5.0) (2020-10-19) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [4.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.0...v4.4.1) (2020-10-12) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.3.0...v4.4.0) (2020-10-05) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.2.0...v4.3.0) (2020-09-28) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.1...v4.2.0) (2020-09-21) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [4.1.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.0...v4.1.1) (2020-09-14) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) - -## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [3.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.0...v3.10.1) (2020-08-25) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [3.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.1...v3.10.0) (2020-08-24) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [3.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.0...v3.9.1) (2020-08-17) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [3.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.8.0...v3.9.0) (2020-08-10) - -### Features - -- **typescript-estree:** support TSv4 labelled tuple members ([#2378](https://github.com/typescript-eslint/typescript-eslint/issues/2378)) ([00d84ff](https://github.com/typescript-eslint/typescript-eslint/commit/00d84ffbcbe9d0ec98bdb2f2ce59959a27ce4dbe)) - -# [3.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.1...v3.8.0) (2020-08-03) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [3.7.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.0...v3.7.1) (2020-07-27) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [3.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.1...v3.7.0) (2020-07-20) - -### Features - -- **typescript-estree:** support short-circuiting assignment operators ([#2307](https://github.com/typescript-eslint/typescript-eslint/issues/2307)) ([2c90d9f](https://github.com/typescript-eslint/typescript-eslint/commit/2c90d9fa3aa5ebd7db697dddb7762bca2dd0e06b)) -- **typescript-estree:** support type annotations on catch clauses ([#2306](https://github.com/typescript-eslint/typescript-eslint/issues/2306)) ([b5afe9c](https://github.com/typescript-eslint/typescript-eslint/commit/b5afe9c560b9f38c8dffc312a600db30944129c8)) - -## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [3.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.4.0...v3.5.0) (2020-06-29) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [3.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.3.0...v3.4.0) (2020-06-22) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [3.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.2.0...v3.3.0) (2020-06-15) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [3.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.1.0...v3.2.0) (2020-06-08) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [3.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.2...v3.1.0) (2020-06-01) - -### Bug Fixes - -- **experimental-utils:** downlevel type declarations for versions older than 3.8 ([#2133](https://github.com/typescript-eslint/typescript-eslint/issues/2133)) ([7925823](https://github.com/typescript-eslint/typescript-eslint/commit/792582326a8065270b69a0ffcaad5a7b4b103ff3)) - -## [3.0.2](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.1...v3.0.2) (2020-05-27) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) - -### Bug Fixes - -- **typescript-estree:** handle `BigInt` with `_` numeric separator ([#2067](https://github.com/typescript-eslint/typescript-eslint/issues/2067)) ([66f1627](https://github.com/typescript-eslint/typescript-eslint/commit/66f1627b11a566d5b925a577e800f99d5c808be2)) - -# [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) - -## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) - -### Features - -- **typescript-estree:** align nodes with estree 2020 ([#1389](https://github.com/typescript-eslint/typescript-eslint/issues/1389)) ([aff5b62](https://github.com/typescript-eslint/typescript-eslint/commit/aff5b62044f9b93f2087a1d261e9be3f8d6fd54d)) -- **typescript-estree:** align optional fields ([#1429](https://github.com/typescript-eslint/typescript-eslint/issues/1429)) ([0e0010f](https://github.com/typescript-eslint/typescript-eslint/commit/0e0010f82952f9beeeb84136eea00cc5eecc9db6)) -- **typescript-estree:** handle 3.9's non-null assertion changes ([#2036](https://github.com/typescript-eslint/typescript-eslint/issues/2036)) ([06bec63](https://github.com/typescript-eslint/typescript-eslint/commit/06bec63c56536db070608ab136d2ad57083f0c6a)) - -# [2.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.33.0...v2.34.0) (2020-05-18) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.32.0...v2.33.0) (2020-05-12) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.31.0...v2.32.0) (2020-05-11) - -### Features - -- bump dependencies and align AST ([#2007](https://github.com/typescript-eslint/typescript-eslint/issues/2007)) ([18668b7](https://github.com/typescript-eslint/typescript-eslint/commit/18668b78fd7d1e5281af7fc26c76e0ca53297f69)) - -# [2.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.30.0...v2.31.0) (2020-05-04) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.29.0...v2.30.0) (2020-04-27) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.28.0...v2.29.0) (2020-04-20) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.27.0...v2.28.0) (2020-04-13) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.26.0...v2.27.0) (2020-04-06) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.25.0...v2.26.0) (2020-03-30) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.24.0...v2.25.0) (2020-03-23) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.23.0...v2.24.0) (2020-03-16) - -### Features - -- **typescript-estree:** support 3.8 `export * as ns` ([#1698](https://github.com/typescript-eslint/typescript-eslint/issues/1698)) ([133f622](https://github.com/typescript-eslint/typescript-eslint/commit/133f622f38a286eac45288a9789d2ee529d5e582)) - -# [2.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.22.0...v2.23.0) (2020-03-09) - -### Features - -- **typescript-estree:** support 3.8 import/export type ([#1697](https://github.com/typescript-eslint/typescript-eslint/issues/1697)) ([625d603](https://github.com/typescript-eslint/typescript-eslint/commit/625d603f94bf0521f834313bf31c734ce4948b7a)) - -# [2.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.21.0...v2.22.0) (2020-03-02) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.20.0...v2.21.0) (2020-02-24) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.2...v2.20.0) (2020-02-17) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [2.19.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.1...v2.19.2) (2020-02-10) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [2.19.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.0...v2.19.1) (2020-02-10) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.18.0...v2.19.0) (2020-02-03) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.17.0...v2.18.0) (2020-01-27) - -### Bug Fixes - -- **typescript-estree:** fix identifier tokens typed as `Keyword` ([#1487](https://github.com/typescript-eslint/typescript-eslint/issues/1487)) ([77a1caa](https://github.com/typescript-eslint/typescript-eslint/commit/77a1caa562638645b4717449800e410107d512c8)) - -# [2.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.16.0...v2.17.0) (2020-01-20) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.15.0...v2.16.0) (2020-01-13) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.14.0...v2.15.0) (2020-01-06) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.13.0...v2.14.0) (2019-12-30) - -### Bug Fixes - -- **typescript-estree:** visit typeParameters in OptionalCallExpr ([#1377](https://github.com/typescript-eslint/typescript-eslint/issues/1377)) ([cba6a2a](https://github.com/typescript-eslint/typescript-eslint/commit/cba6a2a)) - -# [2.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.12.0...v2.13.0) (2019-12-23) - -### Features - -- **typescript-estree:** computed members discriminated unions ([#1349](https://github.com/typescript-eslint/typescript-eslint/issues/1349)) ([013df9a](https://github.com/typescript-eslint/typescript-eslint/commit/013df9a)) - -# [2.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.11.0...v2.12.0) (2019-12-16) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.10.0...v2.11.0) (2019-12-09) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.9.0...v2.10.0) (2019-12-02) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.8.0...v2.9.0) (2019-11-25) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.7.0...v2.8.0) (2019-11-18) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.1...v2.7.0) (2019-11-11) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [2.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.0...v2.6.1) (2019-11-04) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.5.0...v2.6.0) (2019-10-28) - -### Bug Fixes - -- **typescript-estree:** correct parenthesized optional chain AST ([#1141](https://github.com/typescript-eslint/typescript-eslint/issues/1141)) ([5ae286e](https://github.com/typescript-eslint/typescript-eslint/commit/5ae286e)) - -### Features - -- **typescript-estree:** add support for declare class properties ([#1136](https://github.com/typescript-eslint/typescript-eslint/issues/1136)) ([1508670](https://github.com/typescript-eslint/typescript-eslint/commit/1508670)) - -# [2.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.4.0...v2.5.0) (2019-10-21) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.3...v2.4.0) (2019-10-14) - -### Features - -- **typescript-estree:** support for parsing 3.7 features ([#1045](https://github.com/typescript-eslint/typescript-eslint/issues/1045)) ([623febf](https://github.com/typescript-eslint/typescript-eslint/commit/623febf)) - -## [2.3.3](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.2...v2.3.3) (2019-10-07) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [2.3.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.1...v2.3.2) (2019-09-30) - -### Bug Fixes - -- **typescript-estree:** handle optional computed prop w/o type ([#1026](https://github.com/typescript-eslint/typescript-eslint/issues/1026)) ([95c13fe](https://github.com/typescript-eslint/typescript-eslint/commit/95c13fe)) - -## [2.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.0...v2.3.1) (2019-09-23) - -### Bug Fixes - -- **typescript-estree:** parsing error for await in non-async func ([#988](https://github.com/typescript-eslint/typescript-eslint/issues/988)) ([19abbe0](https://github.com/typescript-eslint/typescript-eslint/commit/19abbe0)) - -# [2.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.2.0...v2.3.0) (2019-09-16) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.1.0...v2.2.0) (2019-09-09) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.0.0...v2.1.0) (2019-09-02) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [2.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.13.0...v2.0.0) (2019-08-13) - -### Bug Fixes - -- **typescript-estree:** fix `is` token typed as `Keyword ([#750](https://github.com/typescript-eslint/typescript-eslint/issues/750)) ([35dec52](https://github.com/typescript-eslint/typescript-eslint/commit/35dec52)) -- **typescript-estree:** jsx comment parsing ([#703](https://github.com/typescript-eslint/typescript-eslint/issues/703)) ([0cfc48e](https://github.com/typescript-eslint/typescript-eslint/commit/0cfc48e)) - -# [1.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.12.0...v1.13.0) (2019-07-21) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [1.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.11.0...v1.12.0) (2019-07-12) - -### Bug Fixes - -- **typescript-estree:** fix `async` identifier token typed as `Keyword` ([#681](https://github.com/typescript-eslint/typescript-eslint/issues/681)) ([6de19d3](https://github.com/typescript-eslint/typescript-eslint/commit/6de19d3)) - -# [1.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.10.2...v1.11.0) (2019-06-23) - -### Bug Fixes - -- **typescript-estree:** fix more cases with double slash in JSX text ([#607](https://github.com/typescript-eslint/typescript-eslint/issues/607)) ([34cfa53](https://github.com/typescript-eslint/typescript-eslint/commit/34cfa53)) - -## [1.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v1.10.1...v1.10.2) (2019-06-10) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [1.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.10.0...v1.10.1) (2019-06-09) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [1.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.9.0...v1.10.0) (2019-06-09) - -### Bug Fixes - -- **typescript-estree:** stop ignoring comments in JSX with generic ([#596](https://github.com/typescript-eslint/typescript-eslint/issues/596)) ([31d5bd4](https://github.com/typescript-eslint/typescript-eslint/commit/31d5bd4)) - -# [1.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.8.0...v1.9.0) (2019-05-12) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [1.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.7.0...v1.8.0) (2019-05-10) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [1.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.6.0...v1.7.0) (2019-04-20) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [1.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.5.0...v1.6.0) (2019-04-03) - -### Features - -- change TypeScript version range to >=3.2.1 <3.5.0 ([#399](https://github.com/typescript-eslint/typescript-eslint/issues/399)) ([a4f95d3](https://github.com/typescript-eslint/typescript-eslint/commit/a4f95d3)) - -# [1.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.2...v1.5.0) (2019-03-20) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [1.4.2](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.1...v1.4.2) (2019-02-25) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [1.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.0...v1.4.1) (2019-02-23) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [1.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.3.0...v1.4.0) (2019-02-19) - -### Features - -- **ts-estree:** fix parsing nested sequence expressions ([#286](https://github.com/typescript-eslint/typescript-eslint/issues/286)) ([ecc9631](https://github.com/typescript-eslint/typescript-eslint/commit/ecc9631)) - -# [1.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.2.0...v1.3.0) (2019-02-07) - -### Bug Fixes - -- **ts-estree:** align typeArguments and typeParameters across nodes ([#223](https://github.com/typescript-eslint/typescript-eslint/issues/223)) ([3306198](https://github.com/typescript-eslint/typescript-eslint/commit/3306198)) - -### Features - -- **ts-estree:** enable errors 1098 and 1099 ([#219](https://github.com/typescript-eslint/typescript-eslint/issues/219)) ([fc50167](https://github.com/typescript-eslint/typescript-eslint/commit/fc50167)) - -# [1.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.1.1...v1.2.0) (2019-02-01) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [1.1.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.1.0...v1.1.1) (2019-01-29) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -# [1.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.0.0...v1.1.0) (2019-01-23) - -### Bug Fixes - -- **typescript-estree:** correct range of parameters with comments ([#128](https://github.com/typescript-eslint/typescript-eslint/issues/128)) ([91eedf2](https://github.com/typescript-eslint/typescript-eslint/commit/91eedf2)) - -# [1.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v0.2.1...v1.0.0) (2019-01-20) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - -## [0.2.1](https://github.com/typescript-eslint/typescript-eslint/compare/v0.2.0...v0.2.1) (2019-01-20) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures diff --git a/packages/shared-fixtures/README.md b/packages/shared-fixtures/README.md deleted file mode 100644 index eb3bceabc7f8..000000000000 --- a/packages/shared-fixtures/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# `@typescript-eslint/shared-fixtures` - -> Code fixtures used to test the `typescript-estree` parser. - -## ✋ Internal Package - -This is an _internal package_ to the [typescript-eslint monorepo](https://github.com/typescript-eslint/typescript-eslint). -You likely don't want to use it directly. - -👉 See **https://typescript-eslint.io** for docs on typescript-eslint. diff --git a/packages/shared-fixtures/fixtures/comments/block-trailing-comment.src.js b/packages/shared-fixtures/fixtures/comments/block-trailing-comment.src.js deleted file mode 100644 index 2a6819ff0b13..000000000000 --- a/packages/shared-fixtures/fixtures/comments/block-trailing-comment.src.js +++ /dev/null @@ -1,4 +0,0 @@ -{ - a(); - //comment -} diff --git a/packages/shared-fixtures/fixtures/comments/comment-within-condition.src.js b/packages/shared-fixtures/fixtures/comments/comment-within-condition.src.js deleted file mode 100644 index b997605defc4..000000000000 --- a/packages/shared-fixtures/fixtures/comments/comment-within-condition.src.js +++ /dev/null @@ -1,2 +0,0 @@ -/* foo */ -if (/* bar */ a) {} diff --git a/packages/shared-fixtures/fixtures/comments/export-default-anonymous-class.src.js b/packages/shared-fixtures/fixtures/comments/export-default-anonymous-class.src.js deleted file mode 100644 index d0a26e4ede9e..000000000000 --- a/packages/shared-fixtures/fixtures/comments/export-default-anonymous-class.src.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * this is anonymous class. - */ -export default class { - /** - * this is method1. - */ - method1(){ - } -} diff --git a/packages/shared-fixtures/fixtures/comments/jsdoc-comment.src.js b/packages/shared-fixtures/fixtures/comments/jsdoc-comment.src.js deleted file mode 100644 index 29298a12b52f..000000000000 --- a/packages/shared-fixtures/fixtures/comments/jsdoc-comment.src.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * This is a function. - * @param {String} bar some string - * @returns {String} returns bar - */ -function foo(bar) { - return bar; -} diff --git a/packages/shared-fixtures/fixtures/comments/jsx-attr-and-text-with-url.src.js b/packages/shared-fixtures/fixtures/comments/jsx-attr-and-text-with-url.src.js deleted file mode 100644 index ab57e8d95dab..000000000000 --- a/packages/shared-fixtures/fixtures/comments/jsx-attr-and-text-with-url.src.js +++ /dev/null @@ -1 +0,0 @@ -const link = (http://example.com); diff --git a/packages/shared-fixtures/fixtures/comments/jsx-block-comment.src.js b/packages/shared-fixtures/fixtures/comments/jsx-block-comment.src.js deleted file mode 100644 index 5abfb88e92f2..000000000000 --- a/packages/shared-fixtures/fixtures/comments/jsx-block-comment.src.js +++ /dev/null @@ -1,7 +0,0 @@ -const pure = () => { - return ( - - {/*COMMENT*/} - - ); -} diff --git a/packages/shared-fixtures/fixtures/comments/jsx-comment-after-jsx.src.js b/packages/shared-fixtures/fixtures/comments/jsx-comment-after-jsx.src.js deleted file mode 100644 index 32c4c532013a..000000000000 --- a/packages/shared-fixtures/fixtures/comments/jsx-comment-after-jsx.src.js +++ /dev/null @@ -1,5 +0,0 @@ -const pure = () => { - return ( - // Foo - ); -} diff --git a/packages/shared-fixtures/fixtures/comments/jsx-comment-after-self-closing-jsx.src.js b/packages/shared-fixtures/fixtures/comments/jsx-comment-after-self-closing-jsx.src.js deleted file mode 100644 index ef446a5b6dd2..000000000000 --- a/packages/shared-fixtures/fixtures/comments/jsx-comment-after-self-closing-jsx.src.js +++ /dev/null @@ -1,5 +0,0 @@ -const pure = () => { - return ( - // Foo - ); -} diff --git a/packages/shared-fixtures/fixtures/comments/jsx-generic-with-comment-in-tag.src.js b/packages/shared-fixtures/fixtures/comments/jsx-generic-with-comment-in-tag.src.js deleted file mode 100644 index ca252d971b47..000000000000 --- a/packages/shared-fixtures/fixtures/comments/jsx-generic-with-comment-in-tag.src.js +++ /dev/null @@ -1,25 +0,0 @@ -const comp = ( - <> - /* comment1 */> - foo /* comment2 */> - /* comment3 */ bar> - foo /* comment4 */ bar> - - - // comment5 - > - - foo - // comment6 - > - - // comment7 - foo - > - - foo - // comment8 - bar - > - -); diff --git a/packages/shared-fixtures/fixtures/comments/jsx-tag-comment-after-prop.src.js b/packages/shared-fixtures/fixtures/comments/jsx-tag-comment-after-prop.src.js deleted file mode 100644 index f6321a0a0c2a..000000000000 --- a/packages/shared-fixtures/fixtures/comments/jsx-tag-comment-after-prop.src.js +++ /dev/null @@ -1,11 +0,0 @@ -const pure = () => { - return ( - - ); -} - diff --git a/packages/shared-fixtures/fixtures/comments/jsx-tag-comments.src.js b/packages/shared-fixtures/fixtures/comments/jsx-tag-comments.src.js deleted file mode 100644 index ef679a1ad20e..000000000000 --- a/packages/shared-fixtures/fixtures/comments/jsx-tag-comments.src.js +++ /dev/null @@ -1,10 +0,0 @@ -const pure = () => { - return ( - - - ); -} - diff --git a/packages/shared-fixtures/fixtures/comments/jsx-text-with-multiline-non-comment.src.js b/packages/shared-fixtures/fixtures/comments/jsx-text-with-multiline-non-comment.src.js deleted file mode 100644 index c14b0aef7b2b..000000000000 --- a/packages/shared-fixtures/fixtures/comments/jsx-text-with-multiline-non-comment.src.js +++ /dev/null @@ -1,9 +0,0 @@ -const pure = () => { - return ( - - /** - * test - */ - - ); -} diff --git a/packages/shared-fixtures/fixtures/comments/jsx-text-with-url.src.js b/packages/shared-fixtures/fixtures/comments/jsx-text-with-url.src.js deleted file mode 100644 index a20de1676b91..000000000000 --- a/packages/shared-fixtures/fixtures/comments/jsx-text-with-url.src.js +++ /dev/null @@ -1,9 +0,0 @@ -const first =
http://example.com
; - -const second = <>http://example.com; - -const third =

http://example.com
; - -const fourth =
http://example.com
; - -const fifth =
{}http://example.com
; diff --git a/packages/shared-fixtures/fixtures/comments/jsx-with-greather-than.src.js b/packages/shared-fixtures/fixtures/comments/jsx-with-greather-than.src.js deleted file mode 100644 index 6294ad6b6f01..000000000000 --- a/packages/shared-fixtures/fixtures/comments/jsx-with-greather-than.src.js +++ /dev/null @@ -1,4 +0,0 @@ -if (1 >/* Test */2) { - test( 2 >> 3); - const foo = // -} diff --git a/packages/shared-fixtures/fixtures/comments/jsx-with-operators.src.js b/packages/shared-fixtures/fixtures/comments/jsx-with-operators.src.js deleted file mode 100644 index f14ac6907bb2..000000000000 --- a/packages/shared-fixtures/fixtures/comments/jsx-with-operators.src.js +++ /dev/null @@ -1,4 +0,0 @@ -if (1 > 3); - const foo = // -} diff --git a/packages/shared-fixtures/fixtures/comments/line-comment-with-block-syntax.src.js b/packages/shared-fixtures/fixtures/comments/line-comment-with-block-syntax.src.js deleted file mode 100644 index 88994dd62b4a..000000000000 --- a/packages/shared-fixtures/fixtures/comments/line-comment-with-block-syntax.src.js +++ /dev/null @@ -1 +0,0 @@ -// /*test*/ diff --git a/packages/shared-fixtures/fixtures/comments/mix-line-and-block-comments.src.js b/packages/shared-fixtures/fixtures/comments/mix-line-and-block-comments.src.js deleted file mode 100644 index c49bcf6bcad6..000000000000 --- a/packages/shared-fixtures/fixtures/comments/mix-line-and-block-comments.src.js +++ /dev/null @@ -1,3 +0,0 @@ -//foo -var zzz /*aaa*/ = 777; -//bar diff --git a/packages/shared-fixtures/fixtures/comments/no-comment-regex.src.js b/packages/shared-fixtures/fixtures/comments/no-comment-regex.src.js deleted file mode 100644 index c33c7617e144..000000000000 --- a/packages/shared-fixtures/fixtures/comments/no-comment-regex.src.js +++ /dev/null @@ -1 +0,0 @@ -const regex = /no comment\/**foo/; diff --git a/packages/shared-fixtures/fixtures/comments/no-comment-template.src.js b/packages/shared-fixtures/fixtures/comments/no-comment-template.src.js deleted file mode 100644 index f22e6f94cf4f..000000000000 --- a/packages/shared-fixtures/fixtures/comments/no-comment-template.src.js +++ /dev/null @@ -1 +0,0 @@ -const str = `${__dirname}/test/*.js`; diff --git a/packages/shared-fixtures/fixtures/comments/surrounding-call-comments.src.js b/packages/shared-fixtures/fixtures/comments/surrounding-call-comments.src.js deleted file mode 100644 index 6cbc4bf61de5..000000000000 --- a/packages/shared-fixtures/fixtures/comments/surrounding-call-comments.src.js +++ /dev/null @@ -1,5 +0,0 @@ -function a() { - /* before */ - foo(); - /* after */ -} diff --git a/packages/shared-fixtures/fixtures/comments/surrounding-debugger-comments.src.js b/packages/shared-fixtures/fixtures/comments/surrounding-debugger-comments.src.js deleted file mode 100644 index b292546b44fb..000000000000 --- a/packages/shared-fixtures/fixtures/comments/surrounding-debugger-comments.src.js +++ /dev/null @@ -1,5 +0,0 @@ -function a() { - /* before */ - debugger; - /* after */ -} diff --git a/packages/shared-fixtures/fixtures/comments/surrounding-return-comments.src.js b/packages/shared-fixtures/fixtures/comments/surrounding-return-comments.src.js deleted file mode 100644 index ae67152408fb..000000000000 --- a/packages/shared-fixtures/fixtures/comments/surrounding-return-comments.src.js +++ /dev/null @@ -1,5 +0,0 @@ -function a() { - /* before */ - return; - /* after */ -} diff --git a/packages/shared-fixtures/fixtures/comments/surrounding-throw-comments.src.js b/packages/shared-fixtures/fixtures/comments/surrounding-throw-comments.src.js deleted file mode 100644 index 0ebc974917b4..000000000000 --- a/packages/shared-fixtures/fixtures/comments/surrounding-throw-comments.src.js +++ /dev/null @@ -1,5 +0,0 @@ -function a() { - /* before */ - throw 55; - /* after */ -} diff --git a/packages/shared-fixtures/fixtures/comments/surrounding-while-loop-comments.src.js b/packages/shared-fixtures/fixtures/comments/surrounding-while-loop-comments.src.js deleted file mode 100644 index 2134f68be4fe..000000000000 --- a/packages/shared-fixtures/fixtures/comments/surrounding-while-loop-comments.src.js +++ /dev/null @@ -1 +0,0 @@ -function f() { /* infinite */ while (true) { } /* bar */ var each; } diff --git a/packages/shared-fixtures/fixtures/comments/switch-fallthrough-comment-in-function.src.js b/packages/shared-fixtures/fixtures/comments/switch-fallthrough-comment-in-function.src.js deleted file mode 100644 index e71465ae63f7..000000000000 --- a/packages/shared-fixtures/fixtures/comments/switch-fallthrough-comment-in-function.src.js +++ /dev/null @@ -1,9 +0,0 @@ -function bar(foo) { - switch(foo) { - // foo - case 1: - // falls through - case 2: - doIt(); - } -} diff --git a/packages/shared-fixtures/fixtures/comments/switch-fallthrough-comment.src.js b/packages/shared-fixtures/fixtures/comments/switch-fallthrough-comment.src.js deleted file mode 100644 index 3b8bb8eed40d..000000000000 --- a/packages/shared-fixtures/fixtures/comments/switch-fallthrough-comment.src.js +++ /dev/null @@ -1,7 +0,0 @@ -switch(foo) { - // foo - case 1: - // falls through - case 2: - doIt(); -} diff --git a/packages/shared-fixtures/fixtures/comments/switch-no-default-comment-in-function.src.js b/packages/shared-fixtures/fixtures/comments/switch-no-default-comment-in-function.src.js deleted file mode 100644 index 80983bd211ab..000000000000 --- a/packages/shared-fixtures/fixtures/comments/switch-no-default-comment-in-function.src.js +++ /dev/null @@ -1,9 +0,0 @@ -function bar(a) { - switch (a) { - case 2: - break; - case 1: - break; - //no default - } -} diff --git a/packages/shared-fixtures/fixtures/comments/switch-no-default-comment-in-nested-functions.src.js b/packages/shared-fixtures/fixtures/comments/switch-no-default-comment-in-nested-functions.src.js deleted file mode 100644 index 03508aea0a72..000000000000 --- a/packages/shared-fixtures/fixtures/comments/switch-no-default-comment-in-nested-functions.src.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = function(context) { - - function isConstant(node) { - switch (node.type) { - case "SequenceExpression": - return isConstant(node.expressions[node.expressions.length - 1]); - // no default - } - return false; - } - -}; diff --git a/packages/shared-fixtures/fixtures/comments/switch-no-default-comment.src.js b/packages/shared-fixtures/fixtures/comments/switch-no-default-comment.src.js deleted file mode 100644 index 5febe2bccac5..000000000000 --- a/packages/shared-fixtures/fixtures/comments/switch-no-default-comment.src.js +++ /dev/null @@ -1,5 +0,0 @@ -switch (a) { - case 1: - break; - //no default -} diff --git a/packages/shared-fixtures/fixtures/comments/template-string-block.src.js b/packages/shared-fixtures/fixtures/comments/template-string-block.src.js deleted file mode 100644 index 19351f45e710..000000000000 --- a/packages/shared-fixtures/fixtures/comments/template-string-block.src.js +++ /dev/null @@ -1,5 +0,0 @@ -`${name}`; -{ - /* TODO comment comment comment */ - 1 + 1; -} diff --git a/packages/shared-fixtures/fixtures/comments/type-assertion-regression-test.src.ts b/packages/shared-fixtures/fixtures/comments/type-assertion-regression-test.src.ts deleted file mode 100644 index 5b14e9731acd..000000000000 --- a/packages/shared-fixtures/fixtures/comments/type-assertion-regression-test.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -const foo = // test - bar; diff --git a/packages/shared-fixtures/fixtures/javascript/arrayLiteral/array-literal-in-lhs.src.js b/packages/shared-fixtures/fixtures/javascript/arrayLiteral/array-literal-in-lhs.src.js deleted file mode 100644 index b8cd557d4732..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrayLiteral/array-literal-in-lhs.src.js +++ /dev/null @@ -1 +0,0 @@ -fn([]).x = obj; diff --git a/packages/shared-fixtures/fixtures/javascript/arrayLiteral/array-literals-in-binary-expr.src.js b/packages/shared-fixtures/fixtures/javascript/arrayLiteral/array-literals-in-binary-expr.src.js deleted file mode 100644 index e0c12c216910..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrayLiteral/array-literals-in-binary-expr.src.js +++ /dev/null @@ -1 +0,0 @@ -[] + []; diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/as-param-with-params.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/as-param-with-params.src.js deleted file mode 100644 index 248cc450ad83..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/as-param-with-params.src.js +++ /dev/null @@ -1 +0,0 @@ -foo((x, y) => {}); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/as-param.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/as-param.src.js deleted file mode 100644 index fffb35c56227..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/as-param.src.js +++ /dev/null @@ -1 +0,0 @@ -foo(() => {}); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/basic-in-binary-expression.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/basic-in-binary-expression.src.js deleted file mode 100644 index 5549093124c0..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/basic-in-binary-expression.src.js +++ /dev/null @@ -1,2 +0,0 @@ -(a => ({})) + 1; -((a => ({})) + 1); diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/basic.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/basic.src.js deleted file mode 100644 index ad0d3df63fe9..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/basic.src.js +++ /dev/null @@ -1 +0,0 @@ -() => "test"; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/block-body-not-object.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/block-body-not-object.src.js deleted file mode 100644 index 5ee5169b312b..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/block-body-not-object.src.js +++ /dev/null @@ -1 +0,0 @@ -e => { label: 42 }; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/block-body.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/block-body.src.js deleted file mode 100644 index f7902e3a3386..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/block-body.src.js +++ /dev/null @@ -1 +0,0 @@ -e => { 42; }; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-dup-params.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-dup-params.src.js deleted file mode 100644 index 38395bd1c5d0..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-dup-params.src.js +++ /dev/null @@ -1 +0,0 @@ -(a, a) => 42; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-missing-paren.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-missing-paren.src.js deleted file mode 100644 index e17b13c8d6da..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-missing-paren.src.js +++ /dev/null @@ -1 +0,0 @@ -(a, (b)) => 42; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-not-arrow.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-not-arrow.src.js deleted file mode 100644 index 72cbc0fc5d85..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-not-arrow.src.js +++ /dev/null @@ -1 +0,0 @@ -left = (aSize.width/2) - () \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-numeric-param-multi.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-numeric-param-multi.src.js deleted file mode 100644 index e4b6d3900abb..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-numeric-param-multi.src.js +++ /dev/null @@ -1 +0,0 @@ -(10, 20) => 0; diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-numeric-param.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-numeric-param.src.js deleted file mode 100644 index 0ce82a509cb3..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-numeric-param.src.js +++ /dev/null @@ -1 +0,0 @@ -(10) => 0; diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-reverse-arrow.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-reverse-arrow.src.js deleted file mode 100644 index 31aa8cee2ae4..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-reverse-arrow.src.js +++ /dev/null @@ -1 +0,0 @@ -() <= 42; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-default-param-eval.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-default-param-eval.src.js deleted file mode 100644 index 4f8c006ac014..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-default-param-eval.src.js +++ /dev/null @@ -1 +0,0 @@ -"use strict"; (eval = 10) => 42; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-dup-params.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-dup-params.src.js deleted file mode 100644 index f93258b365f4..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-dup-params.src.js +++ /dev/null @@ -1 +0,0 @@ -"use strict"; (a, a) => 42; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-eval-return.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-eval-return.src.js deleted file mode 100644 index 4a9a5d2c3010..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-eval-return.src.js +++ /dev/null @@ -1 +0,0 @@ -"use strict"; (eval) => 42 \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-eval.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-eval.src.js deleted file mode 100644 index 6bba987d7e07..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-eval.src.js +++ /dev/null @@ -1 +0,0 @@ -(eval) => { "use strict"; 42 } \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-octal.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-octal.src.js deleted file mode 100644 index e199dc28811f..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-octal.src.js +++ /dev/null @@ -1 +0,0 @@ -"use strict"; (a) => 00; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-param-arguments.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-param-arguments.src.js deleted file mode 100644 index 15617f88e041..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-param-arguments.src.js +++ /dev/null @@ -1 +0,0 @@ -"use strict"; (arguments, a) => 42; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-param-eval.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-param-eval.src.js deleted file mode 100644 index 672a5206c66d..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-param-eval.src.js +++ /dev/null @@ -1 +0,0 @@ -"use strict"; (eval, a) => 42; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-param-names.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-param-names.src.js deleted file mode 100644 index 672a5206c66d..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-param-names.src.js +++ /dev/null @@ -1 +0,0 @@ -"use strict"; (eval, a) => 42; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-param-no-paren-arguments.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-param-no-paren-arguments.src.js deleted file mode 100644 index 40c40bf9436f..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-param-no-paren-arguments.src.js +++ /dev/null @@ -1 +0,0 @@ -"use strict"; arguments => 42; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-param-no-paren-eval.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-param-no-paren-eval.src.js deleted file mode 100644 index 87f875602b53..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-strict-param-no-paren-eval.src.js +++ /dev/null @@ -1 +0,0 @@ -"use strict"; eval => 42; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-two-lines.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-two-lines.src.js deleted file mode 100644 index 22213ad116bc..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-two-lines.src.js +++ /dev/null @@ -1,2 +0,0 @@ -var a = () - => 0; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-wrapped-param.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-wrapped-param.src.js deleted file mode 100644 index 77cf2b5b8381..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/error-wrapped-param.src.js +++ /dev/null @@ -1 +0,0 @@ -((a)) => 42; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/expression.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/expression.src.js deleted file mode 100644 index 046e74ece9c3..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/expression.src.js +++ /dev/null @@ -1 +0,0 @@ -(x => x); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/iife.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/iife.src.js deleted file mode 100644 index 37a088a0f158..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/iife.src.js +++ /dev/null @@ -1 +0,0 @@ -e => ({ property: 42 }); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/multiple-params.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/multiple-params.src.js deleted file mode 100644 index 26ac16e44cfa..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/multiple-params.src.js +++ /dev/null @@ -1 +0,0 @@ -(a, b) => "test"; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/no-auto-return.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/no-auto-return.src.js deleted file mode 100644 index 2c9dd12d0481..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/no-auto-return.src.js +++ /dev/null @@ -1 +0,0 @@ -(a, b) => { 42; }; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/not-strict-arguments.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/not-strict-arguments.src.js deleted file mode 100644 index 7ea5c0a45076..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/not-strict-arguments.src.js +++ /dev/null @@ -1 +0,0 @@ -arguments => 42; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/not-strict-eval-params.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/not-strict-eval-params.src.js deleted file mode 100644 index 5a51236aa6f8..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/not-strict-eval-params.src.js +++ /dev/null @@ -1 +0,0 @@ -(eval, a) => 42; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/not-strict-eval.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/not-strict-eval.src.js deleted file mode 100644 index db0c68fe0aef..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/not-strict-eval.src.js +++ /dev/null @@ -1 +0,0 @@ -eval => 42; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/not-strict-octal.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/not-strict-octal.src.js deleted file mode 100644 index dd77023f6314..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/not-strict-octal.src.js +++ /dev/null @@ -1 +0,0 @@ -(a) => 0o0; diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/return-arrow-function.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/return-arrow-function.src.js deleted file mode 100644 index 535922a77760..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/return-arrow-function.src.js +++ /dev/null @@ -1 +0,0 @@ -x => y => 42; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/return-sequence.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/return-sequence.src.js deleted file mode 100644 index ee165aec01a0..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/return-sequence.src.js +++ /dev/null @@ -1 +0,0 @@ -(x) => ((y, z) => (x, y, z)); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/single-param-parens.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/single-param-parens.src.js deleted file mode 100644 index cf5e9932c5e7..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/single-param-parens.src.js +++ /dev/null @@ -1 +0,0 @@ -(e) => "test"; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/single-param-return-identifier.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/single-param-return-identifier.src.js deleted file mode 100644 index fdbaa2c998ee..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/single-param-return-identifier.src.js +++ /dev/null @@ -1 +0,0 @@ -(sun) => earth; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/single-param.src.js b/packages/shared-fixtures/fixtures/javascript/arrowFunctions/single-param.src.js deleted file mode 100644 index 49a04ad0bcf9..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/arrowFunctions/single-param.src.js +++ /dev/null @@ -1 +0,0 @@ -e => "test"; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/basics/and-operator-array-object.src.js b/packages/shared-fixtures/fixtures/javascript/basics/and-operator-array-object.src.js deleted file mode 100644 index 44480a0136b8..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/basics/and-operator-array-object.src.js +++ /dev/null @@ -1,4 +0,0 @@ -var v = {} && {} && [] && "" && ("" && {}); -var x = [] && [] && {} && "" && ("" && []); -var z = [] && []; -var y = {} && {}; diff --git a/packages/shared-fixtures/fixtures/javascript/basics/delete-expression.src.js b/packages/shared-fixtures/fixtures/javascript/basics/delete-expression.src.js deleted file mode 100644 index 23cb06466d66..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/basics/delete-expression.src.js +++ /dev/null @@ -1 +0,0 @@ -delete foo.bar; diff --git a/packages/shared-fixtures/fixtures/javascript/basics/do-while-statements.src.js b/packages/shared-fixtures/fixtures/javascript/basics/do-while-statements.src.js deleted file mode 100644 index f2c72e8efc56..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/basics/do-while-statements.src.js +++ /dev/null @@ -1,6 +0,0 @@ -do; while(1); - -var i = 0; -do { - i += 1; -} while (i < 5); diff --git a/packages/shared-fixtures/fixtures/javascript/basics/identifiers-double-underscore.src.js b/packages/shared-fixtures/fixtures/javascript/basics/identifiers-double-underscore.src.js deleted file mode 100644 index b765d562e143..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/basics/identifiers-double-underscore.src.js +++ /dev/null @@ -1,9 +0,0 @@ -var __test = 'ff'; - -class __Foo { - -} - -function __Bar() { - -} diff --git a/packages/shared-fixtures/fixtures/javascript/basics/instanceof.src.js b/packages/shared-fixtures/fixtures/javascript/basics/instanceof.src.js deleted file mode 100644 index 909f769f83de..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/basics/instanceof.src.js +++ /dev/null @@ -1 +0,0 @@ -'' instanceof Set \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/basics/new-with-member-expression.src.js b/packages/shared-fixtures/fixtures/javascript/basics/new-with-member-expression.src.js deleted file mode 100644 index 01c67fc786c0..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/basics/new-with-member-expression.src.js +++ /dev/null @@ -1 +0,0 @@ -new foo.bar(); diff --git a/packages/shared-fixtures/fixtures/javascript/basics/new-without-parens.src.js b/packages/shared-fixtures/fixtures/javascript/basics/new-without-parens.src.js deleted file mode 100644 index fd30dda06abe..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/basics/new-without-parens.src.js +++ /dev/null @@ -1,2 +0,0 @@ -function X () {} -new X; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/basics/or-operator-array-object.src.js b/packages/shared-fixtures/fixtures/javascript/basics/or-operator-array-object.src.js deleted file mode 100644 index 0b78444d619b..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/basics/or-operator-array-object.src.js +++ /dev/null @@ -1,4 +0,0 @@ -var v = {} || {} || [] || "" || ("" || {}); -var x = [] || [] || {} || "" || ("" || []); -var z = [] || []; -var y = {} || {}; diff --git a/packages/shared-fixtures/fixtures/javascript/basics/typeof-expression.src.js b/packages/shared-fixtures/fixtures/javascript/basics/typeof-expression.src.js deleted file mode 100644 index 43d0ea77840c..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/basics/typeof-expression.src.js +++ /dev/null @@ -1 +0,0 @@ -typeof 'str' diff --git a/packages/shared-fixtures/fixtures/javascript/basics/update-expression.src.js b/packages/shared-fixtures/fixtures/javascript/basics/update-expression.src.js deleted file mode 100644 index 1c94b625bd2e..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/basics/update-expression.src.js +++ /dev/null @@ -1,5 +0,0 @@ -var i = 0; -function f() { - i++; -} -f(); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/basics/void-expression.src.js b/packages/shared-fixtures/fixtures/javascript/basics/void-expression.src.js deleted file mode 100644 index 7da947c9a451..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/basics/void-expression.src.js +++ /dev/null @@ -1,2 +0,0 @@ -void 4; -void(3); diff --git a/packages/shared-fixtures/fixtures/javascript/bigIntLiterals/binary.src.js b/packages/shared-fixtures/fixtures/javascript/bigIntLiterals/binary.src.js deleted file mode 100644 index 2b138015de5e..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/bigIntLiterals/binary.src.js +++ /dev/null @@ -1 +0,0 @@ -0b1n; diff --git a/packages/shared-fixtures/fixtures/javascript/bigIntLiterals/decimal.src.js b/packages/shared-fixtures/fixtures/javascript/bigIntLiterals/decimal.src.js deleted file mode 100644 index fe03424dbb56..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/bigIntLiterals/decimal.src.js +++ /dev/null @@ -1 +0,0 @@ -1n; diff --git a/packages/shared-fixtures/fixtures/javascript/bigIntLiterals/hex.src.js b/packages/shared-fixtures/fixtures/javascript/bigIntLiterals/hex.src.js deleted file mode 100644 index 204f239e3696..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/bigIntLiterals/hex.src.js +++ /dev/null @@ -1 +0,0 @@ -0x1n; diff --git a/packages/shared-fixtures/fixtures/javascript/bigIntLiterals/numeric-separator.src.js b/packages/shared-fixtures/fixtures/javascript/bigIntLiterals/numeric-separator.src.js deleted file mode 100644 index 75db46096c10..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/bigIntLiterals/numeric-separator.src.js +++ /dev/null @@ -1 +0,0 @@ -1_2_3n; diff --git a/packages/shared-fixtures/fixtures/javascript/bigIntLiterals/octal.src.js b/packages/shared-fixtures/fixtures/javascript/bigIntLiterals/octal.src.js deleted file mode 100644 index f2ce84fefe08..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/bigIntLiterals/octal.src.js +++ /dev/null @@ -1 +0,0 @@ -0o1n; diff --git a/packages/shared-fixtures/fixtures/javascript/binaryLiterals/invalid.src.js b/packages/shared-fixtures/fixtures/javascript/binaryLiterals/invalid.src.js deleted file mode 100644 index 719fc33cbe40..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/binaryLiterals/invalid.src.js +++ /dev/null @@ -1 +0,0 @@ -0b102; diff --git a/packages/shared-fixtures/fixtures/javascript/binaryLiterals/lowercase.src.js b/packages/shared-fixtures/fixtures/javascript/binaryLiterals/lowercase.src.js deleted file mode 100644 index edde9a3b5977..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/binaryLiterals/lowercase.src.js +++ /dev/null @@ -1 +0,0 @@ -0b101; diff --git a/packages/shared-fixtures/fixtures/javascript/binaryLiterals/uppercase.src.js b/packages/shared-fixtures/fixtures/javascript/binaryLiterals/uppercase.src.js deleted file mode 100644 index 9cb6f2fb1b5c..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/binaryLiterals/uppercase.src.js +++ /dev/null @@ -1 +0,0 @@ -0B101; diff --git a/packages/shared-fixtures/fixtures/javascript/blockBindings/const.src.js b/packages/shared-fixtures/fixtures/javascript/blockBindings/const.src.js deleted file mode 100644 index 70b0430bf3e2..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/blockBindings/const.src.js +++ /dev/null @@ -1 +0,0 @@ -const foo = bar; diff --git a/packages/shared-fixtures/fixtures/javascript/blockBindings/let-in-switchcase.src.js b/packages/shared-fixtures/fixtures/javascript/blockBindings/let-in-switchcase.src.js deleted file mode 100644 index 5df03fa0b726..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/blockBindings/let-in-switchcase.src.js +++ /dev/null @@ -1 +0,0 @@ -switch (answer) { case 42: let t = 42; break; } diff --git a/packages/shared-fixtures/fixtures/javascript/blockBindings/let.src.js b/packages/shared-fixtures/fixtures/javascript/blockBindings/let.src.js deleted file mode 100644 index c85081ab6c40..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/blockBindings/let.src.js +++ /dev/null @@ -1 +0,0 @@ -let foo = bar; diff --git a/packages/shared-fixtures/fixtures/javascript/callExpression/call-expression-with-array.src.js b/packages/shared-fixtures/fixtures/javascript/callExpression/call-expression-with-array.src.js deleted file mode 100644 index 48530445d523..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/callExpression/call-expression-with-array.src.js +++ /dev/null @@ -1 +0,0 @@ -foo([]); diff --git a/packages/shared-fixtures/fixtures/javascript/callExpression/call-expression-with-object.src.js b/packages/shared-fixtures/fixtures/javascript/callExpression/call-expression-with-object.src.js deleted file mode 100644 index 5f81d97dab3c..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/callExpression/call-expression-with-object.src.js +++ /dev/null @@ -1 +0,0 @@ -foo({}); diff --git a/packages/shared-fixtures/fixtures/javascript/callExpression/mixed-expression.src.js b/packages/shared-fixtures/fixtures/javascript/callExpression/mixed-expression.src.js deleted file mode 100644 index 004c3ef0eba2..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/callExpression/mixed-expression.src.js +++ /dev/null @@ -1,5 +0,0 @@ -(function () { - (function () { - this.call({}, []) - })([]); -})({}); diff --git a/packages/shared-fixtures/fixtures/javascript/callExpression/new-expression-with-array.src.js b/packages/shared-fixtures/fixtures/javascript/callExpression/new-expression-with-array.src.js deleted file mode 100644 index 350613c74e84..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/callExpression/new-expression-with-array.src.js +++ /dev/null @@ -1,2 +0,0 @@ -new bar([]); -new bar([[{}]]); diff --git a/packages/shared-fixtures/fixtures/javascript/callExpression/new-expression-with-object.src.js b/packages/shared-fixtures/fixtures/javascript/callExpression/new-expression-with-object.src.js deleted file mode 100644 index 33f2efff852a..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/callExpression/new-expression-with-object.src.js +++ /dev/null @@ -1,2 +0,0 @@ -new bar({}); - diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-accessor-properties.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-accessor-properties.src.js deleted file mode 100644 index 5788395aaa33..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-accessor-properties.src.js +++ /dev/null @@ -1 +0,0 @@ -class A {get a(){} set b(c){};}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-computed-static-method.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-computed-static-method.src.js deleted file mode 100644 index f960fe06cd30..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-computed-static-method.src.js +++ /dev/null @@ -1 +0,0 @@ -class A {static [a](){};}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-expression.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-expression.src.js deleted file mode 100644 index ac7ea1bef0c9..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-expression.src.js +++ /dev/null @@ -1 +0,0 @@ -(class {}); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-method-named-prototype.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-method-named-prototype.src.js deleted file mode 100644 index 5f8f86aeebe0..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-method-named-prototype.src.js +++ /dev/null @@ -1 +0,0 @@ -class A {prototype(){}}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-method-named-static.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-method-named-static.src.js deleted file mode 100644 index 4b8882f7305c..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-method-named-static.src.js +++ /dev/null @@ -1 +0,0 @@ -class A {static(){};}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-method-named-with-space.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-method-named-with-space.src.js deleted file mode 100644 index 3e1360594e06..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-method-named-with-space.src.js +++ /dev/null @@ -1 +0,0 @@ -class A {withSpace () {}} diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-one-method-super.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-one-method-super.src.js deleted file mode 100644 index 304405d389ef..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-one-method-super.src.js +++ /dev/null @@ -1,5 +0,0 @@ -class A { - a(){ - super(); - } -}; diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-one-method.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-one-method.src.js deleted file mode 100644 index cbae5822e572..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-one-method.src.js +++ /dev/null @@ -1,3 +0,0 @@ -class A { - a(){} -}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-private-identifier-accessor.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-private-identifier-accessor.src.js deleted file mode 100644 index 6a8a89931955..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-private-identifier-accessor.src.js +++ /dev/null @@ -1,8 +0,0 @@ -class Foo { - get #priv1() { return 1 } - set #priv1(value) { } - - constructor() { - this.#priv1 = 1; - } -} diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-private-identifier-field.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-private-identifier-field.src.js deleted file mode 100644 index 4519b85cd975..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-private-identifier-field.src.js +++ /dev/null @@ -1,8 +0,0 @@ -class Foo { - #priv1; - #priv2 = 1; - - constructor() { - this.#priv1 = 1; - } -} diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-private-identifier-method.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-private-identifier-method.src.js deleted file mode 100644 index f2694d08e36b..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-private-identifier-method.src.js +++ /dev/null @@ -1,7 +0,0 @@ -class Foo { - #bar() {} - - constructor() { - this.#bar(); - } -} diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-static-method-named-prototype.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-static-method-named-prototype.src.js deleted file mode 100644 index 9a2019e9b33c..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-static-method-named-prototype.src.js +++ /dev/null @@ -1 +0,0 @@ -class A {static ["prototype"](){}}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-static-method-named-static.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-static-method-named-static.src.js deleted file mode 100644 index 947d978d328b..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-static-method-named-static.src.js +++ /dev/null @@ -1 +0,0 @@ -class A {static static(){};}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-static-method.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-static-method.src.js deleted file mode 100644 index dea98b8d153d..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-static-method.src.js +++ /dev/null @@ -1 +0,0 @@ -class A {static a(){};}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-static-methods-and-accessor-properties.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-static-methods-and-accessor-properties.src.js deleted file mode 100644 index 5efab6d986b6..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-static-methods-and-accessor-properties.src.js +++ /dev/null @@ -1 +0,0 @@ -class A {static a(){} static get a(){} static set a(b){} }; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-two-computed-static-methods.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-two-computed-static-methods.src.js deleted file mode 100644 index 8a3d1cf96ae8..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-two-computed-static-methods.src.js +++ /dev/null @@ -1 +0,0 @@ -class A {static[a](){}; static[b](){}}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-two-methods-computed-constructor.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-two-methods-computed-constructor.src.js deleted file mode 100644 index 66a3500ba613..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-two-methods-computed-constructor.src.js +++ /dev/null @@ -1 +0,0 @@ -class A {"constructor"(){} ["constructor"](){}}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-two-methods-semi.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-two-methods-semi.src.js deleted file mode 100644 index eae3cf562544..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-two-methods-semi.src.js +++ /dev/null @@ -1 +0,0 @@ -class A {a(){};b(){}}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-two-methods-three-semi.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-two-methods-three-semi.src.js deleted file mode 100644 index db2c06ce65d4..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-two-methods-three-semi.src.js +++ /dev/null @@ -1 +0,0 @@ -class A {;a(){};b(){};}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-two-methods-two-semi.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-two-methods-two-semi.src.js deleted file mode 100644 index 30f2b72c83b6..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-two-methods-two-semi.src.js +++ /dev/null @@ -1 +0,0 @@ -class A {a(){};b(){};}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-two-methods.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-two-methods.src.js deleted file mode 100644 index b30e1d968e3c..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-two-methods.src.js +++ /dev/null @@ -1 +0,0 @@ -class A {a(){}b(){}}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-two-static-methods-named-constructor.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-two-static-methods-named-constructor.src.js deleted file mode 100644 index 57bbee9df047..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-two-static-methods-named-constructor.src.js +++ /dev/null @@ -1 +0,0 @@ -class A {static constructor(){} static constructor(){}}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-with-constructor-parameters.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-with-constructor-parameters.src.js deleted file mode 100644 index 92ffc4912b13..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-with-constructor-parameters.src.js +++ /dev/null @@ -1 +0,0 @@ -class A {constructor(foo, bar){}} diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-with-constructor-with-space.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-with-constructor-with-space.src.js deleted file mode 100644 index af3f316ec017..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-with-constructor-with-space.src.js +++ /dev/null @@ -1 +0,0 @@ -class A {constructor (){}}; diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-with-constructor.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-with-constructor.src.js deleted file mode 100644 index 00fcd7be15ef..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-with-constructor.src.js +++ /dev/null @@ -1 +0,0 @@ -class A {constructor(){}}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/class-with-no-body.src.js b/packages/shared-fixtures/fixtures/javascript/classes/class-with-no-body.src.js deleted file mode 100644 index c389887ee5aa..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/class-with-no-body.src.js +++ /dev/null @@ -1 +0,0 @@ -class Foo diff --git a/packages/shared-fixtures/fixtures/javascript/classes/derived-class-assign-to-var.src.js b/packages/shared-fixtures/fixtures/javascript/classes/derived-class-assign-to-var.src.js deleted file mode 100644 index fba446ff6e45..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/derived-class-assign-to-var.src.js +++ /dev/null @@ -1 +0,0 @@ -var x = class A extends 0{}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/derived-class-expression.src.js b/packages/shared-fixtures/fixtures/javascript/classes/derived-class-expression.src.js deleted file mode 100644 index b5e6e62ea087..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/derived-class-expression.src.js +++ /dev/null @@ -1 +0,0 @@ -(class extends 0{}); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/empty-class-double-semi.src.js b/packages/shared-fixtures/fixtures/javascript/classes/empty-class-double-semi.src.js deleted file mode 100644 index a650fd681397..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/empty-class-double-semi.src.js +++ /dev/null @@ -1 +0,0 @@ -class A {}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/empty-class-semi.src.js b/packages/shared-fixtures/fixtures/javascript/classes/empty-class-semi.src.js deleted file mode 100644 index e14455cbb559..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/empty-class-semi.src.js +++ /dev/null @@ -1 +0,0 @@ -class A {;}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/empty-class.src.js b/packages/shared-fixtures/fixtures/javascript/classes/empty-class.src.js deleted file mode 100644 index a650fd681397..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/empty-class.src.js +++ /dev/null @@ -1 +0,0 @@ -class A {}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/empty-literal-derived-class.src.js b/packages/shared-fixtures/fixtures/javascript/classes/empty-literal-derived-class.src.js deleted file mode 100644 index 5903f34f08bd..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/empty-literal-derived-class.src.js +++ /dev/null @@ -1 +0,0 @@ -class A extends 0 {}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/invalid-class-declaration.src.js b/packages/shared-fixtures/fixtures/javascript/classes/invalid-class-declaration.src.js deleted file mode 100644 index c3498222f8fa..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/invalid-class-declaration.src.js +++ /dev/null @@ -1 +0,0 @@ -class {}; diff --git a/packages/shared-fixtures/fixtures/javascript/classes/invalid-class-setter-declaration.src.js b/packages/shared-fixtures/fixtures/javascript/classes/invalid-class-setter-declaration.src.js deleted file mode 100644 index 98433ba8b00a..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/invalid-class-setter-declaration.src.js +++ /dev/null @@ -1 +0,0 @@ -class A { set foo() {}}; diff --git a/packages/shared-fixtures/fixtures/javascript/classes/invalid-class-two-super-classes.src.js b/packages/shared-fixtures/fixtures/javascript/classes/invalid-class-two-super-classes.src.js deleted file mode 100644 index dbac127c0814..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/invalid-class-two-super-classes.src.js +++ /dev/null @@ -1 +0,0 @@ -class A extends B, C {} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/named-class-expression.src.js b/packages/shared-fixtures/fixtures/javascript/classes/named-class-expression.src.js deleted file mode 100644 index 9829e5d0ddd1..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/named-class-expression.src.js +++ /dev/null @@ -1 +0,0 @@ -(class A {}); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/classes/named-derived-class-expression.src.js b/packages/shared-fixtures/fixtures/javascript/classes/named-derived-class-expression.src.js deleted file mode 100644 index cb8f8a94b99b..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/classes/named-derived-class-expression.src.js +++ /dev/null @@ -1 +0,0 @@ -(class A extends 0{}); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-conditional.src.js b/packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-conditional.src.js deleted file mode 100644 index 91b8fc245fad..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-conditional.src.js +++ /dev/null @@ -1 +0,0 @@ -var xx = (xx ? x++ : 4, 10); diff --git a/packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-multi.src.js b/packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-multi.src.js deleted file mode 100644 index 4673c7386b6d..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-multi.src.js +++ /dev/null @@ -1 +0,0 @@ -var v1 = (1, 2, 3, 4, 5, 6, 7); diff --git a/packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-nested.src.js b/packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-nested.src.js deleted file mode 100644 index 0a833449d1d4..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-nested.src.js +++ /dev/null @@ -1 +0,0 @@ -var v1 = ((1, 2, 3), 4, 5, (6, 7)); diff --git a/packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-return.src.js b/packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-return.src.js deleted file mode 100644 index e937c22ba10f..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-return.src.js +++ /dev/null @@ -1,4 +0,0 @@ -function f1() { - var a = 1; - return a, v1, a; -} diff --git a/packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-simple-nested.src.js b/packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-simple-nested.src.js deleted file mode 100644 index 0eac8b8c3d9c..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-simple-nested.src.js +++ /dev/null @@ -1 +0,0 @@ -const foo = (((1, 2))); diff --git a/packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-simple.src.js b/packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-simple.src.js deleted file mode 100644 index e70554e973fb..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/commaOperator/comma-operator-simple.src.js +++ /dev/null @@ -1 +0,0 @@ -const foo = (1); diff --git a/packages/shared-fixtures/fixtures/javascript/defaultParams/class-constructor.src.js b/packages/shared-fixtures/fixtures/javascript/defaultParams/class-constructor.src.js deleted file mode 100644 index 901358c2f16c..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/defaultParams/class-constructor.src.js +++ /dev/null @@ -1,4 +0,0 @@ -class A { - constructor(foo='bar') { - } -} diff --git a/packages/shared-fixtures/fixtures/javascript/defaultParams/class-method.src.js b/packages/shared-fixtures/fixtures/javascript/defaultParams/class-method.src.js deleted file mode 100644 index cb113e755fff..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/defaultParams/class-method.src.js +++ /dev/null @@ -1,4 +0,0 @@ -class A { - foo(bar='baz') { - } -} diff --git a/packages/shared-fixtures/fixtures/javascript/defaultParams/declaration.src.js b/packages/shared-fixtures/fixtures/javascript/defaultParams/declaration.src.js deleted file mode 100644 index 7885715f86b0..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/defaultParams/declaration.src.js +++ /dev/null @@ -1 +0,0 @@ -function f(a = 1) {} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/defaultParams/expression.src.js b/packages/shared-fixtures/fixtures/javascript/defaultParams/expression.src.js deleted file mode 100644 index 25993b363d55..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/defaultParams/expression.src.js +++ /dev/null @@ -1 +0,0 @@ -x = function(y = 1) {} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/defaultParams/method.src.js b/packages/shared-fixtures/fixtures/javascript/defaultParams/method.src.js deleted file mode 100644 index 2537287de022..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/defaultParams/method.src.js +++ /dev/null @@ -1 +0,0 @@ -x = { f: function(a=1) {} } \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/defaultParams/not-all-params.src.js b/packages/shared-fixtures/fixtures/javascript/defaultParams/not-all-params.src.js deleted file mode 100644 index 3bfab96a2698..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/defaultParams/not-all-params.src.js +++ /dev/null @@ -1 +0,0 @@ -var foo = function(a, b = 42, c) {}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-array.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-array.src.js deleted file mode 100644 index c2f38722e62b..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-array.src.js +++ /dev/null @@ -1 +0,0 @@ -([y]) => x; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-array.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-array.src.js deleted file mode 100644 index 75bb19b495b8..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-array.src.js +++ /dev/null @@ -1 +0,0 @@ -([y, [x]]) => x; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src.js deleted file mode 100644 index c2a809e04a22..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src.js +++ /dev/null @@ -1 +0,0 @@ -({foo: y, a:{bar: x}}) => x; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-object.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-object.src.js deleted file mode 100644 index 177cd72468dd..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-object.src.js +++ /dev/null @@ -1 +0,0 @@ -({y, a:{x}}) => x; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-object.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-object.src.js deleted file mode 100644 index 7f6a1fb1436e..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-object.src.js +++ /dev/null @@ -1 +0,0 @@ -({y}) => x; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-array.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-array.src.js deleted file mode 100644 index 7fa2d1940626..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-array.src.js +++ /dev/null @@ -1 +0,0 @@ -([x = 10]) => x \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-object-nested.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-object-nested.src.js deleted file mode 100644 index 410eed8cc78f..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-object-nested.src.js +++ /dev/null @@ -1 +0,0 @@ -({x = 10, y: { z = 10 }}) => [x, z] \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-object.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-object.src.js deleted file mode 100644 index c6b403750620..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-object.src.js +++ /dev/null @@ -1 +0,0 @@ -({x = 10}) => x \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/array-const-undefined.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/array-const-undefined.src.js deleted file mode 100644 index 0ff51d044822..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/array-const-undefined.src.js +++ /dev/null @@ -1 +0,0 @@ -const [a] = []; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/array-let-undefined.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/array-let-undefined.src.js deleted file mode 100644 index c705f581d5a1..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/array-let-undefined.src.js +++ /dev/null @@ -1 +0,0 @@ -let [a] = []; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/object-const-named.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/object-const-named.src.js deleted file mode 100644 index 67a0d1a4e9c7..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/object-const-named.src.js +++ /dev/null @@ -1 +0,0 @@ -const {a:b} = {}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/object-const-undefined.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/object-const-undefined.src.js deleted file mode 100644 index 80b78cb8d264..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/object-const-undefined.src.js +++ /dev/null @@ -1 +0,0 @@ -const {a} = {}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/object-let-named.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/object-let-named.src.js deleted file mode 100644 index 53b1654cb828..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/object-let-named.src.js +++ /dev/null @@ -1 +0,0 @@ -let {a:b} = {}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/object-let-undefined.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/object-let-undefined.src.js deleted file mode 100644 index 51c02f8b6ed1..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-blockBindings/object-let-undefined.src.js +++ /dev/null @@ -1 +0,0 @@ -let {a} = {}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-defaultParams/param-array.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-defaultParams/param-array.src.js deleted file mode 100644 index b233ca5bd452..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-defaultParams/param-array.src.js +++ /dev/null @@ -1 +0,0 @@ -function f([x] = [1]) {}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-defaultParams/param-object-short.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-defaultParams/param-object-short.src.js deleted file mode 100644 index 0821397f396c..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-defaultParams/param-object-short.src.js +++ /dev/null @@ -1 +0,0 @@ -({f({x} = {x: 10}) {}}); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-defaultParams/param-object-wrapped.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-defaultParams/param-object-wrapped.src.js deleted file mode 100644 index 1740302f8291..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-defaultParams/param-object-wrapped.src.js +++ /dev/null @@ -1 +0,0 @@ -({f: function({x} = {x: 10}) {}}); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-defaultParams/param-object.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-defaultParams/param-object.src.js deleted file mode 100644 index 753d7b471310..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-defaultParams/param-object.src.js +++ /dev/null @@ -1 +0,0 @@ -f = function({x} = {x: 10}) {}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-forOf/loop.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-forOf/loop.src.js deleted file mode 100644 index 7751aeddd636..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-forOf/loop.src.js +++ /dev/null @@ -1 +0,0 @@ -for ([a] of foo); diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/complex-destructured.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/complex-destructured.src.js deleted file mode 100644 index a14d109bf05d..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/complex-destructured.src.js +++ /dev/null @@ -1 +0,0 @@ -[{ a, b }, ...c] = d; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/destructured-array-literal.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/destructured-array-literal.src.js deleted file mode 100644 index aa3e6bed2221..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/destructured-array-literal.src.js +++ /dev/null @@ -1 +0,0 @@ -[a, ...[b, c]] = d; diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/destructuring-param.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/destructuring-param.src.js deleted file mode 100644 index 28bec5ed0b4e..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/destructuring-param.src.js +++ /dev/null @@ -1 +0,0 @@ -function a([a, b, ...[ok]]) {}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/error-complex-destructured-spread-first.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/error-complex-destructured-spread-first.src.js deleted file mode 100644 index eee98799d22b..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/error-complex-destructured-spread-first.src.js +++ /dev/null @@ -1 +0,0 @@ -[...c, { a, b }] = d; diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/invalid-not-final-array-empty.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/invalid-not-final-array-empty.src.js deleted file mode 100644 index 6154cfe049dd..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/invalid-not-final-array-empty.src.js +++ /dev/null @@ -1 +0,0 @@ -[...a, ] = b; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/multi-destructured.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/multi-destructured.src.js deleted file mode 100644 index c7f6aa97b292..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/multi-destructured.src.js +++ /dev/null @@ -1 +0,0 @@ -[a, ...b] = c; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/not-final-array.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/not-final-array.src.js deleted file mode 100644 index cb9a2a141cc8..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/not-final-array.src.js +++ /dev/null @@ -1 +0,0 @@ -[...a, b] = c; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/single-destructured.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/single-destructured.src.js deleted file mode 100644 index 0be6e5d967b2..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/single-destructured.src.js +++ /dev/null @@ -1 +0,0 @@ -[...a] = b; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/var-complex-destructured.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/var-complex-destructured.src.js deleted file mode 100644 index dabf00dc6ecb..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/var-complex-destructured.src.js +++ /dev/null @@ -1 +0,0 @@ -var [{ a, b }, ...c] = d; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/var-destructured-array-literal.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/var-destructured-array-literal.src.js deleted file mode 100644 index ed56a2030533..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/var-destructured-array-literal.src.js +++ /dev/null @@ -1 +0,0 @@ -var [a, ...[b, c]] = d; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/var-multi-destructured.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/var-multi-destructured.src.js deleted file mode 100644 index 897bcba9d9b1..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/var-multi-destructured.src.js +++ /dev/null @@ -1 +0,0 @@ -var [a, ...b] = c; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/var-single-destructured.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/var-single-destructured.src.js deleted file mode 100644 index e6dc8d642048..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring-and-spread/var-single-destructured.src.js +++ /dev/null @@ -1 +0,0 @@ -var [...a] = b; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/array-member.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/array-member.src.js deleted file mode 100644 index ca7265689821..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/array-member.src.js +++ /dev/null @@ -1 +0,0 @@ -[ok.v] = 20; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/array-to-array.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/array-to-array.src.js deleted file mode 100644 index e03adeba1880..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/array-to-array.src.js +++ /dev/null @@ -1 +0,0 @@ -[a, b] = [b, a]; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/array-var-undefined.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/array-var-undefined.src.js deleted file mode 100644 index a802dde0d6b0..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/array-var-undefined.src.js +++ /dev/null @@ -1 +0,0 @@ -var [a] = []; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/call-expression-destruction-array.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/call-expression-destruction-array.src.js deleted file mode 100644 index 1e7c8bbadd58..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/call-expression-destruction-array.src.js +++ /dev/null @@ -1 +0,0 @@ -foo(...[]); diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/call-expression-destruction-object.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/call-expression-destruction-object.src.js deleted file mode 100644 index 216754d2af12..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/call-expression-destruction-object.src.js +++ /dev/null @@ -1 +0,0 @@ -foo(...{}); diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/class-constructor-params-array.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/class-constructor-params-array.src.js deleted file mode 100644 index 8a926b84c4f1..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/class-constructor-params-array.src.js +++ /dev/null @@ -1,4 +0,0 @@ -class A { - consturctor([foo, bar]) { - } -} diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/class-constructor-params-defaults-array.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/class-constructor-params-defaults-array.src.js deleted file mode 100644 index 9afe8da6814b..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/class-constructor-params-defaults-array.src.js +++ /dev/null @@ -1,4 +0,0 @@ -class A { - consturctor([foo=3, bar=4]) { - } -} diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/class-constructor-params-defaults-object.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/class-constructor-params-defaults-object.src.js deleted file mode 100644 index c840ebe15cfb..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/class-constructor-params-defaults-object.src.js +++ /dev/null @@ -1,4 +0,0 @@ -class A { - consturctor({foo=3, bar=4}) { - } -} diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/class-constructor-params-object.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/class-constructor-params-object.src.js deleted file mode 100644 index 49bb33c2b093..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/class-constructor-params-object.src.js +++ /dev/null @@ -1,4 +0,0 @@ -class A { - consturctor({foo, bar}) { - } -} diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/class-method-params-array.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/class-method-params-array.src.js deleted file mode 100644 index 93e433f196b4..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/class-method-params-array.src.js +++ /dev/null @@ -1,4 +0,0 @@ -class A { - foo([bar, baz]) { - } -} diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/class-method-params-defaults-array.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/class-method-params-defaults-array.src.js deleted file mode 100644 index d11458520d7f..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/class-method-params-defaults-array.src.js +++ /dev/null @@ -1,4 +0,0 @@ -class A { - foo([bar=3, baz=4]) { - } -} diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/class-method-params-defaults-object.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/class-method-params-defaults-object.src.js deleted file mode 100644 index ff1eb4c59cf0..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/class-method-params-defaults-object.src.js +++ /dev/null @@ -1,4 +0,0 @@ -class A { - foo({bar=3, baz=3}) { - } -} diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/class-method-params-object.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/class-method-params-object.src.js deleted file mode 100644 index 32683cf92773..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/class-method-params-object.src.js +++ /dev/null @@ -1,4 +0,0 @@ -class A { - foo({bar, baz}) { - } -} diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array-all.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array-all.src.js deleted file mode 100644 index 7fa55d7113f0..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array-all.src.js +++ /dev/null @@ -1 +0,0 @@ -var [x = 10, y = 5, z = 1] = a; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array-longform-nested-multi.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array-longform-nested-multi.src.js deleted file mode 100644 index 7845a89ab06d..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array-longform-nested-multi.src.js +++ /dev/null @@ -1 +0,0 @@ -var {x: x, y: y, z: { a: a = 10} } = b; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array-multi.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array-multi.src.js deleted file mode 100644 index e0030d18850c..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array-multi.src.js +++ /dev/null @@ -1 +0,0 @@ -var [x = 10, y, z] = a; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array-nested-all.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array-nested-all.src.js deleted file mode 100644 index 1925b1e2da93..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array-nested-all.src.js +++ /dev/null @@ -1 +0,0 @@ -var [x = 10, [ z = 10]] = a; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array-nested-multi.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array-nested-multi.src.js deleted file mode 100644 index aa0c025c20aa..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array-nested-multi.src.js +++ /dev/null @@ -1 +0,0 @@ -var [x = 10, [ z ]] = a; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array.src.js deleted file mode 100644 index f95384c66e05..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-array.src.js +++ /dev/null @@ -1 +0,0 @@ -[x=10] = x \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-all.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-all.src.js deleted file mode 100644 index d56d776aabc7..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-all.src.js +++ /dev/null @@ -1 +0,0 @@ -var {x = 10, y = 5, z = 1} = a; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-assign.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-assign.src.js deleted file mode 100644 index 4f84af4a91ca..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-assign.src.js +++ /dev/null @@ -1 +0,0 @@ -({ Object=0, String=0 } = {}) diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-longform-all.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-longform-all.src.js deleted file mode 100644 index df414e99e402..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-longform-all.src.js +++ /dev/null @@ -1 +0,0 @@ -var {x: x = 10, y: y = 10, z: z = 10} = a; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-longform-multi.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-longform-multi.src.js deleted file mode 100644 index c48fc3b89460..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-longform-multi.src.js +++ /dev/null @@ -1 +0,0 @@ -var {x: x, y: y = 10, z: z} = a; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-longform.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-longform.src.js deleted file mode 100644 index f030020d5c02..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-longform.src.js +++ /dev/null @@ -1 +0,0 @@ -var { x: x = 10 } = x; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-mixed-multi.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-mixed-multi.src.js deleted file mode 100644 index 3c186ea51cd9..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-mixed-multi.src.js +++ /dev/null @@ -1 +0,0 @@ -var {x, y: y = 10, z} = a; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-multi.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-multi.src.js deleted file mode 100644 index 48796e029fb4..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-multi.src.js +++ /dev/null @@ -1 +0,0 @@ -var {x = 10, y, z} = a; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-nested-all.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-nested-all.src.js deleted file mode 100644 index ebf4aa8a643d..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-nested-all.src.js +++ /dev/null @@ -1 +0,0 @@ -var {x = 10, y: { z = 10}} = a; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-nested-multi.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-nested-multi.src.js deleted file mode 100644 index 603208cc936d..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object-nested-multi.src.js +++ /dev/null @@ -1 +0,0 @@ -var {x = 10, y: { z }} = a; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object.src.js deleted file mode 100644 index 8735e3d0fe7a..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/defaults-object.src.js +++ /dev/null @@ -1 +0,0 @@ -var {x = 10} = x \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/destructured-array-catch.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/destructured-array-catch.src.js deleted file mode 100644 index e187c79d3822..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/destructured-array-catch.src.js +++ /dev/null @@ -1,7 +0,0 @@ -function x({a}) { - try { - var {b} = a; - } - catch([stack]) { - } -}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/destructured-object-catch.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/destructured-object-catch.src.js deleted file mode 100644 index 2d2d277b17a6..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/destructured-object-catch.src.js +++ /dev/null @@ -1,7 +0,0 @@ -function x({a}) { - try { - var {b} = a; - } - catch({stack}) { - } -}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/invalid-defaults-object-assign.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/invalid-defaults-object-assign.src.js deleted file mode 100644 index f4c0d85bef87..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/invalid-defaults-object-assign.src.js +++ /dev/null @@ -1 +0,0 @@ -({ Object=0, String=0 }) = {} diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/named-param.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/named-param.src.js deleted file mode 100644 index 5f3ddae50e29..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/named-param.src.js +++ /dev/null @@ -1 +0,0 @@ -({ responseText: text } = res); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/nested-array.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/nested-array.src.js deleted file mode 100644 index 1cf79a3aa752..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/nested-array.src.js +++ /dev/null @@ -1 +0,0 @@ -var [x, , [, z]] = [1,2,[3,4]]; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/nested-object.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/nested-object.src.js deleted file mode 100644 index 3f6c5d2ec278..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/nested-object.src.js +++ /dev/null @@ -1 +0,0 @@ -var {x: y, z: { a: b } } = { x: "3", z: { a: "b" } }; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/object-var-named.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/object-var-named.src.js deleted file mode 100644 index 8a2d98a6946a..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/object-var-named.src.js +++ /dev/null @@ -1 +0,0 @@ -var {a:b} = {}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/object-var-undefined.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/object-var-undefined.src.js deleted file mode 100644 index 945bf61102bd..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/object-var-undefined.src.js +++ /dev/null @@ -1 +0,0 @@ -var {a} = {}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/param-defaults-array.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/param-defaults-array.src.js deleted file mode 100644 index e2545e8519ac..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/param-defaults-array.src.js +++ /dev/null @@ -1 +0,0 @@ -function a([x = 10]) {} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/param-defaults-object-nested.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/param-defaults-object-nested.src.js deleted file mode 100644 index baf01aa25d68..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/param-defaults-object-nested.src.js +++ /dev/null @@ -1 +0,0 @@ -function a({x = 10, y: { z = 10 }}) {}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/param-defaults-object.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/param-defaults-object.src.js deleted file mode 100644 index a18df31a40c6..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/param-defaults-object.src.js +++ /dev/null @@ -1 +0,0 @@ -function a({x = 10}) {} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/params-array-wrapped.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/params-array-wrapped.src.js deleted file mode 100644 index b623ac7f45b7..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/params-array-wrapped.src.js +++ /dev/null @@ -1 +0,0 @@ -(function x([ a, b ]){}); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/params-array.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/params-array.src.js deleted file mode 100644 index fda9c68945b0..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/params-array.src.js +++ /dev/null @@ -1 +0,0 @@ -function x([ a, b ]){}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/params-multi-object.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/params-multi-object.src.js deleted file mode 100644 index 1b212bc385af..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/params-multi-object.src.js +++ /dev/null @@ -1 +0,0 @@ -function x(a, { b }){}; diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/params-nested-array.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/params-nested-array.src.js deleted file mode 100644 index 6544066786ea..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/params-nested-array.src.js +++ /dev/null @@ -1 +0,0 @@ -function a([x, , [, z]]) {}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/params-nested-object.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/params-nested-object.src.js deleted file mode 100644 index 78e865b16bfd..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/params-nested-object.src.js +++ /dev/null @@ -1 +0,0 @@ -function a({x: y, z: { a: b } }) {}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/params-object-wrapped.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/params-object-wrapped.src.js deleted file mode 100644 index c9f34398d78b..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/params-object-wrapped.src.js +++ /dev/null @@ -1 +0,0 @@ -(function x({ a, b }){}); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/params-object.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/params-object.src.js deleted file mode 100644 index 5a71f3507199..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/params-object.src.js +++ /dev/null @@ -1 +0,0 @@ -function x({ a, b }){}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/destructuring/sparse-array.src.js b/packages/shared-fixtures/fixtures/javascript/destructuring/sparse-array.src.js deleted file mode 100644 index d17fce97a39b..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/destructuring/sparse-array.src.js +++ /dev/null @@ -1 +0,0 @@ -[a,,b] = array; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/directives/block.src.js b/packages/shared-fixtures/fixtures/javascript/directives/block.src.js deleted file mode 100644 index 8d54ee0f82b1..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/directives/block.src.js +++ /dev/null @@ -1,5 +0,0 @@ -function foo() { - "use strict"; - var a = 1; - "use strict"; -} diff --git a/packages/shared-fixtures/fixtures/javascript/directives/directive-in-class.src.js b/packages/shared-fixtures/fixtures/javascript/directives/directive-in-class.src.js deleted file mode 100644 index 2d2f36d0aac3..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/directives/directive-in-class.src.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; - -class Foo { - constructor () { - "use strict"; - } - - get foo () { - "use strict"; - } - - set foo (value) { - "use strict"; - } - - method () { - "use strict"; - } -} diff --git a/packages/shared-fixtures/fixtures/javascript/directives/first-expression.src.js b/packages/shared-fixtures/fixtures/javascript/directives/first-expression.src.js deleted file mode 100644 index 94045f6dab92..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/directives/first-expression.src.js +++ /dev/null @@ -1,4 +0,0 @@ -// Prevent strings from being parsed as directives -// See https://github.com/prettier/prettier/pull/1560#issue-227225960 -0; -"abc" diff --git a/packages/shared-fixtures/fixtures/javascript/directives/function-non-strict.src.js b/packages/shared-fixtures/fixtures/javascript/directives/function-non-strict.src.js deleted file mode 100644 index 783e003dd374..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/directives/function-non-strict.src.js +++ /dev/null @@ -1,4 +0,0 @@ -function foo () { - "use smth" - 1+1; -} diff --git a/packages/shared-fixtures/fixtures/javascript/directives/non-directive-string.src.js b/packages/shared-fixtures/fixtures/javascript/directives/non-directive-string.src.js deleted file mode 100644 index 51697ce0628b..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/directives/non-directive-string.src.js +++ /dev/null @@ -1,16 +0,0 @@ -if (true) { - "use strict" -} - -switch (true) { - case false: { - "use strict" - } - default: { - "use strict" - } -} - -while (true) { - "use strict" -} diff --git a/packages/shared-fixtures/fixtures/javascript/directives/non-unique-directive.src.js b/packages/shared-fixtures/fixtures/javascript/directives/non-unique-directive.src.js deleted file mode 100644 index 0ae940ac0c7f..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/directives/non-unique-directive.src.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -"use strict"; -"test"; diff --git a/packages/shared-fixtures/fixtures/javascript/directives/program-order.src.js b/packages/shared-fixtures/fixtures/javascript/directives/program-order.src.js deleted file mode 100644 index 43e689ef2a2c..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/directives/program-order.src.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -"use loose"; -var a; diff --git a/packages/shared-fixtures/fixtures/javascript/directives/program.src.js b/packages/shared-fixtures/fixtures/javascript/directives/program.src.js deleted file mode 100644 index 6603b9c5c2c7..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/directives/program.src.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -var a = 1; -"use strict"; diff --git a/packages/shared-fixtures/fixtures/javascript/directives/raw.src.js b/packages/shared-fixtures/fixtures/javascript/directives/raw.src.js deleted file mode 100644 index 10ecb3d5fa1d..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/directives/raw.src.js +++ /dev/null @@ -1 +0,0 @@ -"use\x20strict"; diff --git a/packages/shared-fixtures/fixtures/javascript/experimentalAsyncIteration/async-generators.src.js b/packages/shared-fixtures/fixtures/javascript/experimentalAsyncIteration/async-generators.src.js deleted file mode 100644 index 75fcd2647be0..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/experimentalAsyncIteration/async-generators.src.js +++ /dev/null @@ -1,3 +0,0 @@ -async function* foo() { - -} diff --git a/packages/shared-fixtures/fixtures/javascript/experimentalAsyncIteration/async-iterator.src.js b/packages/shared-fixtures/fixtures/javascript/experimentalAsyncIteration/async-iterator.src.js deleted file mode 100644 index 742ec47ad7ba..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/experimentalAsyncIteration/async-iterator.src.js +++ /dev/null @@ -1,5 +0,0 @@ -async function foo() { - for await (const item of items) { - - } -} diff --git a/packages/shared-fixtures/fixtures/javascript/experimentalDynamicImport/dynamic-import.src.js b/packages/shared-fixtures/fixtures/javascript/experimentalDynamicImport/dynamic-import.src.js deleted file mode 100644 index 18dff34f73a5..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/experimentalDynamicImport/dynamic-import.src.js +++ /dev/null @@ -1 +0,0 @@ -import('foo').then(main); diff --git a/packages/shared-fixtures/fixtures/javascript/experimentalDynamicImport/error-dynamic-import-params.src.js b/packages/shared-fixtures/fixtures/javascript/experimentalDynamicImport/error-dynamic-import-params.src.js deleted file mode 100644 index 6dfb45db7e98..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/experimentalDynamicImport/error-dynamic-import-params.src.js +++ /dev/null @@ -1 +0,0 @@ -import('foo', '', '') diff --git a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/arg-spread.src.js b/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/arg-spread.src.js deleted file mode 100644 index 99da0c5393ec..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/arg-spread.src.js +++ /dev/null @@ -1 +0,0 @@ -function c({a, ...b}) {} diff --git a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/destructuring-assign-mirror.src.js b/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/destructuring-assign-mirror.src.js deleted file mode 100644 index 0caa3fab4a96..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/destructuring-assign-mirror.src.js +++ /dev/null @@ -1 +0,0 @@ -({a, ...b} = {a, ...b}) diff --git a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/function-parameter-object-spread.src.js b/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/function-parameter-object-spread.src.js deleted file mode 100644 index 29fda8e4a120..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/function-parameter-object-spread.src.js +++ /dev/null @@ -1 +0,0 @@ -function foo({...bar}) { } diff --git a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/invalid-rest-trailing-comma.src.js b/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/invalid-rest-trailing-comma.src.js deleted file mode 100644 index 39ef542fe289..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/invalid-rest-trailing-comma.src.js +++ /dev/null @@ -1 +0,0 @@ -var { x, y, ...z, } = foo; diff --git a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/invalid-rest.src.js b/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/invalid-rest.src.js deleted file mode 100644 index a38d92cf9298..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/invalid-rest.src.js +++ /dev/null @@ -1 +0,0 @@ -var { x, y, ...foo.bar } = { x: 1, y: 2, a: 3, b: 4 }; diff --git a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/object-rest.src.js b/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/object-rest.src.js deleted file mode 100644 index 4d733791c65d..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/object-rest.src.js +++ /dev/null @@ -1 +0,0 @@ -var { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 }; diff --git a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/property-spread.src.js b/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/property-spread.src.js deleted file mode 100644 index 1ef4ef44c8a6..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/property-spread.src.js +++ /dev/null @@ -1,9 +0,0 @@ -var foo, - get, - set; - -var x = { - foo: foo, - get: get, - ...set.foo -}; diff --git a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/shorthand-method-args.src.js b/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/shorthand-method-args.src.js deleted file mode 100644 index 4247e4a5494d..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/shorthand-method-args.src.js +++ /dev/null @@ -1,5 +0,0 @@ -({ - initialize({someVar, otherVar, ...options}) { - // ... do some stuff with options ... - } -}); diff --git a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/shorthand-methods.src.js b/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/shorthand-methods.src.js deleted file mode 100644 index 2eb0d18f575b..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/shorthand-methods.src.js +++ /dev/null @@ -1,5 +0,0 @@ -var x = { - initialize({someVar, otherVar, ...options}) { - // ... do some stuff with options ... - } -}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/shorthand-properties.src.js b/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/shorthand-properties.src.js deleted file mode 100644 index 11d8c39bfa8b..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/shorthand-properties.src.js +++ /dev/null @@ -1,9 +0,0 @@ -var foo, - get, - set; - -var x = { - foo, - get, - ...set -}; diff --git a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/single-spread.src.js b/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/single-spread.src.js deleted file mode 100644 index e287012c47b9..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/single-spread.src.js +++ /dev/null @@ -1,9 +0,0 @@ -var foo, - get, - set; - -var x = { - foo: foo, - get: get, - ...set -}; diff --git a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/spread-trailing-comma.src.js b/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/spread-trailing-comma.src.js deleted file mode 100644 index a2841df60224..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/spread-trailing-comma.src.js +++ /dev/null @@ -1 +0,0 @@ -({ a, b, ...c, }) diff --git a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/two-spread.src.js b/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/two-spread.src.js deleted file mode 100644 index 85d5f34a0076..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/experimentalObjectRestSpread/two-spread.src.js +++ /dev/null @@ -1,9 +0,0 @@ -var foo, - get, - set; - -var x = { - foo: foo, - ...get, - ...set -}; diff --git a/packages/shared-fixtures/fixtures/javascript/experimentalOptionalCatchBinding/optional-catch-binding-finally.src.js b/packages/shared-fixtures/fixtures/javascript/experimentalOptionalCatchBinding/optional-catch-binding-finally.src.js deleted file mode 100644 index 7ac791c528ec..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/experimentalOptionalCatchBinding/optional-catch-binding-finally.src.js +++ /dev/null @@ -1 +0,0 @@ -try {} catch {} finally {} diff --git a/packages/shared-fixtures/fixtures/javascript/experimentalOptionalCatchBinding/optional-catch-binding.src.js b/packages/shared-fixtures/fixtures/javascript/experimentalOptionalCatchBinding/optional-catch-binding.src.js deleted file mode 100644 index 0c6986fd88c6..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/experimentalOptionalCatchBinding/optional-catch-binding.src.js +++ /dev/null @@ -1 +0,0 @@ -try {} catch {} diff --git a/packages/shared-fixtures/fixtures/javascript/exponentiationOperators/exponential-operators.src.js b/packages/shared-fixtures/fixtures/javascript/exponentiationOperators/exponential-operators.src.js deleted file mode 100644 index b04a6f38a508..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/exponentiationOperators/exponential-operators.src.js +++ /dev/null @@ -1,2 +0,0 @@ -var x = 2 ** 3; -x **= 4; diff --git a/packages/shared-fixtures/fixtures/javascript/for/for-empty.src.js b/packages/shared-fixtures/fixtures/javascript/for/for-empty.src.js deleted file mode 100644 index 845fc90ae14e..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/for/for-empty.src.js +++ /dev/null @@ -1 +0,0 @@ -for (;;); diff --git a/packages/shared-fixtures/fixtures/javascript/for/for-loop.src.js b/packages/shared-fixtures/fixtures/javascript/for/for-loop.src.js deleted file mode 100644 index 4f97f6f71ae4..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/for/for-loop.src.js +++ /dev/null @@ -1 +0,0 @@ -for(var i = 0; i < 10; i++) {} diff --git a/packages/shared-fixtures/fixtures/javascript/for/for-with-coma.src.js b/packages/shared-fixtures/fixtures/javascript/for/for-with-coma.src.js deleted file mode 100644 index 25e3805b7422..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/for/for-with-coma.src.js +++ /dev/null @@ -1,4 +0,0 @@ -for (var i = 0, j = 10; i < j; i++, j--) -{ -} - diff --git a/packages/shared-fixtures/fixtures/javascript/for/for-with-const.src.js b/packages/shared-fixtures/fixtures/javascript/for/for-with-const.src.js deleted file mode 100644 index ef32a71deec6..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/for/for-with-const.src.js +++ /dev/null @@ -1,3 +0,0 @@ -for (const i = 0; i < j;) -{ -} diff --git a/packages/shared-fixtures/fixtures/javascript/for/for-with-function.src.js b/packages/shared-fixtures/fixtures/javascript/for/for-with-function.src.js deleted file mode 100644 index 7734dbae9e7e..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/for/for-with-function.src.js +++ /dev/null @@ -1 +0,0 @@ -for (x = 5; x = x.toExponential(); x = 5); diff --git a/packages/shared-fixtures/fixtures/javascript/for/for-with-let.src.js b/packages/shared-fixtures/fixtures/javascript/for/for-with-let.src.js deleted file mode 100644 index ef32a71deec6..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/for/for-with-let.src.js +++ /dev/null @@ -1,3 +0,0 @@ -for (const i = 0; i < j;) -{ -} diff --git a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-array.src.js b/packages/shared-fixtures/fixtures/javascript/forIn/for-in-array.src.js deleted file mode 100644 index a756590b577d..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-array.src.js +++ /dev/null @@ -1 +0,0 @@ -for (i in []) {} diff --git a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-bare-nonstrict.src.js b/packages/shared-fixtures/fixtures/javascript/forIn/for-in-bare-nonstrict.src.js deleted file mode 100644 index 6780cbbf0ffa..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-bare-nonstrict.src.js +++ /dev/null @@ -1,6 +0,0 @@ -var effects = 0; -var iterations = 0; -var stored; -for (var a = (++effects, -1) in stored = a, {a: 0, b: 1, c: 2}) { - ++iterations; -} diff --git a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-destruction-object.src.js b/packages/shared-fixtures/fixtures/javascript/forIn/for-in-destruction-object.src.js deleted file mode 100644 index 44c69389230a..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-destruction-object.src.js +++ /dev/null @@ -1 +0,0 @@ -for (var {name, value} in obj) {} diff --git a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-destruction.src.js b/packages/shared-fixtures/fixtures/javascript/forIn/for-in-destruction.src.js deleted file mode 100644 index 0e07e5c9bf3b..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-destruction.src.js +++ /dev/null @@ -1 +0,0 @@ -for (var [name, value] in obj) {} diff --git a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-object-with-body.src.js b/packages/shared-fixtures/fixtures/javascript/forIn/for-in-object-with-body.src.js deleted file mode 100644 index ed66d4e2c308..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-object-with-body.src.js +++ /dev/null @@ -1 +0,0 @@ -for (i in {}) {} diff --git a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-object.src.js b/packages/shared-fixtures/fixtures/javascript/forIn/for-in-object.src.js deleted file mode 100644 index 8a28bcd011a2..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-object.src.js +++ /dev/null @@ -1 +0,0 @@ -for ((i in {})); diff --git a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-assigment.src.js b/packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-assigment.src.js deleted file mode 100644 index 672072d7ded2..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-assigment.src.js +++ /dev/null @@ -1 +0,0 @@ -for (let x = 42 in list) process(x); diff --git a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-bare-assigment.src.js b/packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-bare-assigment.src.js deleted file mode 100644 index cd2e1aa45931..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-bare-assigment.src.js +++ /dev/null @@ -1 +0,0 @@ -for (x = 0 in arr); diff --git a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-const.src.js b/packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-const.src.js deleted file mode 100644 index 48da176a2b76..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-const.src.js +++ /dev/null @@ -1 +0,0 @@ -for (const x in list) process(x); diff --git a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-milti-asigment.src.js b/packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-milti-asigment.src.js deleted file mode 100644 index 01e8d6930a68..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-milti-asigment.src.js +++ /dev/null @@ -1 +0,0 @@ -for (var x = y = z in q); diff --git a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-rest.src.js b/packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-rest.src.js deleted file mode 100644 index cef90adfddb1..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-rest.src.js +++ /dev/null @@ -1,2 +0,0 @@ -for ({ x: xx, ...rrestOff } in array) { -} diff --git a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-var.src.js b/packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-var.src.js deleted file mode 100644 index f3649e96e120..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/forIn/for-in-with-var.src.js +++ /dev/null @@ -1 +0,0 @@ -for (var x in list) process(x); diff --git a/packages/shared-fixtures/fixtures/javascript/forOf/for-of-array.src.js b/packages/shared-fixtures/fixtures/javascript/forOf/for-of-array.src.js deleted file mode 100644 index e91a157cfa66..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/forOf/for-of-array.src.js +++ /dev/null @@ -1,2 +0,0 @@ -for (let x of []) - doSomething(); diff --git a/packages/shared-fixtures/fixtures/javascript/forOf/for-of-destruction-object.src.js b/packages/shared-fixtures/fixtures/javascript/forOf/for-of-destruction-object.src.js deleted file mode 100644 index 3a2fd431654c..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/forOf/for-of-destruction-object.src.js +++ /dev/null @@ -1 +0,0 @@ -for (var {name, value} of obj) {} diff --git a/packages/shared-fixtures/fixtures/javascript/forOf/for-of-destruction.src.js b/packages/shared-fixtures/fixtures/javascript/forOf/for-of-destruction.src.js deleted file mode 100644 index d39ffd3276bc..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/forOf/for-of-destruction.src.js +++ /dev/null @@ -1 +0,0 @@ -for (var [name, value] of obj) {} diff --git a/packages/shared-fixtures/fixtures/javascript/forOf/for-of-object.src.js b/packages/shared-fixtures/fixtures/javascript/forOf/for-of-object.src.js deleted file mode 100644 index ad1fe32a80b7..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/forOf/for-of-object.src.js +++ /dev/null @@ -1,2 +0,0 @@ -for (let x of {}) - doSomething(); diff --git a/packages/shared-fixtures/fixtures/javascript/forOf/for-of-with-function-initializer.src.js b/packages/shared-fixtures/fixtures/javascript/forOf/for-of-with-function-initializer.src.js deleted file mode 100644 index be6ee7a07961..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/forOf/for-of-with-function-initializer.src.js +++ /dev/null @@ -1 +0,0 @@ -for (var i = function() { return 10 in [] } of list) process(x); diff --git a/packages/shared-fixtures/fixtures/javascript/forOf/for-of-with-rest.src.js b/packages/shared-fixtures/fixtures/javascript/forOf/for-of-with-rest.src.js deleted file mode 100644 index 157c7985bb08..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/forOf/for-of-with-rest.src.js +++ /dev/null @@ -1,2 +0,0 @@ -for ({ x: xx, ...rrestOff } of array) { -} diff --git a/packages/shared-fixtures/fixtures/javascript/forOf/for-of-with-var-and-braces.src.js b/packages/shared-fixtures/fixtures/javascript/forOf/for-of-with-var-and-braces.src.js deleted file mode 100644 index 090dccf02df6..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/forOf/for-of-with-var-and-braces.src.js +++ /dev/null @@ -1,3 +0,0 @@ -for (var x of foo) { - doSomething(); -} diff --git a/packages/shared-fixtures/fixtures/javascript/forOf/for-of-with-var-and-no-braces.src.js b/packages/shared-fixtures/fixtures/javascript/forOf/for-of-with-var-and-no-braces.src.js deleted file mode 100644 index 3e0f665bcb3f..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/forOf/for-of-with-var-and-no-braces.src.js +++ /dev/null @@ -1,2 +0,0 @@ -for (var x of foo) - doSomething(); diff --git a/packages/shared-fixtures/fixtures/javascript/forOf/invalid-for-of-with-const-and-no-braces.src.js b/packages/shared-fixtures/fixtures/javascript/forOf/invalid-for-of-with-const-and-no-braces.src.js deleted file mode 100644 index 409abfa0c48b..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/forOf/invalid-for-of-with-const-and-no-braces.src.js +++ /dev/null @@ -1,2 +0,0 @@ -for (const x of foo) - doSomething(); diff --git a/packages/shared-fixtures/fixtures/javascript/forOf/invalid-for-of-with-let-and-no-braces.src.js b/packages/shared-fixtures/fixtures/javascript/forOf/invalid-for-of-with-let-and-no-braces.src.js deleted file mode 100644 index 7d9d367e23a0..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/forOf/invalid-for-of-with-let-and-no-braces.src.js +++ /dev/null @@ -1,2 +0,0 @@ -for (let x of foo) - doSomething(); diff --git a/packages/shared-fixtures/fixtures/javascript/function/function-with-return.js b/packages/shared-fixtures/fixtures/javascript/function/function-with-return.js deleted file mode 100644 index c98a373f0c38..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/function/function-with-return.js +++ /dev/null @@ -1,3 +0,0 @@ -function foo () { - return 1; -} diff --git a/packages/shared-fixtures/fixtures/javascript/function/return-multiline-sequence.src.js b/packages/shared-fixtures/fixtures/javascript/function/return-multiline-sequence.src.js deleted file mode 100644 index be3070488139..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/function/return-multiline-sequence.src.js +++ /dev/null @@ -1,7 +0,0 @@ -function foo (x, y, z) { - return ( - x, - y, - z - ); -} diff --git a/packages/shared-fixtures/fixtures/javascript/function/return-sequence.src.js b/packages/shared-fixtures/fixtures/javascript/function/return-sequence.src.js deleted file mode 100644 index 3ffe77903028..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/function/return-sequence.src.js +++ /dev/null @@ -1,3 +0,0 @@ -function foo (x, y, z) { - return (x, y, z); -} diff --git a/packages/shared-fixtures/fixtures/javascript/generators/anonymous-generator.src.js b/packages/shared-fixtures/fixtures/javascript/generators/anonymous-generator.src.js deleted file mode 100644 index e582946f6565..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/generators/anonymous-generator.src.js +++ /dev/null @@ -1 +0,0 @@ -(function* () { yield v }); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/generators/async-generator-function.src.js b/packages/shared-fixtures/fixtures/javascript/generators/async-generator-function.src.js deleted file mode 100644 index 59fbab7761a6..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/generators/async-generator-function.src.js +++ /dev/null @@ -1,4 +0,0 @@ - -async function *foo() { - -} diff --git a/packages/shared-fixtures/fixtures/javascript/generators/async-generator-method.src.js b/packages/shared-fixtures/fixtures/javascript/generators/async-generator-method.src.js deleted file mode 100644 index 475794bf0c0b..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/generators/async-generator-method.src.js +++ /dev/null @@ -1,5 +0,0 @@ -class C { - async * f() { - const x = yield* g(); - } -} diff --git a/packages/shared-fixtures/fixtures/javascript/generators/double-yield.src.js b/packages/shared-fixtures/fixtures/javascript/generators/double-yield.src.js deleted file mode 100644 index e026a3373e9f..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/generators/double-yield.src.js +++ /dev/null @@ -1 +0,0 @@ -(function* () { yield yield 10 }); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/generators/empty-generator-declaration.src.js b/packages/shared-fixtures/fixtures/javascript/generators/empty-generator-declaration.src.js deleted file mode 100644 index 669935546a20..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/generators/empty-generator-declaration.src.js +++ /dev/null @@ -1 +0,0 @@ -function* t() {}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/generators/generator-declaration.src.js b/packages/shared-fixtures/fixtures/javascript/generators/generator-declaration.src.js deleted file mode 100644 index 3690a57479ab..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/generators/generator-declaration.src.js +++ /dev/null @@ -1 +0,0 @@ -function* test () { yield *v }; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/generators/yield-delegation.src.js b/packages/shared-fixtures/fixtures/javascript/generators/yield-delegation.src.js deleted file mode 100644 index fc14d64df717..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/generators/yield-delegation.src.js +++ /dev/null @@ -1 +0,0 @@ -(function* () { yield *v }); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/generators/yield-without-value-in-call.src.js b/packages/shared-fixtures/fixtures/javascript/generators/yield-without-value-in-call.src.js deleted file mode 100644 index d30055ca0870..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/generators/yield-without-value-in-call.src.js +++ /dev/null @@ -1 +0,0 @@ -(function* () { fn(yield); }); diff --git a/packages/shared-fixtures/fixtures/javascript/generators/yield-without-value-no-semi.src.js b/packages/shared-fixtures/fixtures/javascript/generators/yield-without-value-no-semi.src.js deleted file mode 100644 index 5fc869289ee9..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/generators/yield-without-value-no-semi.src.js +++ /dev/null @@ -1 +0,0 @@ -(function* () { yield }); diff --git a/packages/shared-fixtures/fixtures/javascript/generators/yield-without-value.src.js b/packages/shared-fixtures/fixtures/javascript/generators/yield-without-value.src.js deleted file mode 100644 index 75c83be2ff92..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/generators/yield-without-value.src.js +++ /dev/null @@ -1 +0,0 @@ -(function* () { yield; }); diff --git a/packages/shared-fixtures/fixtures/javascript/globalReturn/return-identifier.src.js b/packages/shared-fixtures/fixtures/javascript/globalReturn/return-identifier.src.js deleted file mode 100644 index aa6758b0cd89..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/globalReturn/return-identifier.src.js +++ /dev/null @@ -1 +0,0 @@ -return fooz; diff --git a/packages/shared-fixtures/fixtures/javascript/globalReturn/return-no-arg.src.js b/packages/shared-fixtures/fixtures/javascript/globalReturn/return-no-arg.src.js deleted file mode 100644 index f312410bd34c..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/globalReturn/return-no-arg.src.js +++ /dev/null @@ -1 +0,0 @@ -return; diff --git a/packages/shared-fixtures/fixtures/javascript/globalReturn/return-true.src.js b/packages/shared-fixtures/fixtures/javascript/globalReturn/return-true.src.js deleted file mode 100644 index c1c6922d1dfe..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/globalReturn/return-true.src.js +++ /dev/null @@ -1 +0,0 @@ -return true; diff --git a/packages/shared-fixtures/fixtures/javascript/hexLiterals/invalid.src.js b/packages/shared-fixtures/fixtures/javascript/hexLiterals/invalid.src.js deleted file mode 100644 index 52cc359c1b9e..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/hexLiterals/invalid.src.js +++ /dev/null @@ -1 +0,0 @@ -0x12z; diff --git a/packages/shared-fixtures/fixtures/javascript/hexLiterals/lowercase.src.js b/packages/shared-fixtures/fixtures/javascript/hexLiterals/lowercase.src.js deleted file mode 100644 index ebb8a6d300ae..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/hexLiterals/lowercase.src.js +++ /dev/null @@ -1 +0,0 @@ -0x2343; diff --git a/packages/shared-fixtures/fixtures/javascript/hexLiterals/uppercase.src.js b/packages/shared-fixtures/fixtures/javascript/hexLiterals/uppercase.src.js deleted file mode 100644 index 4cd84c3772d9..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/hexLiterals/uppercase.src.js +++ /dev/null @@ -1 +0,0 @@ -0X2343; diff --git a/packages/shared-fixtures/fixtures/javascript/importMeta/simple-import-meta.src.js b/packages/shared-fixtures/fixtures/javascript/importMeta/simple-import-meta.src.js deleted file mode 100644 index bd14f9431ae7..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/importMeta/simple-import-meta.src.js +++ /dev/null @@ -1 +0,0 @@ -import.meta.url; diff --git a/packages/shared-fixtures/fixtures/javascript/labels/label-break.src.js b/packages/shared-fixtures/fixtures/javascript/labels/label-break.src.js deleted file mode 100644 index fc6d422d3bf0..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/labels/label-break.src.js +++ /dev/null @@ -1,5 +0,0 @@ -loop1: - while(true) { - break loop1; - break; - } diff --git a/packages/shared-fixtures/fixtures/javascript/labels/label-continue.src.js b/packages/shared-fixtures/fixtures/javascript/labels/label-continue.src.js deleted file mode 100644 index 4243acedd983..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/labels/label-continue.src.js +++ /dev/null @@ -1,5 +0,0 @@ -loop1: - while(true) { - continue loop1; - continue; - } diff --git a/packages/shared-fixtures/fixtures/javascript/modules/error-delete.src.js b/packages/shared-fixtures/fixtures/javascript/modules/error-delete.src.js deleted file mode 100644 index eb6dc52a826d..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/error-delete.src.js +++ /dev/null @@ -1,2 +0,0 @@ -import x from "x"; -delete x; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/error-function.src.js b/packages/shared-fixtures/fixtures/javascript/modules/error-function.src.js deleted file mode 100644 index cdc0cd394494..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/error-function.src.js +++ /dev/null @@ -1,4 +0,0 @@ -function x() { - export default friends; -} - diff --git a/packages/shared-fixtures/fixtures/javascript/modules/error-strict.src.js b/packages/shared-fixtures/fixtures/javascript/modules/error-strict.src.js deleted file mode 100644 index a17a321127ac..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/error-strict.src.js +++ /dev/null @@ -1,5 +0,0 @@ -import house from "house"; - -with (house) { - console.log(roof); -} diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-async-named-function.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-async-named-function.src.js deleted file mode 100644 index 7c26b9ed6873..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-async-named-function.src.js +++ /dev/null @@ -1 +0,0 @@ -export async function foo() {} diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-const.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-const.src.js deleted file mode 100644 index cc57a55e257d..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-const.src.js +++ /dev/null @@ -1 +0,0 @@ -export const foo = 2; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-default-array.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-default-array.src.js deleted file mode 100644 index d6d1738de67e..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-default-array.src.js +++ /dev/null @@ -1 +0,0 @@ -export default []; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-default-async-named-function.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-default-async-named-function.src.js deleted file mode 100644 index c40a5f27d267..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-default-async-named-function.src.js +++ /dev/null @@ -1 +0,0 @@ -export default async function foo() {} diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-default-class.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-default-class.src.js deleted file mode 100644 index 3509c96a752f..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-default-class.src.js +++ /dev/null @@ -1,3 +0,0 @@ -export default class { - -} diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-default-expression.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-default-expression.src.js deleted file mode 100644 index f30c184a1ae0..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-default-expression.src.js +++ /dev/null @@ -1 +0,0 @@ -export default (1 + 2); diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-default-function.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-default-function.src.js deleted file mode 100644 index ea9b101e1c22..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-default-function.src.js +++ /dev/null @@ -1 +0,0 @@ -export default function () {} diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-default-named-class.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-default-named-class.src.js deleted file mode 100644 index b2ded7d41d9d..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-default-named-class.src.js +++ /dev/null @@ -1,3 +0,0 @@ -export default class Test { - -} diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-default-named-function.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-default-named-function.src.js deleted file mode 100644 index 386baca17315..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-default-named-function.src.js +++ /dev/null @@ -1 +0,0 @@ -export default function foo() {} diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-default-number.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-default-number.src.js deleted file mode 100644 index 7a4e8a723a40..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-default-number.src.js +++ /dev/null @@ -1 +0,0 @@ -export default 42; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-default-object.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-default-object.src.js deleted file mode 100644 index f8266ca25f5d..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-default-object.src.js +++ /dev/null @@ -1 +0,0 @@ -export default { foo: 1 }; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-default-value.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-default-value.src.js deleted file mode 100644 index f7b318b3f637..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-default-value.src.js +++ /dev/null @@ -1 +0,0 @@ -export default foo; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-from-batch.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-from-batch.src.js deleted file mode 100644 index 9ec8f63ab2fd..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-from-batch.src.js +++ /dev/null @@ -1 +0,0 @@ -export * from "foo"; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-from-default.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-from-default.src.js deleted file mode 100644 index 2c7930d925cb..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-from-default.src.js +++ /dev/null @@ -1 +0,0 @@ -export {default} from "foo"; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-from-named-as-default.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-from-named-as-default.src.js deleted file mode 100644 index 5be9a685aabd..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-from-named-as-default.src.js +++ /dev/null @@ -1 +0,0 @@ -export {foo as default} from "foo"; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-from-named-as-specifier.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-from-named-as-specifier.src.js deleted file mode 100644 index 9fff903bd969..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-from-named-as-specifier.src.js +++ /dev/null @@ -1 +0,0 @@ -export {foo as bar} from "foo"; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-from-named-as-specifiers.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-from-named-as-specifiers.src.js deleted file mode 100644 index 4461d79e3bf3..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-from-named-as-specifiers.src.js +++ /dev/null @@ -1 +0,0 @@ -export {foo as default, bar} from "foo"; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-from-specifier.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-from-specifier.src.js deleted file mode 100644 index 83b7b67c51ce..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-from-specifier.src.js +++ /dev/null @@ -1 +0,0 @@ -export {foo} from "foo"; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-from-specifiers.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-from-specifiers.src.js deleted file mode 100644 index 35c2762a2954..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-from-specifiers.src.js +++ /dev/null @@ -1 +0,0 @@ -export {foo, bar} from "foo"; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-function.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-function.src.js deleted file mode 100644 index 768586d72c59..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-function.src.js +++ /dev/null @@ -1 +0,0 @@ -export function foo () {} diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-let.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-let.src.js deleted file mode 100644 index a3bcdb0d8122..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-let.src.js +++ /dev/null @@ -1 +0,0 @@ -export let foo = 2; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-named-as-default.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-named-as-default.src.js deleted file mode 100644 index 5d32a24de0a9..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-named-as-default.src.js +++ /dev/null @@ -1 +0,0 @@ -export {foo as default}; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-named-as-specifier.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-named-as-specifier.src.js deleted file mode 100644 index e7820a6f027c..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-named-as-specifier.src.js +++ /dev/null @@ -1 +0,0 @@ -export {foo as bar}; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-named-as-specifiers.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-named-as-specifiers.src.js deleted file mode 100644 index ff57927839e8..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-named-as-specifiers.src.js +++ /dev/null @@ -1 +0,0 @@ -export {foo as default, bar}; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-named-class.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-named-class.src.js deleted file mode 100644 index 3cb35e97ee95..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-named-class.src.js +++ /dev/null @@ -1,3 +0,0 @@ -export class Test { - -} diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-named-empty.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-named-empty.src.js deleted file mode 100644 index cb0ff5c3b541..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-named-empty.src.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-named-specifier.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-named-specifier.src.js deleted file mode 100644 index df5f5e609e93..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-named-specifier.src.js +++ /dev/null @@ -1 +0,0 @@ -export {foo}; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-named-specifiers-comma.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-named-specifiers-comma.src.js deleted file mode 100644 index 61bc40fd77ea..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-named-specifiers-comma.src.js +++ /dev/null @@ -1 +0,0 @@ -export {foo, bar,}; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-named-specifiers.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-named-specifiers.src.js deleted file mode 100644 index fdbc94275097..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-named-specifiers.src.js +++ /dev/null @@ -1 +0,0 @@ -export {foo, bar}; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-var-anonymous-function.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-var-anonymous-function.src.js deleted file mode 100644 index f8af28821237..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-var-anonymous-function.src.js +++ /dev/null @@ -1 +0,0 @@ -export var foo = function () {}; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-var-number.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-var-number.src.js deleted file mode 100644 index e2e71aa4fc6d..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-var-number.src.js +++ /dev/null @@ -1 +0,0 @@ -export var foo = 1; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/export-var.src.js b/packages/shared-fixtures/fixtures/javascript/modules/export-var.src.js deleted file mode 100644 index 62da3e60183c..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/export-var.src.js +++ /dev/null @@ -1 +0,0 @@ -export var bar; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/import-default-and-named-specifiers.src.js b/packages/shared-fixtures/fixtures/javascript/modules/import-default-and-named-specifiers.src.js deleted file mode 100644 index e544977b3acf..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/import-default-and-named-specifiers.src.js +++ /dev/null @@ -1 +0,0 @@ -import foo, {bar} from "foo"; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/import-default-and-namespace-specifiers.src.js b/packages/shared-fixtures/fixtures/javascript/modules/import-default-and-namespace-specifiers.src.js deleted file mode 100644 index 084fa0cdd14a..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/import-default-and-namespace-specifiers.src.js +++ /dev/null @@ -1 +0,0 @@ -import foo, * as bar from "foo"; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/import-default-as.src.js b/packages/shared-fixtures/fixtures/javascript/modules/import-default-as.src.js deleted file mode 100644 index 96c936db1040..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/import-default-as.src.js +++ /dev/null @@ -1 +0,0 @@ -import {default as foo} from "foo"; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/import-default.src.js b/packages/shared-fixtures/fixtures/javascript/modules/import-default.src.js deleted file mode 100644 index 8d1420050a85..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/import-default.src.js +++ /dev/null @@ -1 +0,0 @@ -import foo from "foo"; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/import-jquery.src.js b/packages/shared-fixtures/fixtures/javascript/modules/import-jquery.src.js deleted file mode 100644 index ea74241b4bab..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/import-jquery.src.js +++ /dev/null @@ -1 +0,0 @@ -import $ from "jquery" diff --git a/packages/shared-fixtures/fixtures/javascript/modules/import-module.src.js b/packages/shared-fixtures/fixtures/javascript/modules/import-module.src.js deleted file mode 100644 index c0748305d535..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/import-module.src.js +++ /dev/null @@ -1 +0,0 @@ -import "foo"; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/import-named-as-specifier.src.js b/packages/shared-fixtures/fixtures/javascript/modules/import-named-as-specifier.src.js deleted file mode 100644 index 769f3b3d0cb2..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/import-named-as-specifier.src.js +++ /dev/null @@ -1 +0,0 @@ -import {bar as baz} from "foo"; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/import-named-as-specifiers.src.js b/packages/shared-fixtures/fixtures/javascript/modules/import-named-as-specifiers.src.js deleted file mode 100644 index 5198ead3cde7..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/import-named-as-specifiers.src.js +++ /dev/null @@ -1 +0,0 @@ -import {bar as baz, xyz} from "foo"; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/import-named-empty.src.js b/packages/shared-fixtures/fixtures/javascript/modules/import-named-empty.src.js deleted file mode 100644 index 5faab37ebb44..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/import-named-empty.src.js +++ /dev/null @@ -1 +0,0 @@ -import {} from "foo"; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/import-named-specifier.src.js b/packages/shared-fixtures/fixtures/javascript/modules/import-named-specifier.src.js deleted file mode 100644 index fc80c74dd71d..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/import-named-specifier.src.js +++ /dev/null @@ -1 +0,0 @@ -import {bar} from "foo"; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/import-named-specifiers-comma.src.js b/packages/shared-fixtures/fixtures/javascript/modules/import-named-specifiers-comma.src.js deleted file mode 100644 index c2e95853d61f..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/import-named-specifiers-comma.src.js +++ /dev/null @@ -1 +0,0 @@ -import {bar, baz,} from "foo"; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/import-named-specifiers.src.js b/packages/shared-fixtures/fixtures/javascript/modules/import-named-specifiers.src.js deleted file mode 100644 index 2fb83c2349cc..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/import-named-specifiers.src.js +++ /dev/null @@ -1 +0,0 @@ -import {bar, baz} from "foo"; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/import-namespace-specifier.src.js b/packages/shared-fixtures/fixtures/javascript/modules/import-namespace-specifier.src.js deleted file mode 100644 index e55c0775003b..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/import-namespace-specifier.src.js +++ /dev/null @@ -1 +0,0 @@ -import * as foo from "foo"; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/import-null-as-nil.src.js b/packages/shared-fixtures/fixtures/javascript/modules/import-null-as-nil.src.js deleted file mode 100644 index ced8a86bb836..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/import-null-as-nil.src.js +++ /dev/null @@ -1 +0,0 @@ -import { null as nil } from "bar" diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-await.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-await.src.js deleted file mode 100644 index 91cd4f3b2b1f..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-await.src.js +++ /dev/null @@ -1 +0,0 @@ -export var await; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-class.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-class.src.js deleted file mode 100644 index a6e68e983892..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-class.src.js +++ /dev/null @@ -1 +0,0 @@ -export default class {} diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-batch-missing-from-clause.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-batch-missing-from-clause.src.js deleted file mode 100644 index 3f576881e6c5..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-batch-missing-from-clause.src.js +++ /dev/null @@ -1 +0,0 @@ -export * diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-batch-token.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-batch-token.src.js deleted file mode 100644 index 32cb28ea92ba..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-batch-token.src.js +++ /dev/null @@ -1 +0,0 @@ -export * + diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-default-equal.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-default-equal.src.js deleted file mode 100644 index 0dfb038eb536..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-default-equal.src.js +++ /dev/null @@ -1 +0,0 @@ -export default = 42 diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-default-token.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-default-token.src.js deleted file mode 100644 index a0af03d2e65f..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-default-token.src.js +++ /dev/null @@ -1 +0,0 @@ -export {default} + diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-default.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-default.src.js deleted file mode 100644 index 8dfa0a19a948..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-default.src.js +++ /dev/null @@ -1 +0,0 @@ -export default from "foo" diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-module-specifier.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-module-specifier.src.js deleted file mode 100644 index 29faf851822c..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-module-specifier.src.js +++ /dev/null @@ -1 +0,0 @@ -export { foo } from bar; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-named-default.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-named-default.src.js deleted file mode 100644 index 8f3cde5c9618..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-named-default.src.js +++ /dev/null @@ -1 +0,0 @@ -export {default} diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-named-extra-comma.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-named-extra-comma.src.js deleted file mode 100644 index 40bb7fe8ade6..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-named-extra-comma.src.js +++ /dev/null @@ -1 +0,0 @@ -export {foo,baz,,} diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-named-middle-comma.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-named-middle-comma.src.js deleted file mode 100644 index ff3424cc6027..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-export-named-middle-comma.src.js +++ /dev/null @@ -1 +0,0 @@ -export {foo,,baz} diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-default-after-named-after-default.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-default-after-named-after-default.src.js deleted file mode 100644 index 69aac7e8e153..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-default-after-named-after-default.src.js +++ /dev/null @@ -1 +0,0 @@ -import foo, {bar}, foo from "foo"; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-default-after-named.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-default-after-named.src.js deleted file mode 100644 index 5be12dab64a6..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-default-after-named.src.js +++ /dev/null @@ -1 +0,0 @@ -import {bar}, foo from "foo" diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-default-missing-module-specifier.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-default-missing-module-specifier.src.js deleted file mode 100644 index ddf557475a4a..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-default-missing-module-specifier.src.js +++ /dev/null @@ -1 +0,0 @@ -import foo diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-default-module-specifier.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-default-module-specifier.src.js deleted file mode 100644 index 16e3ea289785..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-default-module-specifier.src.js +++ /dev/null @@ -1 +0,0 @@ -import foo from bar; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-default.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-default.src.js deleted file mode 100644 index 6399a1a6620d..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-default.src.js +++ /dev/null @@ -1 +0,0 @@ -import default from "foo" diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-missing-module-specifier.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-missing-module-specifier.src.js deleted file mode 100644 index 338ebc128b7e..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-missing-module-specifier.src.js +++ /dev/null @@ -1 +0,0 @@ -import { foo, bar } diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-module-specifier.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-module-specifier.src.js deleted file mode 100644 index 15dda167c6bd..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-module-specifier.src.js +++ /dev/null @@ -1 +0,0 @@ -export {foo} from bar diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-named-after-named.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-named-after-named.src.js deleted file mode 100644 index a0557bf0ea54..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-named-after-named.src.js +++ /dev/null @@ -1 +0,0 @@ -import {bar}, {foo} from "foo"; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-named-after-namespace.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-named-after-namespace.src.js deleted file mode 100644 index 24cede9de625..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-named-after-namespace.src.js +++ /dev/null @@ -1 +0,0 @@ -import * as foo, {bar} from "foo"; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-named-as-missing-from.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-named-as-missing-from.src.js deleted file mode 100644 index 5d7daedfbd96..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-named-as-missing-from.src.js +++ /dev/null @@ -1 +0,0 @@ -import {default as foo} diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-named-extra-comma.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-named-extra-comma.src.js deleted file mode 100644 index fd0b19b89bd5..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-named-extra-comma.src.js +++ /dev/null @@ -1 +0,0 @@ -import {foo,baz,,} from 'toast'; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-named-middle-comma.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-named-middle-comma.src.js deleted file mode 100644 index 467552325fd2..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-named-middle-comma.src.js +++ /dev/null @@ -1 +0,0 @@ -import {foo,,baz} from 'toast'; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-namespace-after-named.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-namespace-after-named.src.js deleted file mode 100644 index 09d0d344e633..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-namespace-after-named.src.js +++ /dev/null @@ -1 +0,0 @@ -import {bar}, * as foo from "foo"; diff --git a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-namespace-missing-as.src.js b/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-namespace-missing-as.src.js deleted file mode 100644 index 4382a94adbfb..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/modules/invalid-import-namespace-missing-as.src.js +++ /dev/null @@ -1 +0,0 @@ -import * from "foo" diff --git a/packages/shared-fixtures/fixtures/javascript/newTarget/invalid-new-target.src.js b/packages/shared-fixtures/fixtures/javascript/newTarget/invalid-new-target.src.js deleted file mode 100644 index 46b13d0e56be..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/newTarget/invalid-new-target.src.js +++ /dev/null @@ -1 +0,0 @@ -var x = new.target; diff --git a/packages/shared-fixtures/fixtures/javascript/newTarget/invalid-unknown-property.src.js b/packages/shared-fixtures/fixtures/javascript/newTarget/invalid-unknown-property.src.js deleted file mode 100644 index dc1b123d55d7..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/newTarget/invalid-unknown-property.src.js +++ /dev/null @@ -1 +0,0 @@ -var f = function() { new.unknown_property; } diff --git a/packages/shared-fixtures/fixtures/javascript/newTarget/simple-new-target.src.js b/packages/shared-fixtures/fixtures/javascript/newTarget/simple-new-target.src.js deleted file mode 100644 index 44b77c7aacb6..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/newTarget/simple-new-target.src.js +++ /dev/null @@ -1,3 +0,0 @@ -function f() { - var x = new.target; -} diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteral/object-literal-in-lhs.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteral/object-literal-in-lhs.src.js deleted file mode 100644 index a55f0f860c71..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteral/object-literal-in-lhs.src.js +++ /dev/null @@ -1 +0,0 @@ -fn({}).x = obj; diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/computed-addition-property.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/computed-addition-property.src.js deleted file mode 100644 index 9c3cf5a43a0a..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/computed-addition-property.src.js +++ /dev/null @@ -1,3 +0,0 @@ -var x = { - [5 + 5]: foo -}; diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/computed-and-identifier.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/computed-and-identifier.src.js deleted file mode 100644 index cbc10a6adc96..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/computed-and-identifier.src.js +++ /dev/null @@ -1 +0,0 @@ -({[x]: 10, y: 20}); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/computed-getter-and-setter.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/computed-getter-and-setter.src.js deleted file mode 100644 index 8b7a70fd3a66..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/computed-getter-and-setter.src.js +++ /dev/null @@ -1 +0,0 @@ -({get [x]() {}, set [x](v) {}}); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/computed-string-property.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/computed-string-property.src.js deleted file mode 100644 index d555f8aaa3b9..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/computed-string-property.src.js +++ /dev/null @@ -1,3 +0,0 @@ -var x = { - ["hey"]: foo -}; diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/computed-variable-property.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/computed-variable-property.src.js deleted file mode 100644 index 7f41c2c10c4a..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/computed-variable-property.src.js +++ /dev/null @@ -1,3 +0,0 @@ -var x = { - [bar]: foo -}; diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/invalid-computed-variable-property.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/invalid-computed-variable-property.src.js deleted file mode 100644 index 77380e2ad357..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/invalid-computed-variable-property.src.js +++ /dev/null @@ -1,3 +0,0 @@ -var x = { - [bar] -}; diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src.js deleted file mode 100644 index 8925311d4766..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src.js +++ /dev/null @@ -1 +0,0 @@ -({[x]}); diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/standalone-expression-with-addition.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/standalone-expression-with-addition.src.js deleted file mode 100644 index 14e5e1dcb0b8..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/standalone-expression-with-addition.src.js +++ /dev/null @@ -1 +0,0 @@ -({["x" + "y"]: 10}); diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/standalone-expression-with-method.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/standalone-expression-with-method.src.js deleted file mode 100644 index eafa2481f503..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/standalone-expression-with-method.src.js +++ /dev/null @@ -1 +0,0 @@ -({[x]: function() {}}); diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/standalone-expression.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/standalone-expression.src.js deleted file mode 100644 index 0d7e62648fe2..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteralComputedProperties/standalone-expression.src.js +++ /dev/null @@ -1 +0,0 @@ -({[x]: 10}); diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteralDuplicateProperties/error-proto-property.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteralDuplicateProperties/error-proto-property.src.js deleted file mode 100644 index 5fc4a41be350..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteralDuplicateProperties/error-proto-property.src.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; - -var proto = {}; - -var x = { - __proto__: proto, - __proto__: proto -}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteralDuplicateProperties/error-proto-string-property.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteralDuplicateProperties/error-proto-string-property.src.js deleted file mode 100644 index 8761b73461ca..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteralDuplicateProperties/error-proto-string-property.src.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; - -var proto = {}; - -var x = { - "__proto__": proto, - "__proto__": proto -}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteralDuplicateProperties/strict-duplicate-properties.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteralDuplicateProperties/strict-duplicate-properties.src.js deleted file mode 100644 index 3942db82641a..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteralDuplicateProperties/strict-duplicate-properties.src.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; - -var x = { - y: 'first', - y: 'second' -}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src.js deleted file mode 100644 index 0f2b2710246e..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; - -var x = { - "y": "first", - "y": "second" -}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/invalid-method-no-braces.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/invalid-method-no-braces.src.js deleted file mode 100644 index 6fd56ea339eb..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/invalid-method-no-braces.src.js +++ /dev/null @@ -1,3 +0,0 @@ -x = { - method() 42 -};; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/method-property.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/method-property.src.js deleted file mode 100644 index 5c09849b2e79..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/method-property.src.js +++ /dev/null @@ -1,5 +0,0 @@ -var x = { - foo() { - return bar; - } -}; diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/simple-method-named-get.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/simple-method-named-get.src.js deleted file mode 100644 index b7f03cdef933..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/simple-method-named-get.src.js +++ /dev/null @@ -1,4 +0,0 @@ -x = { - get() { - } -};; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/simple-method-named-set.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/simple-method-named-set.src.js deleted file mode 100644 index 33ce0e95c298..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/simple-method-named-set.src.js +++ /dev/null @@ -1,4 +0,0 @@ -x = { - set() { - } -};; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/simple-method-with-argument.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/simple-method-with-argument.src.js deleted file mode 100644 index db824acd2671..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/simple-method-with-argument.src.js +++ /dev/null @@ -1,5 +0,0 @@ -x = { - method(test) { - - } -};; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/simple-method-with-string-name.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/simple-method-with-string-name.src.js deleted file mode 100644 index 345b88844421..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/simple-method-with-string-name.src.js +++ /dev/null @@ -1,4 +0,0 @@ -x = { - "method"() { - } -};; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/simple-method.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/simple-method.src.js deleted file mode 100644 index 0a69310519e1..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/simple-method.src.js +++ /dev/null @@ -1,4 +0,0 @@ -x = { - method() { - } -};; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/string-name-method-property.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/string-name-method-property.src.js deleted file mode 100644 index 0c168a31648e..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandMethods/string-name-method-property.src.js +++ /dev/null @@ -1,5 +0,0 @@ -var x = { - "foo"() { - return bar; - } -}; diff --git a/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandProperties/shorthand-properties.src.js b/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandProperties/shorthand-properties.src.js deleted file mode 100644 index 1b881004b3c1..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/objectLiteralShorthandProperties/shorthand-properties.src.js +++ /dev/null @@ -1,9 +0,0 @@ -var foo, - get, - set; - -var x = { - foo, - get, - set -}; diff --git a/packages/shared-fixtures/fixtures/javascript/octalLiterals/invalid.src.js b/packages/shared-fixtures/fixtures/javascript/octalLiterals/invalid.src.js deleted file mode 100644 index d0074ff52156..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/octalLiterals/invalid.src.js +++ /dev/null @@ -1 +0,0 @@ -0o12z; diff --git a/packages/shared-fixtures/fixtures/javascript/octalLiterals/legacy.src.js b/packages/shared-fixtures/fixtures/javascript/octalLiterals/legacy.src.js deleted file mode 100644 index 531316639580..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/octalLiterals/legacy.src.js +++ /dev/null @@ -1 +0,0 @@ -02343; diff --git a/packages/shared-fixtures/fixtures/javascript/octalLiterals/lowercase.src.js b/packages/shared-fixtures/fixtures/javascript/octalLiterals/lowercase.src.js deleted file mode 100644 index 7655a4ee496e..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/octalLiterals/lowercase.src.js +++ /dev/null @@ -1 +0,0 @@ -0o717; diff --git a/packages/shared-fixtures/fixtures/javascript/octalLiterals/strict-uppercase.src.js b/packages/shared-fixtures/fixtures/javascript/octalLiterals/strict-uppercase.src.js deleted file mode 100644 index 5bf66b1e2072..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/octalLiterals/strict-uppercase.src.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -0O717; diff --git a/packages/shared-fixtures/fixtures/javascript/octalLiterals/uppercase.src.js b/packages/shared-fixtures/fixtures/javascript/octalLiterals/uppercase.src.js deleted file mode 100644 index a5af9801c940..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/octalLiterals/uppercase.src.js +++ /dev/null @@ -1 +0,0 @@ -0O717; diff --git a/packages/shared-fixtures/fixtures/javascript/regex/regexp-simple.src.js b/packages/shared-fixtures/fixtures/javascript/regex/regexp-simple.src.js deleted file mode 100644 index 68f882c4ed36..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/regex/regexp-simple.src.js +++ /dev/null @@ -1 +0,0 @@ -var foo = /foo./; diff --git a/packages/shared-fixtures/fixtures/javascript/regexUFlag/regex-u-extended-escape.src.js b/packages/shared-fixtures/fixtures/javascript/regexUFlag/regex-u-extended-escape.src.js deleted file mode 100644 index 97c9442e5a4e..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/regexUFlag/regex-u-extended-escape.src.js +++ /dev/null @@ -1 +0,0 @@ -var x = /[\u{0000000000000061}-\u{7A}]/u; diff --git a/packages/shared-fixtures/fixtures/javascript/regexUFlag/regex-u-invalid-extended-escape.src.js b/packages/shared-fixtures/fixtures/javascript/regexUFlag/regex-u-invalid-extended-escape.src.js deleted file mode 100644 index 07db7a79d553..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/regexUFlag/regex-u-invalid-extended-escape.src.js +++ /dev/null @@ -1 +0,0 @@ -var x = /\u{110000}/u; diff --git a/packages/shared-fixtures/fixtures/javascript/regexUFlag/regex-u-simple.src.js b/packages/shared-fixtures/fixtures/javascript/regexUFlag/regex-u-simple.src.js deleted file mode 100644 index c31d75552b1e..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/regexUFlag/regex-u-simple.src.js +++ /dev/null @@ -1 +0,0 @@ -var foo = /foo/u; diff --git a/packages/shared-fixtures/fixtures/javascript/regexYFlag/regexp-y-simple.src.js b/packages/shared-fixtures/fixtures/javascript/regexYFlag/regexp-y-simple.src.js deleted file mode 100644 index ab3585070d91..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/regexYFlag/regexp-y-simple.src.js +++ /dev/null @@ -1 +0,0 @@ -var foo = /foo/y; diff --git a/packages/shared-fixtures/fixtures/javascript/restParams/basic-rest.src.js b/packages/shared-fixtures/fixtures/javascript/restParams/basic-rest.src.js deleted file mode 100644 index c7d2b9477c55..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/restParams/basic-rest.src.js +++ /dev/null @@ -1 +0,0 @@ -function f(a, ...b) {}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/restParams/class-constructor.src.js b/packages/shared-fixtures/fixtures/javascript/restParams/class-constructor.src.js deleted file mode 100644 index 03407bf25900..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/restParams/class-constructor.src.js +++ /dev/null @@ -1,4 +0,0 @@ -class A { - constructor(...foo) { - } -} diff --git a/packages/shared-fixtures/fixtures/javascript/restParams/class-method.src.js b/packages/shared-fixtures/fixtures/javascript/restParams/class-method.src.js deleted file mode 100644 index 48319379e161..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/restParams/class-method.src.js +++ /dev/null @@ -1,4 +0,0 @@ -class A { - foo(...bar) { - } -} diff --git a/packages/shared-fixtures/fixtures/javascript/restParams/error-no-default.src.js b/packages/shared-fixtures/fixtures/javascript/restParams/error-no-default.src.js deleted file mode 100644 index 6de42c245a52..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/restParams/error-no-default.src.js +++ /dev/null @@ -1 +0,0 @@ -function f(a, ...b = 0); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/restParams/error-not-last.src.js b/packages/shared-fixtures/fixtures/javascript/restParams/error-not-last.src.js deleted file mode 100644 index 309cc7573260..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/restParams/error-not-last.src.js +++ /dev/null @@ -1 +0,0 @@ -function f(a, ...b, c); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/restParams/func-expression-multi.src.js b/packages/shared-fixtures/fixtures/javascript/restParams/func-expression-multi.src.js deleted file mode 100644 index 68f41d812e6c..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/restParams/func-expression-multi.src.js +++ /dev/null @@ -1 +0,0 @@ -var x = function(a, ...b) {}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/restParams/func-expression.src.js b/packages/shared-fixtures/fixtures/javascript/restParams/func-expression.src.js deleted file mode 100644 index a7984c62a640..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/restParams/func-expression.src.js +++ /dev/null @@ -1 +0,0 @@ -var x = function (...a) {}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/restParams/invalid-rest-param.src.js b/packages/shared-fixtures/fixtures/javascript/restParams/invalid-rest-param.src.js deleted file mode 100644 index 49f73ed38546..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/restParams/invalid-rest-param.src.js +++ /dev/null @@ -1 +0,0 @@ -function x(...{ a }){}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/restParams/single-rest.src.js b/packages/shared-fixtures/fixtures/javascript/restParams/single-rest.src.js deleted file mode 100644 index 9c90dd499935..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/restParams/single-rest.src.js +++ /dev/null @@ -1 +0,0 @@ -function f(...b) {}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/simple-literals/literal-float-negative.src.js b/packages/shared-fixtures/fixtures/javascript/simple-literals/literal-float-negative.src.js deleted file mode 100644 index 32ebbd04dc40..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/simple-literals/literal-float-negative.src.js +++ /dev/null @@ -1 +0,0 @@ -const a = -1.5; diff --git a/packages/shared-fixtures/fixtures/javascript/simple-literals/literal-float.src.js b/packages/shared-fixtures/fixtures/javascript/simple-literals/literal-float.src.js deleted file mode 100644 index 0c12a9ee5f05..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/simple-literals/literal-float.src.js +++ /dev/null @@ -1 +0,0 @@ -const a = 1.5; diff --git a/packages/shared-fixtures/fixtures/javascript/simple-literals/literal-null.src.js b/packages/shared-fixtures/fixtures/javascript/simple-literals/literal-null.src.js deleted file mode 100644 index d6c4ab0750fa..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/simple-literals/literal-null.src.js +++ /dev/null @@ -1 +0,0 @@ -const a = null; diff --git a/packages/shared-fixtures/fixtures/javascript/simple-literals/literal-number-negative.src.js b/packages/shared-fixtures/fixtures/javascript/simple-literals/literal-number-negative.src.js deleted file mode 100644 index 143a6b39de5d..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/simple-literals/literal-number-negative.src.js +++ /dev/null @@ -1 +0,0 @@ -const a = -1; diff --git a/packages/shared-fixtures/fixtures/javascript/simple-literals/literal-number.src.js b/packages/shared-fixtures/fixtures/javascript/simple-literals/literal-number.src.js deleted file mode 100644 index 54b82a09ad54..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/simple-literals/literal-number.src.js +++ /dev/null @@ -1 +0,0 @@ -const a = 1; diff --git a/packages/shared-fixtures/fixtures/javascript/simple-literals/literal-string.src.js b/packages/shared-fixtures/fixtures/javascript/simple-literals/literal-string.src.js deleted file mode 100644 index 25b43319fe43..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/simple-literals/literal-string.src.js +++ /dev/null @@ -1 +0,0 @@ -const a = 'a'; diff --git a/packages/shared-fixtures/fixtures/javascript/simple-literals/literal-undefined.src.js b/packages/shared-fixtures/fixtures/javascript/simple-literals/literal-undefined.src.js deleted file mode 100644 index 0257085abea6..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/simple-literals/literal-undefined.src.js +++ /dev/null @@ -1 +0,0 @@ -const a = undefined; diff --git a/packages/shared-fixtures/fixtures/javascript/spread/complex-spread.src.js b/packages/shared-fixtures/fixtures/javascript/spread/complex-spread.src.js deleted file mode 100644 index d4df1f990ecf..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/spread/complex-spread.src.js +++ /dev/null @@ -1 +0,0 @@ -({x: { ka, ...nested }, y: other, f: { a: [{ ...nested2 }, ...y], b: { z, ...c }, ...rest2 }, ...rest} = complex); diff --git a/packages/shared-fixtures/fixtures/javascript/spread/error-invalid-if.src.js b/packages/shared-fixtures/fixtures/javascript/spread/error-invalid-if.src.js deleted file mode 100644 index 360727b872ef..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/spread/error-invalid-if.src.js +++ /dev/null @@ -1 +0,0 @@ -if (b,...a, ); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/spread/error-invalid-sequence.src.js b/packages/shared-fixtures/fixtures/javascript/spread/error-invalid-sequence.src.js deleted file mode 100644 index 98458f83d68c..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/spread/error-invalid-sequence.src.js +++ /dev/null @@ -1 +0,0 @@ -(b, ...a); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/spread/multi-function-call.src.js b/packages/shared-fixtures/fixtures/javascript/spread/multi-function-call.src.js deleted file mode 100644 index 49237c1f1480..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/spread/multi-function-call.src.js +++ /dev/null @@ -1 +0,0 @@ -foo(a, ...b); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/spread/not-final-param.src.js b/packages/shared-fixtures/fixtures/javascript/spread/not-final-param.src.js deleted file mode 100644 index 7510298b7ca0..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/spread/not-final-param.src.js +++ /dev/null @@ -1 +0,0 @@ -func(...a, b); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/spread/simple-function-call.src.js b/packages/shared-fixtures/fixtures/javascript/spread/simple-function-call.src.js deleted file mode 100644 index 1cc736a0c23c..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/spread/simple-function-call.src.js +++ /dev/null @@ -1 +0,0 @@ -foo(...a); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/templateStrings/deeply-nested.src.js b/packages/shared-fixtures/fixtures/javascript/templateStrings/deeply-nested.src.js deleted file mode 100644 index 4dc0eeb08a34..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/templateStrings/deeply-nested.src.js +++ /dev/null @@ -1 +0,0 @@ -raw`hello ${`nested ${`deeply` + {}} blah`}`; diff --git a/packages/shared-fixtures/fixtures/javascript/templateStrings/error-octal-literal.src.js b/packages/shared-fixtures/fixtures/javascript/templateStrings/error-octal-literal.src.js deleted file mode 100644 index 31c66a405763..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/templateStrings/error-octal-literal.src.js +++ /dev/null @@ -1 +0,0 @@ -`\07`; diff --git a/packages/shared-fixtures/fixtures/javascript/templateStrings/escape-characters.src.js b/packages/shared-fixtures/fixtures/javascript/templateStrings/escape-characters.src.js deleted file mode 100644 index 4163a542c54e..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/templateStrings/escape-characters.src.js +++ /dev/null @@ -1 +0,0 @@ -var ts = `\\n\\r\\b\\v\\t\\f\\\n\\\r\n`; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/templateStrings/expressions.src.js b/packages/shared-fixtures/fixtures/javascript/templateStrings/expressions.src.js deleted file mode 100644 index bbe595e9ecfe..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/templateStrings/expressions.src.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = 5; -var b = 'Fred'; - -`Hello ${b}. a + 5 = ${a + 5}`; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/templateStrings/multi-line-template-string.src.js b/packages/shared-fixtures/fixtures/javascript/templateStrings/multi-line-template-string.src.js deleted file mode 100644 index 4d4d65d91ce5..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/templateStrings/multi-line-template-string.src.js +++ /dev/null @@ -1,6 +0,0 @@ -`The last man on Earth - sat alone in a room. - There was - a knock - on the - door...`; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/templateStrings/simple-template-string.src.js b/packages/shared-fixtures/fixtures/javascript/templateStrings/simple-template-string.src.js deleted file mode 100644 index 1e6428494f65..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/templateStrings/simple-template-string.src.js +++ /dev/null @@ -1 +0,0 @@ -`42`; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/templateStrings/single-dollar-sign.src.js b/packages/shared-fixtures/fixtures/javascript/templateStrings/single-dollar-sign.src.js deleted file mode 100644 index 6788caf51477..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/templateStrings/single-dollar-sign.src.js +++ /dev/null @@ -1 +0,0 @@ -var ts = `$`; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/templateStrings/tagged-no-placeholders.src.js b/packages/shared-fixtures/fixtures/javascript/templateStrings/tagged-no-placeholders.src.js deleted file mode 100644 index 02458f045eb3..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/templateStrings/tagged-no-placeholders.src.js +++ /dev/null @@ -1 +0,0 @@ -foo`foo`; diff --git a/packages/shared-fixtures/fixtures/javascript/templateStrings/tagged-template-string.src.js b/packages/shared-fixtures/fixtures/javascript/templateStrings/tagged-template-string.src.js deleted file mode 100644 index 61a0bdac2e5f..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/templateStrings/tagged-template-string.src.js +++ /dev/null @@ -1,4 +0,0 @@ -function tag() { - console.log(arguments); -} -tag`a is ${a} while b is ${b}.`; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/unicodeCodePointEscapes/basic-string-literal.src.js b/packages/shared-fixtures/fixtures/javascript/unicodeCodePointEscapes/basic-string-literal.src.js deleted file mode 100644 index 9edb72773067..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/unicodeCodePointEscapes/basic-string-literal.src.js +++ /dev/null @@ -1 +0,0 @@ -"\u{714E}\u{8336}"; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/unicodeCodePointEscapes/complex-string-literal.src.js b/packages/shared-fixtures/fixtures/javascript/unicodeCodePointEscapes/complex-string-literal.src.js deleted file mode 100644 index ac32b40609c0..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/unicodeCodePointEscapes/complex-string-literal.src.js +++ /dev/null @@ -1 +0,0 @@ -"\u{20BB7}\u{10FFFF}\u{1}"; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/unicodeCodePointEscapes/ignored.src.js b/packages/shared-fixtures/fixtures/javascript/unicodeCodePointEscapes/ignored.src.js deleted file mode 100644 index 663bc1e5ec2a..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/unicodeCodePointEscapes/ignored.src.js +++ /dev/null @@ -1,9 +0,0 @@ -const b = ' '; -let c = ' '; -let d = '&'; -const e = { - f: 'id=1&group=2', - g(h = '�') {}, - i: (j = '�') => {}, -}; -e.i('&#x;'); diff --git a/packages/shared-fixtures/fixtures/javascript/unicodeCodePointEscapes/invalid-empty-escape.src.js b/packages/shared-fixtures/fixtures/javascript/unicodeCodePointEscapes/invalid-empty-escape.src.js deleted file mode 100644 index 5d58cb32306b..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/unicodeCodePointEscapes/invalid-empty-escape.src.js +++ /dev/null @@ -1 +0,0 @@ -"\u{}"; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/javascript/unicodeCodePointEscapes/invalid-too-large-escape.src.js b/packages/shared-fixtures/fixtures/javascript/unicodeCodePointEscapes/invalid-too-large-escape.src.js deleted file mode 100644 index 30b7cd791f31..000000000000 --- a/packages/shared-fixtures/fixtures/javascript/unicodeCodePointEscapes/invalid-too-large-escape.src.js +++ /dev/null @@ -1 +0,0 @@ -"\u{FFFFFF}"; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx-useJSXTextNode/self-closing-tag-inside-tag.src.js b/packages/shared-fixtures/fixtures/jsx-useJSXTextNode/self-closing-tag-inside-tag.src.js deleted file mode 100644 index b1b254055e2e..000000000000 --- a/packages/shared-fixtures/fixtures/jsx-useJSXTextNode/self-closing-tag-inside-tag.src.js +++ /dev/null @@ -1,3 +0,0 @@ -
- -
diff --git a/packages/shared-fixtures/fixtures/jsx-useJSXTextNode/test-content.src.js b/packages/shared-fixtures/fixtures/jsx-useJSXTextNode/test-content.src.js deleted file mode 100644 index ffaed57254f4..000000000000 --- a/packages/shared-fixtures/fixtures/jsx-useJSXTextNode/test-content.src.js +++ /dev/null @@ -1 +0,0 @@ -
@test content
; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/attributes.src.js b/packages/shared-fixtures/fixtures/jsx/attributes.src.js deleted file mode 100644 index 5de9359ff361..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/attributes.src.js +++ /dev/null @@ -1 +0,0 @@ -test \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/element-keyword-name.src.js b/packages/shared-fixtures/fixtures/jsx/element-keyword-name.src.js deleted file mode 100644 index 55faaf141dc2..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/element-keyword-name.src.js +++ /dev/null @@ -1,5 +0,0 @@ -
- - - - diff --git a/packages/shared-fixtures/fixtures/jsx/embedded-comment.src.js b/packages/shared-fixtures/fixtures/jsx/embedded-comment.src.js deleted file mode 100644 index 9ccfd89113d4..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/embedded-comment.src.js +++ /dev/null @@ -1 +0,0 @@ -{/* this is a comment */}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/embedded-conditional.src.js b/packages/shared-fixtures/fixtures/jsx/embedded-conditional.src.js deleted file mode 100644 index 44134ac352b9..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/embedded-conditional.src.js +++ /dev/null @@ -1 +0,0 @@ - : } />; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/embedded-invalid-js-identifier.src.js b/packages/shared-fixtures/fixtures/jsx/embedded-invalid-js-identifier.src.js deleted file mode 100644 index 5138ffb14237..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/embedded-invalid-js-identifier.src.js +++ /dev/null @@ -1 +0,0 @@ -

7x invalid-js-identifier
; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/embedded-tags.src.js b/packages/shared-fixtures/fixtures/jsx/embedded-tags.src.js deleted file mode 100644 index 48260fa6544a..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/embedded-tags.src.js +++ /dev/null @@ -1 +0,0 @@ - right=monkeys /> gorillas />; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/empty-placeholder.src.js b/packages/shared-fixtures/fixtures/jsx/empty-placeholder.src.js deleted file mode 100644 index 7e7ae12a57fa..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/empty-placeholder.src.js +++ /dev/null @@ -1 +0,0 @@ -
{}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/escape-patterns-ignored.src.js b/packages/shared-fixtures/fixtures/jsx/escape-patterns-ignored.src.js deleted file mode 100644 index d22bc77844e1..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/escape-patterns-ignored.src.js +++ /dev/null @@ -1,9 +0,0 @@ -; diff --git a/packages/shared-fixtures/fixtures/jsx/escape-patterns-unknown.src.js b/packages/shared-fixtures/fixtures/jsx/escape-patterns-unknown.src.js deleted file mode 100644 index 2d8393ff0a76..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/escape-patterns-unknown.src.js +++ /dev/null @@ -1,6 +0,0 @@ -; -; -; -&abc;; -¬anentity;; -&#x;; diff --git a/packages/shared-fixtures/fixtures/jsx/escape-patterns-valid.src.js b/packages/shared-fixtures/fixtures/jsx/escape-patterns-valid.src.js deleted file mode 100644 index d6be1e35396d..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/escape-patterns-valid.src.js +++ /dev/null @@ -1,3 +0,0 @@ - -   -; diff --git a/packages/shared-fixtures/fixtures/jsx/escape-patters-multi.src.js b/packages/shared-fixtures/fixtures/jsx/escape-patters-multi.src.js deleted file mode 100644 index 15eb28c92ec1..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/escape-patters-multi.src.js +++ /dev/null @@ -1 +0,0 @@ -  test; diff --git a/packages/shared-fixtures/fixtures/jsx/invalid-attribute-missing-equals.src.js b/packages/shared-fixtures/fixtures/jsx/invalid-attribute-missing-equals.src.js deleted file mode 100644 index c4bdb625c16c..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/invalid-attribute-missing-equals.src.js +++ /dev/null @@ -1 +0,0 @@ -
; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/invalid-attribute.src.js b/packages/shared-fixtures/fixtures/jsx/invalid-attribute.src.js deleted file mode 100644 index a3d16ade8f01..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/invalid-attribute.src.js +++ /dev/null @@ -1 +0,0 @@ -; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/invalid-broken-tag.src.js b/packages/shared-fixtures/fixtures/jsx/invalid-broken-tag.src.js deleted file mode 100644 index 20899cb988ae..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/invalid-broken-tag.src.js +++ /dev/null @@ -1 +0,0 @@ -; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/invalid-leading-dot-tag-name.src.js b/packages/shared-fixtures/fixtures/jsx/invalid-leading-dot-tag-name.src.js deleted file mode 100644 index 297c850a4931..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/invalid-leading-dot-tag-name.src.js +++ /dev/null @@ -1 +0,0 @@ -<.a>; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/invalid-matching-placeholder-in-closing-tag.src.js b/packages/shared-fixtures/fixtures/jsx/invalid-matching-placeholder-in-closing-tag.src.js deleted file mode 100644 index e2b8b4aabcc6..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/invalid-matching-placeholder-in-closing-tag.src.js +++ /dev/null @@ -1 +0,0 @@ -
stuff
; diff --git a/packages/shared-fixtures/fixtures/jsx/invalid-mismatched-closing-tag.src.js b/packages/shared-fixtures/fixtures/jsx/invalid-mismatched-closing-tag.src.js deleted file mode 100644 index 70b531344460..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/invalid-mismatched-closing-tag.src.js +++ /dev/null @@ -1 +0,0 @@ -
; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/invalid-mismatched-closing-tags.src.js b/packages/shared-fixtures/fixtures/jsx/invalid-mismatched-closing-tags.src.js deleted file mode 100644 index cdb02a657ee0..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/invalid-mismatched-closing-tags.src.js +++ /dev/null @@ -1 +0,0 @@ -; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/invalid-mismatched-dot-tag-name.src.js b/packages/shared-fixtures/fixtures/jsx/invalid-mismatched-dot-tag-name.src.js deleted file mode 100644 index aed52724e824..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/invalid-mismatched-dot-tag-name.src.js +++ /dev/null @@ -1 +0,0 @@ -; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/invalid-mismatched-namespace-tag.src.js b/packages/shared-fixtures/fixtures/jsx/invalid-mismatched-namespace-tag.src.js deleted file mode 100644 index bbda65c72d7c..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/invalid-mismatched-namespace-tag.src.js +++ /dev/null @@ -1 +0,0 @@ -
; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/invalid-missing-closing-tag-attribute-placeholder.src.js b/packages/shared-fixtures/fixtures/jsx/invalid-missing-closing-tag-attribute-placeholder.src.js deleted file mode 100644 index b6d9a638840e..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/invalid-missing-closing-tag-attribute-placeholder.src.js +++ /dev/null @@ -1 +0,0 @@ -; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/invalid-missing-closing-tag.src.js b/packages/shared-fixtures/fixtures/jsx/invalid-missing-closing-tag.src.js deleted file mode 100644 index 7c7493261deb..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/invalid-missing-closing-tag.src.js +++ /dev/null @@ -1 +0,0 @@ -; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/invalid-missing-namespace-name.src.js b/packages/shared-fixtures/fixtures/jsx/invalid-missing-namespace-name.src.js deleted file mode 100644 index 203ca0836b8f..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/invalid-missing-namespace-name.src.js +++ /dev/null @@ -1 +0,0 @@ -<:a />; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/invalid-missing-namespace-value.src.js b/packages/shared-fixtures/fixtures/jsx/invalid-missing-namespace-value.src.js deleted file mode 100644 index 52bc77e33ac1..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/invalid-missing-namespace-value.src.js +++ /dev/null @@ -1 +0,0 @@ -; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/invalid-missing-spread-operator.src.js b/packages/shared-fixtures/fixtures/jsx/invalid-missing-spread-operator.src.js deleted file mode 100644 index 2d96e2fa71cb..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/invalid-missing-spread-operator.src.js +++ /dev/null @@ -1 +0,0 @@ -
; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/invalid-namespace-name-with-docts.src.js b/packages/shared-fixtures/fixtures/jsx/invalid-namespace-name-with-docts.src.js deleted file mode 100644 index 4c9e774a3c74..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/invalid-namespace-name-with-docts.src.js +++ /dev/null @@ -1 +0,0 @@ -; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/invalid-namespace-value-with-dots.src.js b/packages/shared-fixtures/fixtures/jsx/invalid-namespace-value-with-dots.src.js deleted file mode 100644 index f3a9fdc0e4f8..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/invalid-namespace-value-with-dots.src.js +++ /dev/null @@ -1 +0,0 @@ -; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/invalid-no-common-parent-with-comment.src.js b/packages/shared-fixtures/fixtures/jsx/invalid-no-common-parent-with-comment.src.js deleted file mode 100644 index 0c8bde149a88..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/invalid-no-common-parent-with-comment.src.js +++ /dev/null @@ -1 +0,0 @@ -var x =
one
/* intervening comment */
two
; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/invalid-no-common-parent.src.js b/packages/shared-fixtures/fixtures/jsx/invalid-no-common-parent.src.js deleted file mode 100644 index 7f8c0f612b39..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/invalid-no-common-parent.src.js +++ /dev/null @@ -1 +0,0 @@ -var x =
one
two
; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/invalid-no-tag-name.src.js b/packages/shared-fixtures/fixtures/jsx/invalid-no-tag-name.src.js deleted file mode 100644 index a365ca6f5564..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/invalid-no-tag-name.src.js +++ /dev/null @@ -1 +0,0 @@ -; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/invalid-placeholder-in-closing-tag.src.js b/packages/shared-fixtures/fixtures/jsx/invalid-placeholder-in-closing-tag.src.js deleted file mode 100644 index cff69dd9a082..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/invalid-placeholder-in-closing-tag.src.js +++ /dev/null @@ -1 +0,0 @@ -
stuff
; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/invalid-shorthand-fragment-no-closing.src.js b/packages/shared-fixtures/fixtures/jsx/invalid-shorthand-fragment-no-closing.src.js deleted file mode 100644 index 20c0a6617600..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/invalid-shorthand-fragment-no-closing.src.js +++ /dev/null @@ -1 +0,0 @@ -<>
diff --git a/packages/shared-fixtures/fixtures/jsx/invalid-trailing-dot-tag-name.src.js b/packages/shared-fixtures/fixtures/jsx/invalid-trailing-dot-tag-name.src.js deleted file mode 100644 index 40585f15c755..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/invalid-trailing-dot-tag-name.src.js +++ /dev/null @@ -1 +0,0 @@ -; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/invalid-unexpected-comma.src.js b/packages/shared-fixtures/fixtures/jsx/invalid-unexpected-comma.src.js deleted file mode 100644 index afdfc83b1575..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/invalid-unexpected-comma.src.js +++ /dev/null @@ -1 +0,0 @@ -; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/japanese-characters.src.js b/packages/shared-fixtures/fixtures/jsx/japanese-characters.src.js deleted file mode 100644 index 750d3539568e..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/japanese-characters.src.js +++ /dev/null @@ -1 +0,0 @@ -<日本語>; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/less-than-operator.src.js b/packages/shared-fixtures/fixtures/jsx/less-than-operator.src.js deleted file mode 100644 index d2b623552527..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/less-than-operator.src.js +++ /dev/null @@ -1 +0,0 @@ -(
) < x; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/member-expression-private.src.js b/packages/shared-fixtures/fixtures/jsx/member-expression-private.src.js deleted file mode 100644 index 48691af12721..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/member-expression-private.src.js +++ /dev/null @@ -1 +0,0 @@ -; diff --git a/packages/shared-fixtures/fixtures/jsx/member-expression-this.src.js b/packages/shared-fixtures/fixtures/jsx/member-expression-this.src.js deleted file mode 100644 index a9ab134d4b48..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/member-expression-this.src.js +++ /dev/null @@ -1,2 +0,0 @@ -; -; diff --git a/packages/shared-fixtures/fixtures/jsx/member-expression.src.js b/packages/shared-fixtures/fixtures/jsx/member-expression.src.js deleted file mode 100644 index a5cd092d6ed2..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/member-expression.src.js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/packages/shared-fixtures/fixtures/jsx/multiple-blank-spaces.src.js b/packages/shared-fixtures/fixtures/jsx/multiple-blank-spaces.src.js deleted file mode 100644 index 8283d5e183d2..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/multiple-blank-spaces.src.js +++ /dev/null @@ -1 +0,0 @@ - ; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/namespace-this-name.src.js b/packages/shared-fixtures/fixtures/jsx/namespace-this-name.src.js deleted file mode 100644 index 71eb04b5e41a..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/namespace-this-name.src.js +++ /dev/null @@ -1 +0,0 @@ -; diff --git a/packages/shared-fixtures/fixtures/jsx/namespaced-attribute-and-value-inserted.src.js b/packages/shared-fixtures/fixtures/jsx/namespaced-attribute-and-value-inserted.src.js deleted file mode 100644 index 6cd67fa28f0f..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/namespaced-attribute-and-value-inserted.src.js +++ /dev/null @@ -1 +0,0 @@ - {value} ; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/namespaced-name-and-attribute.src.js b/packages/shared-fixtures/fixtures/jsx/namespaced-name-and-attribute.src.js deleted file mode 100644 index eb59e59d6b6b..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/namespaced-name-and-attribute.src.js +++ /dev/null @@ -1 +0,0 @@ -; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/newslines-and-entities.src.js b/packages/shared-fixtures/fixtures/jsx/newslines-and-entities.src.js deleted file mode 100644 index adcbb4c63a2c..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/newslines-and-entities.src.js +++ /dev/null @@ -1 +0,0 @@ -\nbar\nbaz\r\n; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/self-closing-tag-inside-tag.src.js b/packages/shared-fixtures/fixtures/jsx/self-closing-tag-inside-tag.src.js deleted file mode 100644 index b1b254055e2e..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/self-closing-tag-inside-tag.src.js +++ /dev/null @@ -1,3 +0,0 @@ -
- -
diff --git a/packages/shared-fixtures/fixtures/jsx/self-closing-tag-with-newline.src.js b/packages/shared-fixtures/fixtures/jsx/self-closing-tag-with-newline.src.js deleted file mode 100644 index 11d5cedfff0b..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/self-closing-tag-with-newline.src.js +++ /dev/null @@ -1 +0,0 @@ -; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/self-closing-tag.src.js b/packages/shared-fixtures/fixtures/jsx/self-closing-tag.src.js deleted file mode 100644 index 461e8955c72a..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/self-closing-tag.src.js +++ /dev/null @@ -1 +0,0 @@ -; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/shorthand-fragment-with-child.src.js b/packages/shared-fixtures/fixtures/jsx/shorthand-fragment-with-child.src.js deleted file mode 100644 index ac72d178fa84..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/shorthand-fragment-with-child.src.js +++ /dev/null @@ -1 +0,0 @@ -<>
diff --git a/packages/shared-fixtures/fixtures/jsx/shorthand-fragment.src.js b/packages/shared-fixtures/fixtures/jsx/shorthand-fragment.src.js deleted file mode 100644 index 4a80b22beeff..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/shorthand-fragment.src.js +++ /dev/null @@ -1 +0,0 @@ -<> diff --git a/packages/shared-fixtures/fixtures/jsx/spread-child.src.js b/packages/shared-fixtures/fixtures/jsx/spread-child.src.js deleted file mode 100644 index 48ce23c9bd02..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/spread-child.src.js +++ /dev/null @@ -1 +0,0 @@ -
{...[0]}
diff --git a/packages/shared-fixtures/fixtures/jsx/spread-operator-attribute-and-regular-attribute.src.js b/packages/shared-fixtures/fixtures/jsx/spread-operator-attribute-and-regular-attribute.src.js deleted file mode 100644 index ee11c44f484f..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/spread-operator-attribute-and-regular-attribute.src.js +++ /dev/null @@ -1 +0,0 @@ -
; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/spread-operator-attributes.src.js b/packages/shared-fixtures/fixtures/jsx/spread-operator-attributes.src.js deleted file mode 100644 index 99d6539aae2e..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/spread-operator-attributes.src.js +++ /dev/null @@ -1 +0,0 @@ -
; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/tag-names-with-dots.src.js b/packages/shared-fixtures/fixtures/jsx/tag-names-with-dots.src.js deleted file mode 100644 index 6d5813d15dfa..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/tag-names-with-dots.src.js +++ /dev/null @@ -1 +0,0 @@ -; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/tag-names-with-multi-dots-multi.src.js b/packages/shared-fixtures/fixtures/jsx/tag-names-with-multi-dots-multi.src.js deleted file mode 100644 index 1599e0620cd9..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/tag-names-with-multi-dots-multi.src.js +++ /dev/null @@ -1,3 +0,0 @@ - - -; diff --git a/packages/shared-fixtures/fixtures/jsx/tag-names-with-multi-dots.src.js b/packages/shared-fixtures/fixtures/jsx/tag-names-with-multi-dots.src.js deleted file mode 100644 index 78a3d60d40d7..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/tag-names-with-multi-dots.src.js +++ /dev/null @@ -1 +0,0 @@ -; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/test-content.src.js b/packages/shared-fixtures/fixtures/jsx/test-content.src.js deleted file mode 100644 index ffaed57254f4..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/test-content.src.js +++ /dev/null @@ -1 +0,0 @@ -
@test content
; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/jsx/trailing-spread-operator-attribute.src.js b/packages/shared-fixtures/fixtures/jsx/trailing-spread-operator-attribute.src.js deleted file mode 100644 index ee9ab396dbff..000000000000 --- a/packages/shared-fixtures/fixtures/jsx/trailing-spread-operator-attribute.src.js +++ /dev/null @@ -1 +0,0 @@ -
; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/tsx/generic-jsx-element.src.tsx b/packages/shared-fixtures/fixtures/tsx/generic-jsx-element.src.tsx deleted file mode 100644 index 7a620161439c..000000000000 --- a/packages/shared-fixtures/fixtures/tsx/generic-jsx-element.src.tsx +++ /dev/null @@ -1 +0,0 @@ - data={12} /> diff --git a/packages/shared-fixtures/fixtures/tsx/generic-jsx-member-expression-private.src.tsx b/packages/shared-fixtures/fixtures/tsx/generic-jsx-member-expression-private.src.tsx deleted file mode 100644 index df915e2afc6a..000000000000 --- a/packages/shared-fixtures/fixtures/tsx/generic-jsx-member-expression-private.src.tsx +++ /dev/null @@ -1 +0,0 @@ -const foo = /> diff --git a/packages/shared-fixtures/fixtures/tsx/generic-jsx-opening-element.src.tsx b/packages/shared-fixtures/fixtures/tsx/generic-jsx-opening-element.src.tsx deleted file mode 100644 index fe6dfcffea8f..000000000000 --- a/packages/shared-fixtures/fixtures/tsx/generic-jsx-opening-element.src.tsx +++ /dev/null @@ -1 +0,0 @@ - data={12}> diff --git a/packages/shared-fixtures/fixtures/tsx/react-typed-props.src.tsx b/packages/shared-fixtures/fixtures/tsx/react-typed-props.src.tsx deleted file mode 100644 index ebeccee4f4f1..000000000000 --- a/packages/shared-fixtures/fixtures/tsx/react-typed-props.src.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import * as React from 'react' -type Props = { - title: string -} - -export default function App(props: Props) { - return ( -

- {props.title} -

- ) -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/babylon-convergence/type-parameter-whitespace-loc.src.ts b/packages/shared-fixtures/fixtures/typescript/babylon-convergence/type-parameter-whitespace-loc.src.ts deleted file mode 100644 index 56d367c193d4..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/babylon-convergence/type-parameter-whitespace-loc.src.ts +++ /dev/null @@ -1 +0,0 @@ -function f< T >() {} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/babylon-convergence/type-parameters.src.ts b/packages/shared-fixtures/fixtures/typescript/babylon-convergence/type-parameters.src.ts deleted file mode 100644 index 526137f30906..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/babylon-convergence/type-parameters.src.ts +++ /dev/null @@ -1 +0,0 @@ -function f() {} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-abstract-constructor.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-abstract-constructor.src.ts deleted file mode 100644 index 66b70824ae24..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-abstract-constructor.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -export abstract class AbstractSocket { - abstract constructor(); -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-abstract-method.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-abstract-method.src.ts deleted file mode 100644 index 537036b92f84..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-abstract-method.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -export abstract class AbstractSocket { - abstract createSocket(): Promise; -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-abstract-properties.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-abstract-properties.src.ts deleted file mode 100644 index 223917818db9..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-abstract-properties.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -abstract class Foo { - abstract bar; - abstract baz: number; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-abstract-readonly-property.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-abstract-readonly-property.src.ts deleted file mode 100644 index d00921ef4674..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-abstract-readonly-property.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -abstract class Foo { - public abstract readonly foo: string; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-abstract-static-constructor.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-abstract-static-constructor.src.ts deleted file mode 100644 index 0b18c3192919..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-abstract-static-constructor.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -export abstract class AbstractSocket { - abstract static constructor(); -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-declare-properties.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-declare-properties.src.ts deleted file mode 100644 index 307d36a66163..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-declare-properties.src.ts +++ /dev/null @@ -1,7 +0,0 @@ -abstract class AbstractDeclProps { - declare prop1: string; - declare abstract prop2: string; - declare public abstract prop3: string; - declare readonly abstract prop4: string; - declare public readonly abstract prop5: string; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-optional-method.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-optional-method.src.ts deleted file mode 100644 index f39ba3fc0b8c..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-optional-method.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -export abstract class AbstractSocket { - createSocket?(): Promise; -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-override-method.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-override-method.src.ts deleted file mode 100644 index e6cecdc5ab8d..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-override-method.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -abstract class SpecializedComponent extends SomeComponent { - abstract override show(); -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-override-property.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-override-property.src.ts deleted file mode 100644 index 8839340d7aad..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/abstract-class-with-override-property.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -abstract class SpecializedComponent extends SomeComponent { - abstract override foo = 1; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/abstract-interface.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/abstract-interface.src.ts deleted file mode 100644 index 8fafeca6066c..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/abstract-interface.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -export abstract interface I { -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/angle-bracket-type-assertion-arrow-function.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/angle-bracket-type-assertion-arrow-function.src.ts deleted file mode 100644 index f3827b2de3b8..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/angle-bracket-type-assertion-arrow-function.src.ts +++ /dev/null @@ -1 +0,0 @@ -var asserted2 = ((n) => { return n; }); diff --git a/packages/shared-fixtures/fixtures/typescript/basics/angle-bracket-type-assertion.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/angle-bracket-type-assertion.src.ts deleted file mode 100644 index 67e0d6954710..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/angle-bracket-type-assertion.src.ts +++ /dev/null @@ -1 +0,0 @@ -const foo = 2; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/arrow-function-with-optional-parameter.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/arrow-function-with-optional-parameter.src.ts deleted file mode 100644 index 0289f3828aa8..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/arrow-function-with-optional-parameter.src.ts +++ /dev/null @@ -1 +0,0 @@ -((k?) => k + 1)(); diff --git a/packages/shared-fixtures/fixtures/typescript/basics/arrow-function-with-type-parameters.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/arrow-function-with-type-parameters.src.ts deleted file mode 100644 index a50543105d12..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/arrow-function-with-type-parameters.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -(b: X): X => { - return b; -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/async-function-expression.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/async-function-expression.src.ts deleted file mode 100644 index 7849af4e1bca..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/async-function-expression.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -(async function test() { -})(); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/async-function-with-var-declaration.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/async-function-with-var-declaration.src.ts deleted file mode 100644 index e691825b8056..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/async-function-with-var-declaration.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -async function test() { - var foo = 'foo'; - let bar = 'bar'; - const fooBar = 'fooBar'; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/await-without-async-function.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/await-without-async-function.src.ts deleted file mode 100644 index ae6be9bb7fb1..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/await-without-async-function.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -function foo() { - const bar = await baz(); - return bar.qux; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/call-signatures-with-generics.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/call-signatures-with-generics.src.ts deleted file mode 100644 index 66abe7617738..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/call-signatures-with-generics.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -type foo = { - (a: string): string - new(a: string): string -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/call-signatures.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/call-signatures.src.ts deleted file mode 100644 index 6b9205ce3f76..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/call-signatures.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -type foo = { - (a: string): string - new(a: string): string -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/cast-as-expression.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/cast-as-expression.src.ts deleted file mode 100644 index 20f5214d29d8..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/cast-as-expression.src.ts +++ /dev/null @@ -1 +0,0 @@ -x < y as boolean; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/cast-as-multi-assign.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/cast-as-multi-assign.src.ts deleted file mode 100644 index 952b95935afa..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/cast-as-multi-assign.src.ts +++ /dev/null @@ -1 +0,0 @@ -(a as number as any) = 42; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/cast-as-multi.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/cast-as-multi.src.ts deleted file mode 100644 index 38764dd5bb86..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/cast-as-multi.src.ts +++ /dev/null @@ -1 +0,0 @@ -x as any as T; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/cast-as-operator.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/cast-as-operator.src.ts deleted file mode 100644 index cc057edc23f8..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/cast-as-operator.src.ts +++ /dev/null @@ -1 +0,0 @@ -x === 1 as number; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/cast-as-simple.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/cast-as-simple.src.ts deleted file mode 100644 index 64a82f8e9f2e..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/cast-as-simple.src.ts +++ /dev/null @@ -1 +0,0 @@ -const foo = x as any; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/catch-clause-with-annotation.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/catch-clause-with-annotation.src.ts deleted file mode 100644 index 8b6c766f2d79..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/catch-clause-with-annotation.src.ts +++ /dev/null @@ -1,11 +0,0 @@ -try { - -} catch (e: any) { - -} - -try { - -} catch (e: unknown) { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/catch-clause-with-invalid-annotation.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/catch-clause-with-invalid-annotation.src.ts deleted file mode 100644 index 28f8b6280b25..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/catch-clause-with-invalid-annotation.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -try { - -} catch (e: string) { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-multi-line-keyword-abstract.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-multi-line-keyword-abstract.src.ts deleted file mode 100644 index 7c56988be397..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-multi-line-keyword-abstract.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -abstract -class B {} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-multi-line-keyword-declare.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-multi-line-keyword-declare.src.ts deleted file mode 100644 index 2710f781ffdb..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-multi-line-keyword-declare.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare -class B {} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-private-identifier-field-with-accessibility-error.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-private-identifier-field-with-accessibility-error.src.ts deleted file mode 100644 index 554ea66635ae..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-private-identifier-field-with-accessibility-error.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -class Foo { - private #priv1: string - public #priv2: string - static #priv3: string -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-private-identifier-field-with-annotation.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-private-identifier-field-with-annotation.src.ts deleted file mode 100644 index f771a81a83a4..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-private-identifier-field-with-annotation.src.ts +++ /dev/null @@ -1,8 +0,0 @@ -class Foo { - #priv1: number; - #priv2: number = 1; - - constructor() { - this.#priv1 = 1; - } -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-private-identifier-readonly-field.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-private-identifier-readonly-field.src.ts deleted file mode 100644 index 254995a222b1..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-private-identifier-readonly-field.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class Foo { - readonly #priv: string -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-static-blocks.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-static-blocks.src.ts deleted file mode 100644 index 21ae81c3aea1..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-static-blocks.src.ts +++ /dev/null @@ -1,8 +0,0 @@ -class Foo { - static count = 0; - static { - if (someCondition()) { - count++; - } - } -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-accessibility-modifiers.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-accessibility-modifiers.src.ts deleted file mode 100644 index 14b2f8e38750..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-accessibility-modifiers.src.ts +++ /dev/null @@ -1,10 +0,0 @@ -class Foo { - private bar : string; - public static baz : number; - public getBar () { - return this.bar; - } - protected setBar (bar : string) { - this.bar = bar; - } -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-constructor-and-modifier.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-constructor-and-modifier.src.ts deleted file mode 100644 index ba1998078db8..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-constructor-and-modifier.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -class C { - protected constructor() { } - - public ['constructor']() { } -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-constructor-and-parameter-property-with-modifiers.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-constructor-and-parameter-property-with-modifiers.src.ts deleted file mode 100644 index 846318396d4e..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-constructor-and-parameter-property-with-modifiers.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class SpecializedComponent extends SomeComponent { - constructor(protected override readonly param: string) {} -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-constructor-and-parameter-proptery-with-override-modifier.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-constructor-and-parameter-proptery-with-override-modifier.src.ts deleted file mode 100644 index 2c734ff5c607..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-constructor-and-parameter-proptery-with-override-modifier.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -class SpecializedComponent extends SomeComponent { - constructor(override param: string) { - super(); - } -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-constructor-and-return-type.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-constructor-and-return-type.src.ts deleted file mode 100644 index a895ae3be7e0..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-constructor-and-return-type.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -class C { - constructor(): number { } - - ['constructor'](): number { } -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-constructor-and-type-parameters.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-constructor-and-type-parameters.src.ts deleted file mode 100644 index 90628efe1fbe..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-constructor-and-type-parameters.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -class C { - constructor() { } - - ['constructor']() { } -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-declare-properties.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-declare-properties.src.ts deleted file mode 100644 index 3b37e42e4b19..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-declare-properties.src.ts +++ /dev/null @@ -1,9 +0,0 @@ -class DeclProps { - declare prop1: string; - declare public prop2: string; - declare static prop3: string; - declare readonly prop3: string; - declare public readonly prop4: string; - declare public static prop5: string; - declare public static readonly prop6: string; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-definite-assignment.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-definite-assignment.src.ts deleted file mode 100644 index b1882b9f280d..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-definite-assignment.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class X { - a!: string; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-export-parameter-properties.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-export-parameter-properties.src.ts deleted file mode 100644 index f1befb271eef..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-export-parameter-properties.src.ts +++ /dev/null @@ -1,6 +0,0 @@ -class Foo { - constructor(export a: string) { - - } -} - diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-extends-and-implements.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-extends-and-implements.src.ts deleted file mode 100644 index fe7ea2560e59..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-extends-and-implements.src.ts +++ /dev/null @@ -1 +0,0 @@ -class ClassWithParentAndInterface extends MyOtherClass implements MyInterface {} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-extends-generic-multiple.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-extends-generic-multiple.src.ts deleted file mode 100644 index a37bc0a5d9b8..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-extends-generic-multiple.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class Foo
extends Bar { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-extends-generic.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-extends-generic.src.ts deleted file mode 100644 index 0c32155ff2f6..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-extends-generic.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class Foo extends Bar { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-generic-method-default.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-generic-method-default.src.ts deleted file mode 100644 index 957a382b419a..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-generic-method-default.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class Foo { - getBar() {} -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-generic-method.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-generic-method.src.ts deleted file mode 100644 index abef5e5909c6..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-generic-method.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class Foo { - getBar() {} -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-implements-and-extends.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-implements-and-extends.src.ts deleted file mode 100644 index fe44fc7ba1b2..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-implements-and-extends.src.ts +++ /dev/null @@ -1 +0,0 @@ -class ClassWithParentAndInterface implements MyInterface extends MyOtherClass {} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-implements-generic-multiple.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-implements-generic-multiple.src.ts deleted file mode 100644 index 0a02bc2081f4..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-implements-generic-multiple.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class Foo implements Bar { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-implements-generic.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-implements-generic.src.ts deleted file mode 100644 index b18efb98d086..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-implements-generic.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class Foo implements Bar { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-implements.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-implements.src.ts deleted file mode 100644 index 321a2ea746ae..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-implements.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class Foo implements Bar { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-method.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-method.src.ts deleted file mode 100644 index a84bffcd4946..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-method.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -class C { - foo(): number { } - bar() { } - baz() {} -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-mixin-reference.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-mixin-reference.src.ts deleted file mode 100644 index 9ba1bfd50b79..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-mixin-reference.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -function M>(Base: T) { -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-mixin.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-mixin.src.ts deleted file mode 100644 index 975b36a3e7d1..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-mixin.src.ts +++ /dev/null @@ -1,9 +0,0 @@ -function M>(Base: T) { - return class extends Base { } -} - -class X extends M(C) implements I { } - -class C { } -interface I { } -type Constructor = new (...args: any[]) => T; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-optional-computed-method.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-optional-computed-method.src.ts deleted file mode 100644 index 947cb550c2ce..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-optional-computed-method.src.ts +++ /dev/null @@ -1,17 +0,0 @@ -const computed1 = "buzz"; -const computed2 = "bazz"; -const obj = { - member: "member", - member2: "member2", -}; -class X { - [computed1]?(); - [computed2]?() {}; - [1]?(); - [2]?() {}; - ["literal1"]?(); - ["literal2"]?() {}; - [obj.member]?() {}; - [obj.member2]?(); - [f()]?() {} -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-optional-computed-property.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-optional-computed-property.src.ts deleted file mode 100644 index 5dd15f31b2a1..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-optional-computed-property.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class X { - private ['foo']? = undefined; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-optional-methods.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-optional-methods.src.ts deleted file mode 100644 index 2fe152d3d419..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-optional-methods.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -class Foo { - foo?(); - bar?(): string; - private baz?(): string; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-optional-properties.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-optional-properties.src.ts deleted file mode 100644 index e9292de2e068..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-optional-properties.src.ts +++ /dev/null @@ -1,13 +0,0 @@ -const computed = 'buzz'; -const computed2 = 'bazz'; -class Foo { - foo?; - bar? : string; - private baz? : string; - [computed]?; - ['literal']?; - [1]?; - [computed2]?: string; - ['literal2']?: string; - [2]?: string; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-optional-property-undefined.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-optional-property-undefined.src.ts deleted file mode 100644 index 126d595430f0..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-optional-property-undefined.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -class X { - private foo? = undefined; -} - diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-override-method.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-override-method.src.ts deleted file mode 100644 index da3b89239d1f..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-override-method.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -class SpecializedComponent extends SomeComponent { - override show() { - // ... - } -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-override-property.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-override-property.src.ts deleted file mode 100644 index fc5dc8e431ba..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-override-property.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class SpecializedComponent extends SomeComponent { - override foo = 1; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-private-optional-property.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-private-optional-property.src.ts deleted file mode 100644 index bb3e79a9cb4d..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-private-optional-property.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -class Foo { - #prop?: string; - #propExplicitWithValue?: string = ''; - #propImplicitWithValue? = ''; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-private-parameter-properties.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-private-parameter-properties.src.ts deleted file mode 100644 index f806c1ee9f8a..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-private-parameter-properties.src.ts +++ /dev/null @@ -1,6 +0,0 @@ -class Foo { - constructor(private firstName: string, - private readonly lastName: string, - private age: number = 30, - private readonly student: boolean = false) {} -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-property-function.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-property-function.src.ts deleted file mode 100644 index 048634cb5998..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-property-function.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -class Foo { - foo: () => boolean = (): boolean => true; - bar: string = () => test; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-property-values.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-property-values.src.ts deleted file mode 100644 index 047fabd6341e..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-property-values.src.ts +++ /dev/null @@ -1,7 +0,0 @@ -class Foo { - a = 2; - b = {}; - c = []; - d = ""; - e = new Array([{}, [], 2]); -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-protected-parameter-properties.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-protected-parameter-properties.src.ts deleted file mode 100644 index 1abd3446ff0d..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-protected-parameter-properties.src.ts +++ /dev/null @@ -1,6 +0,0 @@ -class Foo { - constructor(protected firstName: string, - protected readonly lastName: string, - protected age: number = 30, - protected readonly student: boolean = false) {} -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-public-parameter-properties.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-public-parameter-properties.src.ts deleted file mode 100644 index cf2ee5a5062e..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-public-parameter-properties.src.ts +++ /dev/null @@ -1,6 +0,0 @@ -class Foo { - constructor(public firstName: string, - public readonly lastName: string, - public age: number = 30, - public readonly student: boolean = false) {} -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-readonly-parameter-properties.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-readonly-parameter-properties.src.ts deleted file mode 100644 index 2525c6720f21..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-readonly-parameter-properties.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -class Foo { - constructor(readonly firstName: string, - readonly lastName: string = 'Smith') {} -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-readonly-property.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-readonly-property.src.ts deleted file mode 100644 index feb96572fa88..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-readonly-property.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class Foo { - public readonly foo = 'string'; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-static-parameter-properties.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-static-parameter-properties.src.ts deleted file mode 100644 index b11377560f8c..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-static-parameter-properties.src.ts +++ /dev/null @@ -1,7 +0,0 @@ -class Foo { - constructor(static a: string) { - - } -} - - diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-two-methods-computed-constructor.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-two-methods-computed-constructor.src.ts deleted file mode 100644 index 96a9937ece81..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-two-methods-computed-constructor.src.ts +++ /dev/null @@ -1,7 +0,0 @@ -class A { - "constructor"(): number { - } - - ["constructor"](): number { - } -}; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-type-parameter-default.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-type-parameter-default.src.ts deleted file mode 100644 index b416539347d4..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-type-parameter-default.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class Foo { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-type-parameter-underscore.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-type-parameter-underscore.src.ts deleted file mode 100644 index f68d76c805e6..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-type-parameter-underscore.src.ts +++ /dev/null @@ -1 +0,0 @@ -class A<__P> {} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/class-with-type-parameter.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/class-with-type-parameter.src.ts deleted file mode 100644 index 4c6ce17948cb..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/class-with-type-parameter.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class Foo { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/const-assertions.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/const-assertions.src.ts deleted file mode 100644 index d95b3cb4e6cd..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/const-assertions.src.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Type '10' -let x = 10 as const; - -// Type 'readonly [10, 20]' -let y = [10, 20] as const; - -// Type '{ readonly text: "hello" }' -let z = { text: "hello" } as const; - -// Type '10' -let x = 10; - -// Type 'readonly [10, 20]' -let y = [10, 20]; - -// Type '{ readonly text: "hello" }' -let z = { text: "hello" }; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/const-enum.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/const-enum.src.ts deleted file mode 100644 index 40f9491211d2..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/const-enum.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -const enum Foo { - foo = 1, - bar -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/declare-class-with-optional-method.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/declare-class-with-optional-method.src.ts deleted file mode 100644 index ecb4a4e11487..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/declare-class-with-optional-method.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare class Foo { - bar?(): any; -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/declare-function.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/declare-function.src.ts deleted file mode 100644 index 4f4d10709f56..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/declare-function.src.ts +++ /dev/null @@ -1 +0,0 @@ -declare function foo(bar: string): string; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/destructuring-assignment-nested.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/destructuring-assignment-nested.src.ts deleted file mode 100644 index 0c7c1bf3b430..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/destructuring-assignment-nested.src.ts +++ /dev/null @@ -1 +0,0 @@ -({ foo: { bar: { baz: [a, { foo: [x] = [3] } = { foo: [2]}] = [] } = {} } = { } } = { foo: { bar: { baz: [2, { foo: [3] }] } }}); diff --git a/packages/shared-fixtures/fixtures/typescript/basics/destructuring-assignment-object.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/destructuring-assignment-object.src.ts deleted file mode 100644 index 29aaf2c65ec4..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/destructuring-assignment-object.src.ts +++ /dev/null @@ -1 +0,0 @@ -({ foo = {} } = bar); diff --git a/packages/shared-fixtures/fixtures/typescript/basics/destructuring-assignment-property.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/destructuring-assignment-property.src.ts deleted file mode 100644 index 2958638434f9..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/destructuring-assignment-property.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -function Foo({ foo = [] } = bar) { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/destructuring-assignment.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/destructuring-assignment.src.ts deleted file mode 100644 index d29509f70afd..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/destructuring-assignment.src.ts +++ /dev/null @@ -1 +0,0 @@ -({ foo = [] } = bar); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/directive-in-module.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/directive-in-module.src.ts deleted file mode 100644 index 2cb68abd0251..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/directive-in-module.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -module foo { - "use strict"; - var a = 1; - "use strict"; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/directive-in-namespace.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/directive-in-namespace.src.ts deleted file mode 100644 index 80bc6c570cce..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/directive-in-namespace.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -namespace foo { - "use strict"; - var a = 1; - "use strict"; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/dynamic-import-with-import-assertions.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/dynamic-import-with-import-assertions.src.ts deleted file mode 100644 index 6f0405cedb66..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/dynamic-import-with-import-assertions.src.ts +++ /dev/null @@ -1 +0,0 @@ -import("foo", { assert: { type: "json" } }); diff --git a/packages/shared-fixtures/fixtures/typescript/basics/export-all-with-import-assertions.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/export-all-with-import-assertions.src.ts deleted file mode 100644 index 10367d6cc4b6..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/export-all-with-import-assertions.src.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "mod" assert { type: "json" }; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/export-as-namespace.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/export-as-namespace.src.ts deleted file mode 100644 index ff8bbadf397d..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/export-as-namespace.src.ts +++ /dev/null @@ -1 +0,0 @@ -export as namespace a; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/export-assignment.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/export-assignment.src.ts deleted file mode 100644 index 36a5d0e319d8..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/export-assignment.src.ts +++ /dev/null @@ -1 +0,0 @@ -export = foo; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/export-declare-const-named-enum.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/export-declare-const-named-enum.src.ts deleted file mode 100644 index 7bbafe14ec89..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/export-declare-const-named-enum.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare const enum Foo { - foo = 1, - bar -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/export-declare-named-enum.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/export-declare-named-enum.src.ts deleted file mode 100644 index 2864376d90b1..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/export-declare-named-enum.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare enum Foo { - foo = 1, - bar -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/export-default-class-with-generic.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/export-default-class-with-generic.src.ts deleted file mode 100644 index 8b0d9acbf807..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/export-default-class-with-generic.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default class { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/export-default-class-with-multiple-generics.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/export-default-class-with-multiple-generics.src.ts deleted file mode 100644 index 7eb59ca4e0c7..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/export-default-class-with-multiple-generics.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default class { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/export-default-interface.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/export-default-interface.src.ts deleted file mode 100644 index 8045e0c58faa..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/export-default-interface.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default interface T { - method1(): void; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/export-named-class-with-generic.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/export-named-class-with-generic.src.ts deleted file mode 100644 index ad37e87c5551..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/export-named-class-with-generic.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -export class Foo { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/export-named-class-with-multiple-generics.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/export-named-class-with-multiple-generics.src.ts deleted file mode 100644 index 9abd7bb1623e..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/export-named-class-with-multiple-generics.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -export class Foo { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/export-named-enum-computed-number.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/export-named-enum-computed-number.src.ts deleted file mode 100644 index 5a89330975c9..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/export-named-enum-computed-number.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -export enum Foo { - [1], -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/export-named-enum-computed-string.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/export-named-enum-computed-string.src.ts deleted file mode 100644 index 0cbfb7c4fcde..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/export-named-enum-computed-string.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -export enum Foo { - ['baz'], -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/export-named-enum-computed-var-ref.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/export-named-enum-computed-var-ref.src.ts deleted file mode 100644 index 4c02bc40a944..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/export-named-enum-computed-var-ref.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -export enum Foo { - [x], -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/export-named-enum.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/export-named-enum.src.ts deleted file mode 100644 index b651108672c9..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/export-named-enum.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -export enum Foo { - foo = 1, - bar -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/export-star-as-ns-from.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/export-star-as-ns-from.src.ts deleted file mode 100644 index ee2c09704ba0..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/export-star-as-ns-from.src.ts +++ /dev/null @@ -1 +0,0 @@ -export * as foo from 'bar'; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/export-type-as.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/export-type-as.src.ts deleted file mode 100644 index 136f3867f3d3..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/export-type-as.src.ts +++ /dev/null @@ -1 +0,0 @@ -export type { A as B }; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/export-type-from-as.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/export-type-from-as.src.ts deleted file mode 100644 index b7c0650b819c..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/export-type-from-as.src.ts +++ /dev/null @@ -1 +0,0 @@ -export type { B as C } from './a'; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/export-type-from.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/export-type-from.src.ts deleted file mode 100644 index c0316fd93e22..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/export-type-from.src.ts +++ /dev/null @@ -1 +0,0 @@ -export type { foo } from 'bar'; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/export-type-star-from.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/export-type-star-from.src.ts deleted file mode 100644 index 78d72bcf6b7c..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/export-type-star-from.src.ts +++ /dev/null @@ -1 +0,0 @@ -export type * from 'bar'; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/export-type.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/export-type.src.ts deleted file mode 100644 index e34ea63759dc..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/export-type.src.ts +++ /dev/null @@ -1 +0,0 @@ -export type { foo }; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/export-with-import-assertions.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/export-with-import-assertions.src.ts deleted file mode 100644 index 767b6e9e2f39..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/export-with-import-assertions.src.ts +++ /dev/null @@ -1 +0,0 @@ -export { foo } from "mod" assert { type: "json" }; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/function-anonymus-with-type-parameters.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/function-anonymus-with-type-parameters.src.ts deleted file mode 100644 index 44c7468b366d..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/function-anonymus-with-type-parameters.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -var obj = function (a: string) { - return a; -}; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/function-anynomus-with-return-type.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/function-anynomus-with-return-type.src.ts deleted file mode 100644 index a5d4544e0b12..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/function-anynomus-with-return-type.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -var obj = function (): void { -}; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/function-overloads.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/function-overloads.src.ts deleted file mode 100644 index 27fb059d8771..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/function-overloads.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -export function f(x: number): number; -export function f(x: string): string; -export function f(x: string | number): string | number { - return x; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/function-with-await.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/function-with-await.src.ts deleted file mode 100644 index e867dc45d20a..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/function-with-await.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -async function hope(future) { - await future; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/function-with-object-type-with-optional-properties.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/function-with-object-type-with-optional-properties.src.ts deleted file mode 100644 index 49837b4a1505..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/function-with-object-type-with-optional-properties.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -function foo({bar, baz}: {bar?: string, baz?}) { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/function-with-object-type-without-annotation.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/function-with-object-type-without-annotation.src.ts deleted file mode 100644 index bd3604de9f7f..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/function-with-object-type-without-annotation.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -function foo({bar, baz}: {bar: string, baz}) { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/function-with-type-parameters-that-have-comments.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/function-with-type-parameters-that-have-comments.src.ts deleted file mode 100644 index 1b328010c98b..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/function-with-type-parameters-that-have-comments.src.ts +++ /dev/null @@ -1 +0,0 @@ -function compare() {} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/function-with-type-parameters-with-constraint.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/function-with-type-parameters-with-constraint.src.ts deleted file mode 100644 index f3c4d2eaa906..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/function-with-type-parameters-with-constraint.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -function a(b: X): X { - return b; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/function-with-type-parameters.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/function-with-type-parameters.src.ts deleted file mode 100644 index cd0bdc5cc45b..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/function-with-type-parameters.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -function a(b: X): X { - return b; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/function-with-types-assignation.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/function-with-types-assignation.src.ts deleted file mode 100644 index b6d3f08924a0..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/function-with-types-assignation.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -function message(name:string, age:number = 100, ...args:Array):string { - return name; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/function-with-types.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/function-with-types.src.ts deleted file mode 100644 index 57eb3a476d15..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/function-with-types.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -function message(name:string):string { - return name; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/global-this.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/global-this.src.ts deleted file mode 100644 index a219fe271785..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/global-this.src.ts +++ /dev/null @@ -1,12 +0,0 @@ -// in a global file: - -var abc = 100; - -// Refers to 'abc' from above. -globalThis.abc = 200; - - -let answer = 42; - -// error! Property 'answer' does not exist on 'typeof globalThis'. -globalThis.answer = 333333; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/import-equal-declaration.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/import-equal-declaration.src.ts deleted file mode 100644 index 8cb59408d93f..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/import-equal-declaration.src.ts +++ /dev/null @@ -1 +0,0 @@ -import foo = require('bar'); diff --git a/packages/shared-fixtures/fixtures/typescript/basics/import-equal-type-declaration.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/import-equal-type-declaration.src.ts deleted file mode 100644 index fca40db5fc03..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/import-equal-type-declaration.src.ts +++ /dev/null @@ -1 +0,0 @@ -import type foo = require('bar'); diff --git a/packages/shared-fixtures/fixtures/typescript/basics/import-export-equal-declaration.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/import-export-equal-declaration.src.ts deleted file mode 100644 index 0b50a965912a..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/import-export-equal-declaration.src.ts +++ /dev/null @@ -1 +0,0 @@ -export import foo = require('bar'); diff --git a/packages/shared-fixtures/fixtures/typescript/basics/import-export-equal-type-declaration.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/import-export-equal-type-declaration.src.ts deleted file mode 100644 index 98798d0c07ae..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/import-export-equal-type-declaration.src.ts +++ /dev/null @@ -1 +0,0 @@ -export import type foo = require('bar'); diff --git a/packages/shared-fixtures/fixtures/typescript/basics/import-type-default.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/import-type-default.src.ts deleted file mode 100644 index 8ac6547e2ab3..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/import-type-default.src.ts +++ /dev/null @@ -1 +0,0 @@ -import type foo from 'bar'; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/import-type-empty.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/import-type-empty.src.ts deleted file mode 100644 index 58067383c448..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/import-type-empty.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -// this should be treated as a normal import statement -import type from './foo'; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/import-type-error.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/import-type-error.src.ts deleted file mode 100644 index 2a7dc99a0c8a..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/import-type-error.src.ts +++ /dev/null @@ -1 +0,0 @@ -import type foo, { bar } from 'bar'; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/import-type-named-as.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/import-type-named-as.src.ts deleted file mode 100644 index c7f5ad7e2aa8..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/import-type-named-as.src.ts +++ /dev/null @@ -1 +0,0 @@ -import type { foo as bar } from 'baz'; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/import-type-named.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/import-type-named.src.ts deleted file mode 100644 index 1b58057fb877..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/import-type-named.src.ts +++ /dev/null @@ -1 +0,0 @@ -import type { foo, bar } from 'baz'; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/import-type-star-as-ns.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/import-type-star-as-ns.src.ts deleted file mode 100644 index 68cd0a8a753f..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/import-type-star-as-ns.src.ts +++ /dev/null @@ -1 +0,0 @@ -import type * as foo from './bar'; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/import-with-import-assertions.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/import-with-import-assertions.src.ts deleted file mode 100644 index d3bd99b37ff3..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/import-with-import-assertions.src.ts +++ /dev/null @@ -1 +0,0 @@ -import foo from "mod" assert { type: "json" }; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/interface-extends-multiple.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/interface-extends-multiple.src.ts deleted file mode 100644 index e3b646613572..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/interface-extends-multiple.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface Foo extends Bar,Baz { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/interface-extends.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/interface-extends.src.ts deleted file mode 100644 index 1cc0e41709ea..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/interface-extends.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface Foo extends Bar { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/interface-type-parameters.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/interface-type-parameters.src.ts deleted file mode 100644 index d2c9ee32ff79..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/interface-type-parameters.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface Foo { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/interface-with-all-property-types.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/interface-with-all-property-types.src.ts deleted file mode 100644 index f0bb75ec3aa2..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/interface-with-all-property-types.src.ts +++ /dev/null @@ -1,14 +0,0 @@ -interface Foo { - baa: number; - bar?: number; - [bax]: string; - [baz]?: string; - [eee: number]: string; - doo(): void; - coo?(a, b, c): void; - [loo]?(a, b, c): void; - boo(a, b, c): void; - new (a, b?): string; - new (a, b?): string; -} - diff --git a/packages/shared-fixtures/fixtures/typescript/basics/interface-with-construct-signature-with-parameter-accessibility.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/interface-with-construct-signature-with-parameter-accessibility.src.ts deleted file mode 100644 index 4d52aa4cc16c..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/interface-with-construct-signature-with-parameter-accessibility.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface Test { - new (public x, private y); -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/interface-with-extends-member-expression.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/interface-with-extends-member-expression.src.ts deleted file mode 100644 index 4cceca6404c7..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/interface-with-extends-member-expression.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -interface foo extends bar.baz { -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/interface-with-extends-type-parameters.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/interface-with-extends-type-parameters.src.ts deleted file mode 100644 index 5387a76cc744..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/interface-with-extends-type-parameters.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface Foo extends Bar { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/interface-with-generic.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/interface-with-generic.src.ts deleted file mode 100644 index ec88864d2f07..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/interface-with-generic.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -interface Test { -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/interface-with-jsdoc.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/interface-with-jsdoc.src.ts deleted file mode 100644 index 698a393860f3..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/interface-with-jsdoc.src.ts +++ /dev/null @@ -1,7 +0,0 @@ -interface Test { - /** - * Comment Line 1 - * @baz bar - */ - foo(bar); -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/interface-with-method.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/interface-with-method.src.ts deleted file mode 100644 index 417153779dc4..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/interface-with-method.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -interface test { - h(bar: string): void; - g(bar: T): T; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/interface-with-optional-properties.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/interface-with-optional-properties.src.ts deleted file mode 100644 index 448d419a81cd..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/interface-with-optional-properties.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -interface test { - foo?; - bar?: string; - baz?(foo, bar?: string, baz?); -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/interface-without-type-annotation.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/interface-without-type-annotation.src.ts deleted file mode 100644 index 31f184e8e67a..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/interface-without-type-annotation.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface test { - foo; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/intrinsic-keyword.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/intrinsic-keyword.src.ts deleted file mode 100644 index 1467d1975a0d..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/intrinsic-keyword.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -type Uppercase = intrinsic; -type Lowercase = intrinsic; -type Capitalize = intrinsic; -type Uncapitalize = intrinsic; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/keyof-operator.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/keyof-operator.src.ts deleted file mode 100644 index d4cf1df7a5f0..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/keyof-operator.src.ts +++ /dev/null @@ -1 +0,0 @@ -type x = keyof foo; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/keyword-variables.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/keyword-variables.src.ts deleted file mode 100644 index ed934d7df080..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/keyword-variables.src.ts +++ /dev/null @@ -1,77 +0,0 @@ -{ - const abstract = 1; - const as = 1; - const asserts = 1; - const any = 1; - const async = 1; - const await = 1; - const boolean = 1; - const constructor = 1; - const declare = 1; - const get = 1; - const infer = 1; - const is = 1; - const keyof = 1; - const module = 1; - const namespace = 1; - const never = 1; - const readonly = 1; - const require = 1; - const number = 1; - const object = 1; - const set = 1; - const string = 1; - const symbol = 1; - const type = 1; - const undefined = 1; - const unique = 1; - const unknown = 1; - const from = 1; - const global = 1; - const bigint = 1; - const of = 1; -} - -import { - abstract, - as, - asserts, - any, - async, - await, - boolean, - constructor, - declare, - get, - infer, - is, - keyof, - module, - namespace, - never, - readonly, - require, - number, - object, - set, - string, - symbol, - type, - undefined, - unique, - unknown, - from, - global, - bigint, - of, -} from 'fake-module'; - -interface X {} -class C implements X { - static a() {} - private b() {} - public c() {} - protected *d() { - let x = yield; - } -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/nested-type-arguments.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/nested-type-arguments.src.ts deleted file mode 100644 index 1e9f54230af3..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/nested-type-arguments.src.ts +++ /dev/null @@ -1 +0,0 @@ -var nestedArray: Array>> \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/never-type-param.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/never-type-param.src.ts deleted file mode 100644 index b34ffbc2bf1d..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/never-type-param.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -var x: X; -Observable.empty(); diff --git a/packages/shared-fixtures/fixtures/typescript/basics/new-target-in-arrow-function-body.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/new-target-in-arrow-function-body.src.ts deleted file mode 100644 index d5368dbbe38d..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/new-target-in-arrow-function-body.src.ts +++ /dev/null @@ -1 +0,0 @@ -const b = () => new.target; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/non-null-assertion-operator.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/non-null-assertion-operator.src.ts deleted file mode 100644 index 18e73855fd2e..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/non-null-assertion-operator.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -function processEntity(e?: Entity) { - validateEntity(e); - let s = e!.name; -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/null-and-undefined-type-annotations.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/null-and-undefined-type-annotations.src.ts deleted file mode 100644 index 7d6b5821f389..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/null-and-undefined-type-annotations.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -let x: null; -let y: undefined; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/nullish-coalescing.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/nullish-coalescing.src.ts deleted file mode 100644 index 6ecd2db00aaa..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/nullish-coalescing.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -function processNullishCoalesce(s?: string) { - let len = (s ?? ''); -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/object-with-escaped-properties.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/object-with-escaped-properties.src.ts deleted file mode 100644 index 430a8bad251d..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/object-with-escaped-properties.src.ts +++ /dev/null @@ -1,7 +0,0 @@ -({ '__': null }); - -({ '__'() {} }); - -({ ['__']: null }); - -class X { '__' = null } diff --git a/packages/shared-fixtures/fixtures/typescript/basics/object-with-typed-methods.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/object-with-typed-methods.src.ts deleted file mode 100644 index 10549508c43e..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/object-with-typed-methods.src.ts +++ /dev/null @@ -1,13 +0,0 @@ -const foo = { - "constructor"(): number { - return 1 - }, - foo(): number { - return 1 - }, - get a(): number { - return 1 - }, - set a(x: number): number { - } -}; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-call-with-non-null-assertion.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-call-with-non-null-assertion.src.ts deleted file mode 100644 index c86387595e47..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-call-with-non-null-assertion.src.ts +++ /dev/null @@ -1,8 +0,0 @@ -function processOptional(one?: any) { - one?.two!(); - one?.two!.three(); - (one?.two)!(); - (one?.two)!.three(); - (one?.two!)(); - (one?.two!).three(); -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-call-with-parens.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-call-with-parens.src.ts deleted file mode 100644 index 4024fffa9d58..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-call-with-parens.src.ts +++ /dev/null @@ -1,13 +0,0 @@ -function processOptionalCallParens(one?: any) { - (one?.fn()); - (one?.two).fn(); - (one.two?.fn()); - (one.two?.three).fn(); - (one.two?.three?.fn()); - - (one?.()); - (one?.())(); - (one?.())?.(); - - (one?.()).two; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-call.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-call.src.ts deleted file mode 100644 index c411490d129b..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-call.src.ts +++ /dev/null @@ -1,13 +0,0 @@ -function processOptionalCall(one?: any) { - one?.fn(); - one?.two.fn(); - one.two?.fn(); - one.two?.three.fn(); - one.two?.three?.fn(); - - one?.(); - one?.()(); - one?.()?.(); - - one?.().two; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-element-access-with-non-null-assertion.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-element-access-with-non-null-assertion.src.ts deleted file mode 100644 index ee4e7fc8451f..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-element-access-with-non-null-assertion.src.ts +++ /dev/null @@ -1,8 +0,0 @@ -function processOptional(one?: any) { - one?.['two']!.three; - (one?.['two'])!.three; - (one?.['two']!).three; - one?.two!['three']; - (one?.two)!['three']; - (one?.two!)['three']; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-element-access-with-parens.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-element-access-with-parens.src.ts deleted file mode 100644 index a4a30b2d5df6..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-element-access-with-parens.src.ts +++ /dev/null @@ -1,8 +0,0 @@ -function processOptionalElementParens(one?: any) { - (one?.[2]); - (one?.[2])[3]; - (one[2]?.[3]); - (one[2]?.[3])[4]; - (one[2]?.[3]?.[4]); - (one[2]?.[3]?.[4])[5]; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-element-access.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-element-access.src.ts deleted file mode 100644 index 6a3ba4500d17..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-element-access.src.ts +++ /dev/null @@ -1,8 +0,0 @@ -function processOptionalElement(one?: any) { - one?.[2]; - one?.[2][3]; - one[2]?.[3]; - one[2]?.[3]; - one[2]?.[3][4]; - one[2]?.[3]?.[4]; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-with-non-null-assertion.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-with-non-null-assertion.src.ts deleted file mode 100644 index a7a94dcaa2bf..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-with-non-null-assertion.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -function processOptional(one?: any) { - one?.two!.three; - (one?.two)!.three; - (one?.two!).three; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-with-parens.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-with-parens.src.ts deleted file mode 100644 index 69c9e8efee51..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain-with-parens.src.ts +++ /dev/null @@ -1,8 +0,0 @@ -function processOptionalParens(one?: any) { - (one?.two); - (one?.two).three; - (one.two?.three); - (one.two?.three).four; - (one.two?.three?.four); - (one.two?.three?.four).five; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/optional-chain.src.ts deleted file mode 100644 index 6fbf4219de01..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/optional-chain.src.ts +++ /dev/null @@ -1,7 +0,0 @@ -function processOptional(one?: any) { - one?.two; - one?.two.three; - one.two?.three; - one.two?.three.four; - one.two?.three?.four; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/parenthesized-use-strict.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/parenthesized-use-strict.src.ts deleted file mode 100644 index b0dd2af840cf..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/parenthesized-use-strict.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -// this should not be classed as a directive -("use strict"); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/private-fields-in-in.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/private-fields-in-in.src.ts deleted file mode 100644 index b75db0be2228..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/private-fields-in-in.src.ts +++ /dev/null @@ -1,6 +0,0 @@ -class Foo { - #prop1; - method(arg) { - return #prop1 in arg; - } -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/readonly-arrays.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/readonly-arrays.src.ts deleted file mode 100644 index 83f7deafe474..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/readonly-arrays.src.ts +++ /dev/null @@ -1,9 +0,0 @@ -function foo(arr: ReadonlyArray) { - arr.slice(); // okay - arr.push("hello!"); // error! -} - -function foo(arr: readonly string[]) { - arr.slice(); // okay - arr.push("hello!"); // error! -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/readonly-tuples.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/readonly-tuples.src.ts deleted file mode 100644 index 7943731f1bad..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/readonly-tuples.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -function foo(pair: readonly [string, string]) { - console.log(pair[0]); // okay - pair[1] = "hello!"; // error -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/short-circuiting-assignment-and-and.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/short-circuiting-assignment-and-and.src.ts deleted file mode 100644 index 53c87792bb2f..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/short-circuiting-assignment-and-and.src.ts +++ /dev/null @@ -1 +0,0 @@ -a ||= b; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/short-circuiting-assignment-or-or.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/short-circuiting-assignment-or-or.src.ts deleted file mode 100644 index 2747ba2b3e19..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/short-circuiting-assignment-or-or.src.ts +++ /dev/null @@ -1 +0,0 @@ -a &&= b; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/short-circuiting-assignment-question-question.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/short-circuiting-assignment-question-question.src.ts deleted file mode 100644 index eddf7da5264b..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/short-circuiting-assignment-question-question.src.ts +++ /dev/null @@ -1 +0,0 @@ -a ??= b; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/symbol-type-param.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/symbol-type-param.src.ts deleted file mode 100644 index b5b19ced740e..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/symbol-type-param.src.ts +++ /dev/null @@ -1 +0,0 @@ -function test(abc: Map) {} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-alias-declaration-export-function-type.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-alias-declaration-export-function-type.src.ts deleted file mode 100644 index 1948b43ead29..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-alias-declaration-export-function-type.src.ts +++ /dev/null @@ -1 +0,0 @@ -export type TestCallback = (a: number) => void; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-alias-declaration-export-object-type.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-alias-declaration-export-object-type.src.ts deleted file mode 100644 index a7999bbcaa15..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-alias-declaration-export-object-type.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -export type TestClassProps = { - count: number -}; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-alias-declaration-export.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-alias-declaration-export.src.ts deleted file mode 100644 index d166857d8a5e..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-alias-declaration-export.src.ts +++ /dev/null @@ -1 +0,0 @@ -export type TestAlias = string | number; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-alias-declaration-with-constrained-type-parameter.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-alias-declaration-with-constrained-type-parameter.src.ts deleted file mode 100644 index 0c5e89163a40..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-alias-declaration-with-constrained-type-parameter.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Result = Success | Failure \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-alias-declaration.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-alias-declaration.src.ts deleted file mode 100644 index c2067d850774..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-alias-declaration.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Result = Success | Failure \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-alias-object-without-annotation.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-alias-object-without-annotation.src.ts deleted file mode 100644 index 5c542c940ace..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-alias-object-without-annotation.src.ts +++ /dev/null @@ -1 +0,0 @@ -type foo = {bar: string, baz}; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-arrow-function.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-arrow-function.src.ts deleted file mode 100644 index 584155016de8..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-arrow-function.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -const assertString = (x: any): asserts x => { - return -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-function.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-function.src.ts deleted file mode 100644 index 28727047a6d5..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-function.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -function assertsString(x: any): asserts x { - return -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-interface.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-interface.src.ts deleted file mode 100644 index 22b280ec535d..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-interface.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface AssertFoo { - isString(node: any): asserts node; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-method.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-method.src.ts deleted file mode 100644 index 5d2ab8745a1b..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-in-method.src.ts +++ /dev/null @@ -1,8 +0,0 @@ -class AssertsFoo { - isBar(): asserts this { - return; - } - isBaz = (): asserts this => { - return; - } -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-arrow-function.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-arrow-function.src.ts deleted file mode 100644 index 586fda06dfda..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-arrow-function.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -const assertString = (x: any): asserts x is string => { - return -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-function.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-function.src.ts deleted file mode 100644 index 027a4c1197dd..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-function.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -function assertsStringGuard(x: any): asserts x is string { - return -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-interface.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-interface.src.ts deleted file mode 100644 index fe226cfc388a..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-interface.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface AssertFoo { - isString(node: any): asserts node is string; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-method.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-method.src.ts deleted file mode 100644 index 146b4ce1484b..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-assertion-with-guard-in-method.src.ts +++ /dev/null @@ -1,8 +0,0 @@ -class AssertsFoo { - isBar(): asserts this is string { - return; - } - isBaz = (): asserts this is string => { - return; - } -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-guard-in-arrow-function.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-guard-in-arrow-function.src.ts deleted file mode 100644 index 7157427597bd..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-guard-in-arrow-function.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -const isString = (x: any): x is string => { - return typeof x === 'string' -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-guard-in-function.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-guard-in-function.src.ts deleted file mode 100644 index cd0aad9a869c..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-guard-in-function.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -function isString(x: any): x is string { - return typeof x === 'string' -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-guard-in-interface.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-guard-in-interface.src.ts deleted file mode 100644 index d43231224568..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-guard-in-interface.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface Foo { - isString(node: any): node is string; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-guard-in-method.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-guard-in-method.src.ts deleted file mode 100644 index 843f1f58b63f..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-guard-in-method.src.ts +++ /dev/null @@ -1,8 +0,0 @@ -class Foo { - isBar(): this is string { - return this instanceof Foo; - } - isBaz = (): this is string => { - return this instanceof Foo; - } -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-import-type-with-type-parameters-in-type-reference.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-import-type-with-type-parameters-in-type-reference.src.ts deleted file mode 100644 index 2c8acc12d369..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-import-type-with-type-parameters-in-type-reference.src.ts +++ /dev/null @@ -1 +0,0 @@ -type X = A>; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-import-type.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-import-type.src.ts deleted file mode 100644 index 00e3ba6afc1e..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-import-type.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -type A = typeof import('A'); -type B = import("B").X; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-only-export-specifiers.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-only-export-specifiers.src.ts deleted file mode 100644 index 6aa69d546267..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-only-export-specifiers.src.ts +++ /dev/null @@ -1 +0,0 @@ -export { type A, type B } from "mod"; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-only-import-specifiers.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-only-import-specifiers.src.ts deleted file mode 100644 index 0af11f401bc2..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-only-import-specifiers.src.ts +++ /dev/null @@ -1 +0,0 @@ -import { type A, type B } from "mod"; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-parameters-comments-heritage.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-parameters-comments-heritage.src.ts deleted file mode 100644 index 986f4826089f..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-parameters-comments-heritage.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -class foo < /* aaa */ A /* bbb */> extends bar < /* aaa */ A /* bbb */> {} -class foo2 < /* aaa */ A /* bbb */ = 2 /* bbb */> extends bar < /* aaa */ A /* bbb */> {} -interface bar < /* aaa */ A /* bbb */> extends bar2 < /* aaa */ A /* bbb */> {} -interface bar2 < /* aaa */ A /* bbb */ = 2 /* bbb */> extends bar < /* aaa */ A /* bbb */> {} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-parameters-comments.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-parameters-comments.src.ts deleted file mode 100644 index b79b05bda402..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-parameters-comments.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -foo< /* comment 1 */ A /* comment 2 */ >(); -function bar< /* aaa */ A /* bbb */ >() { } -function baz< /* aaa */ A /* bbb */ = Foo >() { } diff --git a/packages/shared-fixtures/fixtures/typescript/basics/type-reference-comments.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/type-reference-comments.src.ts deleted file mode 100644 index 3ca1f8dbb282..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/type-reference-comments.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class AudioBufferList { - mBuffers: interop.Reference; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-bigint.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-bigint.src.ts deleted file mode 100644 index c02b862420db..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-bigint.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Foo = bigint diff --git a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-boolean.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-boolean.src.ts deleted file mode 100644 index 3d441e390935..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-boolean.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Foo = boolean diff --git a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-false.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-false.src.ts deleted file mode 100644 index b9c63609f683..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-false.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Foo = false diff --git a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-never.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-never.src.ts deleted file mode 100644 index 1f2b3902148b..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-never.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Foo = never diff --git a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-null.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-null.src.ts deleted file mode 100644 index da97119b68bf..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-null.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Foo = null diff --git a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-number.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-number.src.ts deleted file mode 100644 index 9133270f2d83..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-number.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Foo = number diff --git a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-object.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-object.src.ts deleted file mode 100644 index 0a689a9cb5fd..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-object.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Foo = object diff --git a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-string.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-string.src.ts deleted file mode 100644 index d508231294cb..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-string.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Foo = string diff --git a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-symbol.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-symbol.src.ts deleted file mode 100644 index a5d3de140886..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-symbol.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Foo = symbol diff --git a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-true.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-true.src.ts deleted file mode 100644 index 690616093931..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-true.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Foo = true diff --git a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-undefined.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-undefined.src.ts deleted file mode 100644 index 588094c2dbb2..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-undefined.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Foo = undefined diff --git a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-unknown.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-unknown.src.ts deleted file mode 100644 index cbdeb162bef9..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-unknown.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Foo = unknown diff --git a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-void.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-void.src.ts deleted file mode 100644 index d62ee2c26edd..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/typed-keyword-void.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Foo = void diff --git a/packages/shared-fixtures/fixtures/typescript/basics/typed-method-signature.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/typed-method-signature.src.ts deleted file mode 100644 index 072d0063deb7..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/typed-method-signature.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -type Foo = { - h(bar: string): void; - g(bar: T): T; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/typed-this.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/typed-this.src.ts deleted file mode 100644 index 398775778522..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/typed-this.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface UIElement { - addClickListener(onclick: (this: void, e: Event) => void): void; -} diff --git a/packages/shared-fixtures/fixtures/typescript/basics/union-intersection.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/union-intersection.src.ts deleted file mode 100644 index cd1a7a71a81a..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/union-intersection.src.ts +++ /dev/null @@ -1,9 +0,0 @@ -let union: number | null | undefined; -let intersection: number & string; -let precedence1: number | string & boolean; -let precedence2: number & string | boolean; - -type unionLeading = | number | string; -type intersectionLeading = | number & string; -type unionLeadingSingle = | number; -type intersectionLeadingSingle = & number; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/unique-symbol.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/unique-symbol.src.ts deleted file mode 100644 index 6d1be9873bdb..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/unique-symbol.src.ts +++ /dev/null @@ -1 +0,0 @@ -type A = unique symbol; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/unknown-type-annotation.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/unknown-type-annotation.src.ts deleted file mode 100644 index 5f4c1a3ac1d4..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/unknown-type-annotation.src.ts +++ /dev/null @@ -1 +0,0 @@ -let foo: unknown; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/var-with-definite-assignment.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/var-with-definite-assignment.src.ts deleted file mode 100644 index 60906317fcad..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/var-with-definite-assignment.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -const x!: string; -var y!: number; -let z!: object; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/var-with-dotted-type.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/var-with-dotted-type.src.ts deleted file mode 100644 index ff0a1885271c..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/var-with-dotted-type.src.ts +++ /dev/null @@ -1 +0,0 @@ -var foo: A.B.C; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/var-with-type.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/var-with-type.src.ts deleted file mode 100644 index 547ca4bd9180..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/var-with-type.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -var name:string = "Nicholas"; -var foo: string = "Bar"; diff --git a/packages/shared-fixtures/fixtures/typescript/basics/variable-declaration-type-annotation-spacing.src.ts b/packages/shared-fixtures/fixtures/typescript/basics/variable-declaration-type-annotation-spacing.src.ts deleted file mode 100644 index 03b1ebddffb6..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/basics/variable-declaration-type-annotation-spacing.src.ts +++ /dev/null @@ -1 +0,0 @@ -let x : string; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/declare/abstract-class.src.ts b/packages/shared-fixtures/fixtures/typescript/declare/abstract-class.src.ts deleted file mode 100644 index 4a9cfd07d2e7..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/declare/abstract-class.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare abstract class Foo { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/declare/class.src.ts b/packages/shared-fixtures/fixtures/typescript/declare/class.src.ts deleted file mode 100644 index 2e769f6c9b78..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/declare/class.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare class Foo { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/declare/enum.src.ts b/packages/shared-fixtures/fixtures/typescript/declare/enum.src.ts deleted file mode 100644 index 0fde77274fd1..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/declare/enum.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare enum Foo { - Bar, - Baz -} diff --git a/packages/shared-fixtures/fixtures/typescript/declare/function.src.ts b/packages/shared-fixtures/fixtures/typescript/declare/function.src.ts deleted file mode 100644 index 44407a370ab2..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/declare/function.src.ts +++ /dev/null @@ -1 +0,0 @@ -declare function foo(): void diff --git a/packages/shared-fixtures/fixtures/typescript/declare/interface.src.ts b/packages/shared-fixtures/fixtures/typescript/declare/interface.src.ts deleted file mode 100644 index f9afeb14be49..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/declare/interface.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare interface Foo { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/declare/module.src.ts b/packages/shared-fixtures/fixtures/typescript/declare/module.src.ts deleted file mode 100644 index 13fa9986520a..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/declare/module.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare module Foo { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/declare/namespace.src.ts b/packages/shared-fixtures/fixtures/typescript/declare/namespace.src.ts deleted file mode 100644 index 8caa74ce5dc0..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/declare/namespace.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare namespace Foo { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/declare/type-alias.src.ts b/packages/shared-fixtures/fixtures/typescript/declare/type-alias.src.ts deleted file mode 100644 index d8346d016684..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/declare/type-alias.src.ts +++ /dev/null @@ -1 +0,0 @@ -declare type Foo = string diff --git a/packages/shared-fixtures/fixtures/typescript/declare/variable.src.ts b/packages/shared-fixtures/fixtures/typescript/declare/variable.src.ts deleted file mode 100644 index cdb68e32b1fe..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/declare/variable.src.ts +++ /dev/null @@ -1 +0,0 @@ -declare var foo: any; diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-instance-member.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-instance-member.src.ts deleted file mode 100644 index 24f2b53691d1..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-instance-member.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -class Point { - @configurable(false) - get x() { return this._x; } -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-static-member.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-static-member.src.ts deleted file mode 100644 index f48e71052ebe..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-static-member.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -class Other { - @foo({ baz: true }) - static get bar() { return this._bar; } -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-instance-member.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-instance-member.src.ts deleted file mode 100644 index 4cea72889f61..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-instance-member.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -class P { - @hidden - get z() { return this._z; } -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-static-member.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-static-member.src.ts deleted file mode 100644 index f9b2964c0f70..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/accessor-decorators/accessor-decorator-static-member.src.ts +++ /dev/null @@ -1,6 +0,0 @@ -class User { - @adminonly - static set y(a) { - this._y = a; - } -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/class-decorator-factory.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/class-decorator-factory.src.ts deleted file mode 100644 index 873263376e30..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/class-decorator-factory.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -@Component({ - selector: 'foo', -}) -class FooComponent {} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/class-decorator.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/class-decorator.src.ts deleted file mode 100644 index a72a8ff5dcb1..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/class-decorator.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -@sealed -class Qux {} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/class-parameter-property.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/class-parameter-property.src.ts deleted file mode 100644 index d8503e061cc1..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/class-parameter-property.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class A { - constructor(@d private x: number) {} -} diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/export-default-class-decorator.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/export-default-class-decorator.src.ts deleted file mode 100644 index 92c9258b9e04..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/export-default-class-decorator.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -@sealed -export default class Qux {} diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/export-named-class-decorator.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/export-named-class-decorator.src.ts deleted file mode 100644 index 53ef2e4d5685..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/export-named-class-decorator.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -@sealed -export class Qux {} diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/method-decorators/method-decorator-factory-instance-member.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/method-decorators/method-decorator-factory-instance-member.src.ts deleted file mode 100644 index 12898791abbd..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/method-decorators/method-decorator-factory-instance-member.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -class B { - @onlyRead(false) - instanceMethod() {} -} diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/method-decorators/method-decorator-factory-static-member.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/method-decorators/method-decorator-factory-static-member.src.ts deleted file mode 100644 index 735541ffeb71..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/method-decorators/method-decorator-factory-static-member.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -class C { - @Foo(false) - static staticMethod() {} -} diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/method-decorators/method-decorator-instance-member.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/method-decorators/method-decorator-instance-member.src.ts deleted file mode 100644 index a0e5e11a6190..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/method-decorators/method-decorator-instance-member.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -class A { - @onlyRead - instanceMethod() {} -} diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/method-decorators/method-decorator-static-member.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/method-decorators/method-decorator-static-member.src.ts deleted file mode 100644 index 59fc47fe0825..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/method-decorators/method-decorator-static-member.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -class D { - @Foo - static staticMethod() {} -} diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-array-pattern-decorator.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-array-pattern-decorator.src.ts deleted file mode 100644 index 81dfc005fc92..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-array-pattern-decorator.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class Foo { - bar(@special(true) [ bar ]: any) {} -} diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-constructor.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-constructor.src.ts deleted file mode 100644 index 066334bf8743..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-constructor.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -class Service { - constructor(@Inject(APP_CONFIG) config: AppConfig) { - this.title = config.title; - } -} diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-instance-member.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-instance-member.src.ts deleted file mode 100644 index 9b8c50c51fe5..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-instance-member.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class Foo { - bar(@special(true) baz: number) {} -} diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-static-member.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-static-member.src.ts deleted file mode 100644 index 26013fa26279..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-static-member.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class StaticFoo { - static bar(@special(true) baz: number) {} -} diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-instance-member.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-instance-member.src.ts deleted file mode 100644 index fa5f4902a309..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-instance-member.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -class Greeter { - greet(@required name: string) { - return "Hello " + name + "!"; - } -} diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-static-member.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-static-member.src.ts deleted file mode 100644 index ad512a2c2640..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-decorator-static-member.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -class StaticGreeter { - static greet(@required name: string) { - return "Hello " + name + "!"; - } -} diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-object-pattern-decorator.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-object-pattern-decorator.src.ts deleted file mode 100644 index dc9133b3deaf..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-object-pattern-decorator.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class Foo { - bar(@special(true) { bar }: any) {} -} diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-rest-element-decorator.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-rest-element-decorator.src.ts deleted file mode 100644 index 35b2ac60bc94..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/parameter-decorators/parameter-rest-element-decorator.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class Foo { - bar(@special(true) ...foo: any) {} -} diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/property-decorators/property-decorator-factory-instance-member.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/property-decorators/property-decorator-factory-instance-member.src.ts deleted file mode 100644 index 4e618d12dc37..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/property-decorators/property-decorator-factory-instance-member.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -class SomeComponent { - @Input() data; - @Output() - click = new EventEmitter(); -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/property-decorators/property-decorator-factory-static-member.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/property-decorators/property-decorator-factory-static-member.src.ts deleted file mode 100644 index c49b797bf305..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/property-decorators/property-decorator-factory-static-member.src.ts +++ /dev/null @@ -1,6 +0,0 @@ -class A { - @configurable(true) static prop1; - - @configurable(false) - static prop2; -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/property-decorators/property-decorator-instance-member.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/property-decorators/property-decorator-instance-member.src.ts deleted file mode 100644 index 8b13a2f4c09b..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/property-decorators/property-decorator-instance-member.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -class B { - @foo x; - @bar - y; -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/property-decorators/property-decorator-static-member.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/property-decorators/property-decorator-static-member.src.ts deleted file mode 100644 index df529500e508..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/decorators/property-decorators/property-decorator-static-member.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -class C { - @baz static a; - @qux - static b; -} diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/class-empty-extends-implements.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/class-empty-extends-implements.src.ts deleted file mode 100644 index 0d08522dbc07..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/class-empty-extends-implements.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class Foo extends implements Bar { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/class-empty-extends.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/class-empty-extends.src.ts deleted file mode 100644 index 47a27e783f28..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/class-empty-extends.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class Foo extends { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/class-extends-empty-implements.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/class-extends-empty-implements.src.ts deleted file mode 100644 index 42b4c0565f4b..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/class-extends-empty-implements.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class Foo extends Bar implements { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/class-multiple-implements.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/class-multiple-implements.src.ts deleted file mode 100644 index 4ecd2eee4cae..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/class-multiple-implements.src.ts +++ /dev/null @@ -1 +0,0 @@ -class a implements b implements c {} diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/decorator-on-enum-declaration.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/decorator-on-enum-declaration.src.ts deleted file mode 100644 index c5d3bb05ffc8..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/decorator-on-enum-declaration.src.ts +++ /dev/null @@ -1 +0,0 @@ -@dec enum E {} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/decorator-on-function.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/decorator-on-function.src.ts deleted file mode 100644 index 72ed3035b15f..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/decorator-on-function.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -@dec -function b(){} diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/decorator-on-interface-declaration.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/decorator-on-interface-declaration.src.ts deleted file mode 100644 index adb33f8e53bd..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/decorator-on-interface-declaration.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -@deco() -interface M {} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/decorator-on-variable.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/decorator-on-variable.src.ts deleted file mode 100644 index 700dea545cce..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/decorator-on-variable.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -@deco() -const a = 1 diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-arguments-in-call-expression.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-arguments-in-call-expression.src.ts deleted file mode 100644 index 8370eae3584f..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-arguments-in-call-expression.src.ts +++ /dev/null @@ -1 +0,0 @@ -foo<>(); diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-arguments-in-new-expression.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-arguments-in-new-expression.src.ts deleted file mode 100644 index 58900f001ee1..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-arguments-in-new-expression.src.ts +++ /dev/null @@ -1 +0,0 @@ -new Foo<>() diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-arguments.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-arguments.src.ts deleted file mode 100644 index d0a415f25ae5..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-arguments.src.ts +++ /dev/null @@ -1 +0,0 @@ -const foo: Foo<> \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters-in-arrow-function.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters-in-arrow-function.src.ts deleted file mode 100644 index 1dbabedb798c..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters-in-arrow-function.src.ts +++ /dev/null @@ -1 +0,0 @@ -function f1<>() {} diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters-in-constructor.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters-in-constructor.src.ts deleted file mode 100644 index 1c24174dfb9d..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters-in-constructor.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class foo { - constructor<>() {} -} diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters-in-function-expression.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters-in-function-expression.src.ts deleted file mode 100644 index 97b3b1bd5b97..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters-in-function-expression.src.ts +++ /dev/null @@ -1 +0,0 @@ -const foo = function<>() {} diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters-in-method-signature.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters-in-method-signature.src.ts deleted file mode 100644 index 266c7827325d..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters-in-method-signature.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface foo { - test<>(); -} diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters-in-method.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters-in-method.src.ts deleted file mode 100644 index 5544096856d7..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters-in-method.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -class foo { - test<>() {} -} diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters.src.ts deleted file mode 100644 index 1dbabedb798c..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/empty-type-parameters.src.ts +++ /dev/null @@ -1 +0,0 @@ -function f1<>() {} diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/enum-with-keywords.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/enum-with-keywords.src.ts deleted file mode 100644 index a568bf4fcc43..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/enum-with-keywords.src.ts +++ /dev/null @@ -1 +0,0 @@ -export private public protected static readonly abstract async enum X {} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/index-signature-parameters.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/index-signature-parameters.src.ts deleted file mode 100644 index f7922694469b..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/index-signature-parameters.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -type foo = { - [a: string, b: string]: string; -} diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-empty-extends.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-empty-extends.src.ts deleted file mode 100644 index dae1275e6b11..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-empty-extends.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface Foo extends { - -} diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-implements.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-implements.src.ts deleted file mode 100644 index d3b8c7228e8c..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-implements.src.ts +++ /dev/null @@ -1 +0,0 @@ -interface d implements e {} diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-index-signature-export.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-index-signature-export.src.ts deleted file mode 100644 index 32d597417f1b..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-index-signature-export.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -interface Foo { - export [baz: string]: string; -} - diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-index-signature-private.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-index-signature-private.src.ts deleted file mode 100644 index fca05ad495f4..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-index-signature-private.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -interface Foo { - private [baz: string]: string; -} - diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-index-signature-protected.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-index-signature-protected.src.ts deleted file mode 100644 index 4ba7918d570f..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-index-signature-protected.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -interface Foo { - protected [baz: string]: string; -} - diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-index-signature-public.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-index-signature-public.src.ts deleted file mode 100644 index 963b1d954338..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-index-signature-public.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -interface Foo { - public [baz: string]: string; -} - diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-index-signature-static.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-index-signature-static.src.ts deleted file mode 100644 index 729350f096d2..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-index-signature-static.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -interface Foo { - static [baz: string]: string; -} - diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-export.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-export.src.ts deleted file mode 100644 index 45e722d0866e..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-export.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -interface Foo { - export g(bar: string): void; -} - diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-private.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-private.src.ts deleted file mode 100644 index af4488e5925f..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-private.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -interface Foo { - private g(bar: string): void; -} - diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-protected.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-protected.src.ts deleted file mode 100644 index 2b7bb108273d..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-protected.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -interface Foo { - protected g(bar: string): void; -} - diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-public.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-public.src.ts deleted file mode 100644 index 0f9914f2dc36..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-public.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -interface Foo { - public g(bar: string): void; -} - diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-readonly.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-readonly.src.ts deleted file mode 100644 index ef4bf50ebae2..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-readonly.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface Foo { - readonly g(bar: string): void; -} diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-static.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-static.src.ts deleted file mode 100644 index 84b3f3f39506..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-method-static.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -interface Foo { - static g(bar: string): void; -} - diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-multiple-extends.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-multiple-extends.src.ts deleted file mode 100644 index 343867f302e1..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-multiple-extends.src.ts +++ /dev/null @@ -1 +0,0 @@ -interface foo extends bar extends baz {} diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-export.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-export.src.ts deleted file mode 100644 index c24282e75d7d..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-export.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -interface Foo { - export a: string; -} - diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-private.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-private.src.ts deleted file mode 100644 index 33f00924378f..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-private.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -interface Foo { - private b: string; -} - diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-protected.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-protected.src.ts deleted file mode 100644 index 20f839a3279b..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-protected.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -interface Foo { - protected a: string; -} - diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-public.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-public.src.ts deleted file mode 100644 index f9fb03e73ab8..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-public.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -interface Foo { - public a: string; -} - diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-static.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-static.src.ts deleted file mode 100644 index ae41b9b40d7b..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-static.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -interface Foo { - static a: string; -} - diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-with-default-value.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-with-default-value.src.ts deleted file mode 100644 index 4a90a54a78a1..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-property-with-default-value.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface Foo { - bar: string = 'a'; -} diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-with-no-body.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-with-no-body.src.ts deleted file mode 100644 index 3f943170b49e..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-with-no-body.src.ts +++ /dev/null @@ -1 +0,0 @@ -interface Foo diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-with-optional-index-signature.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-with-optional-index-signature.src.ts deleted file mode 100644 index 47a395b74ccb..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/interface-with-optional-index-signature.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface Foo { - [fff?: number]: string; -} diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/object-assertion-not-allowed.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/object-assertion-not-allowed.src.ts deleted file mode 100644 index 349dc846fc53..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/object-assertion-not-allowed.src.ts +++ /dev/null @@ -1 +0,0 @@ -({a!} = {}) diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/object-optional-not-allowed.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/object-optional-not-allowed.src.ts deleted file mode 100644 index 197e0b6fc46e..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/object-optional-not-allowed.src.ts +++ /dev/null @@ -1 +0,0 @@ -({a?} = {}) diff --git a/packages/shared-fixtures/fixtures/typescript/errorRecovery/solo-const.src.ts b/packages/shared-fixtures/fixtures/typescript/errorRecovery/solo-const.src.ts deleted file mode 100644 index 8baacf4ea544..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/errorRecovery/solo-const.src.ts +++ /dev/null @@ -1 +0,0 @@ -const \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/expressions/call-expression-type-arguments.src.ts b/packages/shared-fixtures/fixtures/typescript/expressions/call-expression-type-arguments.src.ts deleted file mode 100644 index 2421c8b7a8c2..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/expressions/call-expression-type-arguments.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -foo(); -foo(); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/expressions/instantiation-expression.src.ts b/packages/shared-fixtures/fixtures/typescript/expressions/instantiation-expression.src.ts deleted file mode 100644 index 6f756d66ee63..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/expressions/instantiation-expression.src.ts +++ /dev/null @@ -1,7 +0,0 @@ -a; - -(a); -(a)(); -(a)?.(); -(a?.b)(); -new (a)(); diff --git a/packages/shared-fixtures/fixtures/typescript/expressions/new-expression-type-arguments.src.ts b/packages/shared-fixtures/fixtures/typescript/expressions/new-expression-type-arguments.src.ts deleted file mode 100644 index 7e38b6d3d662..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/expressions/new-expression-type-arguments.src.ts +++ /dev/null @@ -1 +0,0 @@ -const a = new A(); \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/expressions/optional-call-expression-type-arguments.src.ts b/packages/shared-fixtures/fixtures/typescript/expressions/optional-call-expression-type-arguments.src.ts deleted file mode 100644 index 5cb45f68a4c9..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/expressions/optional-call-expression-type-arguments.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -foo?.bar(); -foo?.bar(); diff --git a/packages/shared-fixtures/fixtures/typescript/expressions/tagged-template-expression-type-arguments.src.ts b/packages/shared-fixtures/fixtures/typescript/expressions/tagged-template-expression-type-arguments.src.ts deleted file mode 100644 index aff1105de138..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/expressions/tagged-template-expression-type-arguments.src.ts +++ /dev/null @@ -1 +0,0 @@ -foo`baz`; \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/ambient-module-declaration-with-import.src.ts b/packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/ambient-module-declaration-with-import.src.ts deleted file mode 100644 index 9b551c215336..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/ambient-module-declaration-with-import.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare module "i-use-things" { - import fs from 'fs'; -} diff --git a/packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/declare-namespace-with-exported-function.src.ts b/packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/declare-namespace-with-exported-function.src.ts deleted file mode 100644 index 403557868e70..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/declare-namespace-with-exported-function.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare namespace d3 { - export function select(selector: string): Selection; -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/global-module-declaration.src.ts b/packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/global-module-declaration.src.ts deleted file mode 100644 index 3c761080cd05..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/global-module-declaration.src.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare global { - declare module global { - - } - declare namespace global { - - } -} diff --git a/packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/module-with-default-exports.src.ts b/packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/module-with-default-exports.src.ts deleted file mode 100644 index ae4410a51bd3..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/module-with-default-exports.src.ts +++ /dev/null @@ -1,7 +0,0 @@ -module "foo" { - export default class C { - method(): C {}; - } - export default function bar() {} -} - diff --git a/packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/nested-internal-module.src.ts b/packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/nested-internal-module.src.ts deleted file mode 100644 index 3b55650bc894..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/nested-internal-module.src.ts +++ /dev/null @@ -1,12 +0,0 @@ -module A { - - export var x = 'hello world' - export class Point { - constructor(public x: number, public y: number) { } - } - export module B { - export interface Id { - name: string; - } - } -} \ No newline at end of file diff --git a/packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/shorthand-ambient-module-declaration.src.ts b/packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/shorthand-ambient-module-declaration.src.ts deleted file mode 100644 index b8df95b7de58..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/namespaces-and-modules/shorthand-ambient-module-declaration.src.ts +++ /dev/null @@ -1 +0,0 @@ -declare module "hot-new-module"; diff --git a/packages/shared-fixtures/fixtures/typescript/types/array-type.src.ts b/packages/shared-fixtures/fixtures/typescript/types/array-type.src.ts deleted file mode 100644 index 5d038fc71d95..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/array-type.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Foo = string[] diff --git a/packages/shared-fixtures/fixtures/typescript/types/conditional-infer-nested.src.ts b/packages/shared-fixtures/fixtures/typescript/types/conditional-infer-nested.src.ts deleted file mode 100644 index be2b56659de4..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/conditional-infer-nested.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -type Unpacked = - T extends (infer U)[] ? U : - T extends infer U ? U : - T extends Promise ? U : - T; diff --git a/packages/shared-fixtures/fixtures/typescript/types/conditional-infer-simple.src.ts b/packages/shared-fixtures/fixtures/typescript/types/conditional-infer-simple.src.ts deleted file mode 100644 index 5da42481fd3d..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/conditional-infer-simple.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Foo = T extends { a: infer U, b: infer U } ? U : never; diff --git a/packages/shared-fixtures/fixtures/typescript/types/conditional-infer-with-constraint.src.ts b/packages/shared-fixtures/fixtures/typescript/types/conditional-infer-with-constraint.src.ts deleted file mode 100644 index 36ce0699bb65..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/conditional-infer-with-constraint.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -type X3 = T extends [infer U extends number] ? MustBeNumber : never; -type X4 = T extends [infer U extends number, infer U extends number] ? MustBeNumber : never; -type X5 = T extends [infer U extends number, infer U] ? MustBeNumber : never; -type X6 = T extends [infer U, infer U extends number] ? MustBeNumber : never; -type X7 = T extends [infer U extends string, infer U extends number] ? U : never; diff --git a/packages/shared-fixtures/fixtures/typescript/types/conditional-infer.src.ts b/packages/shared-fixtures/fixtures/typescript/types/conditional-infer.src.ts deleted file mode 100644 index fc9bc48546e6..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/conditional-infer.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Element = T extends (infer U)[] ? U : T; diff --git a/packages/shared-fixtures/fixtures/typescript/types/conditional-with-null.src.ts b/packages/shared-fixtures/fixtures/typescript/types/conditional-with-null.src.ts deleted file mode 100644 index c77648689818..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/conditional-with-null.src.ts +++ /dev/null @@ -1 +0,0 @@ -let x: number extends string ? boolean : null; diff --git a/packages/shared-fixtures/fixtures/typescript/types/conditional.src.ts b/packages/shared-fixtures/fixtures/typescript/types/conditional.src.ts deleted file mode 100644 index da72fcb60124..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/conditional.src.ts +++ /dev/null @@ -1 +0,0 @@ -let x: number extends string ? boolean : string; diff --git a/packages/shared-fixtures/fixtures/typescript/types/constructor-abstract.src.ts b/packages/shared-fixtures/fixtures/typescript/types/constructor-abstract.src.ts deleted file mode 100644 index 538fd6b59673..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/constructor-abstract.src.ts +++ /dev/null @@ -1 +0,0 @@ -var x: abstract new () => void; diff --git a/packages/shared-fixtures/fixtures/typescript/types/constructor-empty.src.ts b/packages/shared-fixtures/fixtures/typescript/types/constructor-empty.src.ts deleted file mode 100644 index 3ce0edbc9d80..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/constructor-empty.src.ts +++ /dev/null @@ -1 +0,0 @@ -var x: new () => void; diff --git a/packages/shared-fixtures/fixtures/typescript/types/constructor-generic.src.ts b/packages/shared-fixtures/fixtures/typescript/types/constructor-generic.src.ts deleted file mode 100644 index f16a76dffead..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/constructor-generic.src.ts +++ /dev/null @@ -1 +0,0 @@ -let f: new (a: T) => T; diff --git a/packages/shared-fixtures/fixtures/typescript/types/constructor-in-generic.src.ts b/packages/shared-fixtures/fixtures/typescript/types/constructor-in-generic.src.ts deleted file mode 100644 index d9ea30e59835..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/constructor-in-generic.src.ts +++ /dev/null @@ -1 +0,0 @@ -let x: Array string>; diff --git a/packages/shared-fixtures/fixtures/typescript/types/constructor-with-rest.src.ts b/packages/shared-fixtures/fixtures/typescript/types/constructor-with-rest.src.ts deleted file mode 100644 index c3d9b7e1dff0..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/constructor-with-rest.src.ts +++ /dev/null @@ -1 +0,0 @@ -let f: new (...a: number[]) => void; diff --git a/packages/shared-fixtures/fixtures/typescript/types/constructor.src.ts b/packages/shared-fixtures/fixtures/typescript/types/constructor.src.ts deleted file mode 100644 index d24054773938..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/constructor.src.ts +++ /dev/null @@ -1 +0,0 @@ -let f: new (a: number, b?: number) => void; diff --git a/packages/shared-fixtures/fixtures/typescript/types/function-generic.src.ts b/packages/shared-fixtures/fixtures/typescript/types/function-generic.src.ts deleted file mode 100644 index 61d8ece714c9..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/function-generic.src.ts +++ /dev/null @@ -1 +0,0 @@ -let f: (a: T) => T; diff --git a/packages/shared-fixtures/fixtures/typescript/types/function-in-generic.src.ts b/packages/shared-fixtures/fixtures/typescript/types/function-in-generic.src.ts deleted file mode 100644 index 6b9a571a7c61..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/function-in-generic.src.ts +++ /dev/null @@ -1 +0,0 @@ -let x: Array<() => void>; diff --git a/packages/shared-fixtures/fixtures/typescript/types/function-with-array-destruction.src.ts b/packages/shared-fixtures/fixtures/typescript/types/function-with-array-destruction.src.ts deleted file mode 100644 index 2517be450da2..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/function-with-array-destruction.src.ts +++ /dev/null @@ -1 +0,0 @@ -type foo = ([a]: any) => any diff --git a/packages/shared-fixtures/fixtures/typescript/types/function-with-object-destruction.src.ts b/packages/shared-fixtures/fixtures/typescript/types/function-with-object-destruction.src.ts deleted file mode 100644 index fdb44b90178c..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/function-with-object-destruction.src.ts +++ /dev/null @@ -1 +0,0 @@ -type foo = ({a}: any) => any diff --git a/packages/shared-fixtures/fixtures/typescript/types/function-with-rest.src.ts b/packages/shared-fixtures/fixtures/typescript/types/function-with-rest.src.ts deleted file mode 100644 index 7dabdd6cf108..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/function-with-rest.src.ts +++ /dev/null @@ -1 +0,0 @@ -let f: (...a: number[]) => void; diff --git a/packages/shared-fixtures/fixtures/typescript/types/function-with-this.src.ts b/packages/shared-fixtures/fixtures/typescript/types/function-with-this.src.ts deleted file mode 100644 index cd13ed098d71..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/function-with-this.src.ts +++ /dev/null @@ -1 +0,0 @@ -let f: (this: number) => void; diff --git a/packages/shared-fixtures/fixtures/typescript/types/function.src.ts b/packages/shared-fixtures/fixtures/typescript/types/function.src.ts deleted file mode 100644 index b82de113da30..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/function.src.ts +++ /dev/null @@ -1 +0,0 @@ -let f: (a: number, b?: number) => void; diff --git a/packages/shared-fixtures/fixtures/typescript/types/index-signature-readonly.src.ts b/packages/shared-fixtures/fixtures/typescript/types/index-signature-readonly.src.ts deleted file mode 100644 index 2d330340714a..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/index-signature-readonly.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -type foo = { - readonly [key: number]: number; -} diff --git a/packages/shared-fixtures/fixtures/typescript/types/index-signature-without-type.src.ts b/packages/shared-fixtures/fixtures/typescript/types/index-signature-without-type.src.ts deleted file mode 100644 index 1994449aef65..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/index-signature-without-type.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -type foo = { - [a: string]; -} diff --git a/packages/shared-fixtures/fixtures/typescript/types/index-signature.src.ts b/packages/shared-fixtures/fixtures/typescript/types/index-signature.src.ts deleted file mode 100644 index 6e828cc996a2..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/index-signature.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -type foo = { - [a: string]: string; -} diff --git a/packages/shared-fixtures/fixtures/typescript/types/indexed.src.ts b/packages/shared-fixtures/fixtures/typescript/types/indexed.src.ts deleted file mode 100644 index 4a5809fdd554..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/indexed.src.ts +++ /dev/null @@ -1 +0,0 @@ -let x: T[K]; diff --git a/packages/shared-fixtures/fixtures/typescript/types/interface-with-accessors.src.ts b/packages/shared-fixtures/fixtures/typescript/types/interface-with-accessors.src.ts deleted file mode 100644 index d4eda64b2187..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/interface-with-accessors.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -interface Thing { - get size(): number; - set size(value: number | string | boolean); -} diff --git a/packages/shared-fixtures/fixtures/typescript/types/intersection-type.src.ts b/packages/shared-fixtures/fixtures/typescript/types/intersection-type.src.ts deleted file mode 100644 index 93da9407e8c7..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/intersection-type.src.ts +++ /dev/null @@ -1 +0,0 @@ -type LinkedList = T & { next: LinkedList }; diff --git a/packages/shared-fixtures/fixtures/typescript/types/literal-number-negative.src.ts b/packages/shared-fixtures/fixtures/typescript/types/literal-number-negative.src.ts deleted file mode 100644 index 48e57ca11060..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/literal-number-negative.src.ts +++ /dev/null @@ -1 +0,0 @@ -let x: -1; diff --git a/packages/shared-fixtures/fixtures/typescript/types/literal-number.src.ts b/packages/shared-fixtures/fixtures/typescript/types/literal-number.src.ts deleted file mode 100644 index 1e234e36b898..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/literal-number.src.ts +++ /dev/null @@ -1 +0,0 @@ -let x: 0; diff --git a/packages/shared-fixtures/fixtures/typescript/types/literal-string.src.ts b/packages/shared-fixtures/fixtures/typescript/types/literal-string.src.ts deleted file mode 100644 index 926a42ae7e30..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/literal-string.src.ts +++ /dev/null @@ -1 +0,0 @@ -let x: "foo"; diff --git a/packages/shared-fixtures/fixtures/typescript/types/mapped-named-type.src.ts b/packages/shared-fixtures/fixtures/typescript/types/mapped-named-type.src.ts deleted file mode 100644 index ea3309f4db3f..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/mapped-named-type.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -type Test = { - [P in keyof T as 'a']: T[P]; -}; diff --git a/packages/shared-fixtures/fixtures/typescript/types/mapped-readonly-minus.src.ts b/packages/shared-fixtures/fixtures/typescript/types/mapped-readonly-minus.src.ts deleted file mode 100644 index a7a1183dc9d5..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/mapped-readonly-minus.src.ts +++ /dev/null @@ -1 +0,0 @@ -let map: { -readonly [P in string]-?: number }; diff --git a/packages/shared-fixtures/fixtures/typescript/types/mapped-readonly-plus.src.ts b/packages/shared-fixtures/fixtures/typescript/types/mapped-readonly-plus.src.ts deleted file mode 100644 index 854fb5dbb2a2..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/mapped-readonly-plus.src.ts +++ /dev/null @@ -1 +0,0 @@ -let map: { +readonly [P in string]+?: number; }; diff --git a/packages/shared-fixtures/fixtures/typescript/types/mapped-readonly.src.ts b/packages/shared-fixtures/fixtures/typescript/types/mapped-readonly.src.ts deleted file mode 100644 index ef13a053bf27..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/mapped-readonly.src.ts +++ /dev/null @@ -1 +0,0 @@ -let map: { readonly [P in string]?: number; }; diff --git a/packages/shared-fixtures/fixtures/typescript/types/mapped-untypped.src.ts b/packages/shared-fixtures/fixtures/typescript/types/mapped-untypped.src.ts deleted file mode 100644 index 32aa39584e6e..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/mapped-untypped.src.ts +++ /dev/null @@ -1 +0,0 @@ -let map: { [P in string]; }; diff --git a/packages/shared-fixtures/fixtures/typescript/types/mapped.src.ts b/packages/shared-fixtures/fixtures/typescript/types/mapped.src.ts deleted file mode 100644 index aca2ba15b93c..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/mapped.src.ts +++ /dev/null @@ -1 +0,0 @@ -let map: { [P in string]: number; }; diff --git a/packages/shared-fixtures/fixtures/typescript/types/nested-types.src.ts b/packages/shared-fixtures/fixtures/typescript/types/nested-types.src.ts deleted file mode 100644 index adaf9a3cf309..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/nested-types.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Foo = [number, string?, boolean?] | [{}, [number?] | null & boolean[]] & {} diff --git a/packages/shared-fixtures/fixtures/typescript/types/object-literal-type-with-accessors.src.ts b/packages/shared-fixtures/fixtures/typescript/types/object-literal-type-with-accessors.src.ts deleted file mode 100644 index 61666608a103..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/object-literal-type-with-accessors.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -type Thing = { - get size(): number; - set size(value: number | string | boolean); -}; diff --git a/packages/shared-fixtures/fixtures/typescript/types/optional-variance-in-and-out.src.ts b/packages/shared-fixtures/fixtures/typescript/types/optional-variance-in-and-out.src.ts deleted file mode 100644 index ee58a11cfc37..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/optional-variance-in-and-out.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Mapper = (x: T) => U; diff --git a/packages/shared-fixtures/fixtures/typescript/types/optional-variance-in-out.src.ts b/packages/shared-fixtures/fixtures/typescript/types/optional-variance-in-out.src.ts deleted file mode 100644 index 1dd6ace1261d..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/optional-variance-in-out.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Processor = (x: T) => T; diff --git a/packages/shared-fixtures/fixtures/typescript/types/optional-variance-in.src.ts b/packages/shared-fixtures/fixtures/typescript/types/optional-variance-in.src.ts deleted file mode 100644 index 3cb911e9c26b..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/optional-variance-in.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Consumer = (x: T) => void; diff --git a/packages/shared-fixtures/fixtures/typescript/types/optional-variance-out.src.ts b/packages/shared-fixtures/fixtures/typescript/types/optional-variance-out.src.ts deleted file mode 100644 index dd9dd2012492..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/optional-variance-out.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Provider = () => T; diff --git a/packages/shared-fixtures/fixtures/typescript/types/parenthesized-type.src.ts b/packages/shared-fixtures/fixtures/typescript/types/parenthesized-type.src.ts deleted file mode 100644 index 5a03e27ee676..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/parenthesized-type.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Foo = (string | number) diff --git a/packages/shared-fixtures/fixtures/typescript/types/reference-generic-nested.src.ts b/packages/shared-fixtures/fixtures/typescript/types/reference-generic-nested.src.ts deleted file mode 100644 index e38dfca9d5dc..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/reference-generic-nested.src.ts +++ /dev/null @@ -1 +0,0 @@ -let x: Array>; diff --git a/packages/shared-fixtures/fixtures/typescript/types/reference-generic.src.ts b/packages/shared-fixtures/fixtures/typescript/types/reference-generic.src.ts deleted file mode 100644 index 4925bd4778cc..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/reference-generic.src.ts +++ /dev/null @@ -1 +0,0 @@ -let x: Array; diff --git a/packages/shared-fixtures/fixtures/typescript/types/reference.src.ts b/packages/shared-fixtures/fixtures/typescript/types/reference.src.ts deleted file mode 100644 index 330fb1d2245d..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/reference.src.ts +++ /dev/null @@ -1 +0,0 @@ -let x: T; diff --git a/packages/shared-fixtures/fixtures/typescript/types/template-literal-type-1.src.ts b/packages/shared-fixtures/fixtures/typescript/types/template-literal-type-1.src.ts deleted file mode 100644 index 1faa126d51a1..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/template-literal-type-1.src.ts +++ /dev/null @@ -1 +0,0 @@ -type T = `foo`; diff --git a/packages/shared-fixtures/fixtures/typescript/types/template-literal-type-2.src.ts b/packages/shared-fixtures/fixtures/typescript/types/template-literal-type-2.src.ts deleted file mode 100644 index cffb3ab1b8de..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/template-literal-type-2.src.ts +++ /dev/null @@ -1 +0,0 @@ -type T = `foo${'bar'}`; diff --git a/packages/shared-fixtures/fixtures/typescript/types/template-literal-type-3.src.ts b/packages/shared-fixtures/fixtures/typescript/types/template-literal-type-3.src.ts deleted file mode 100644 index 62d52177631d..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/template-literal-type-3.src.ts +++ /dev/null @@ -1,3 +0,0 @@ -type Color = "red" | "blue"; -type Quantity = "one" | "two"; -type SeussFish = `${Quantity | Color} fish`; diff --git a/packages/shared-fixtures/fixtures/typescript/types/template-literal-type-4.src.ts b/packages/shared-fixtures/fixtures/typescript/types/template-literal-type-4.src.ts deleted file mode 100644 index b08b1843885d..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/template-literal-type-4.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -type EnthusiasticGreeting = `${Uppercase} - ${Lowercase} - ${Capitalize} - ${Uncapitalize}`; -type HELLO = EnthusiasticGreeting<"heLLo">; diff --git a/packages/shared-fixtures/fixtures/typescript/types/this-type-expanded.src.ts b/packages/shared-fixtures/fixtures/typescript/types/this-type-expanded.src.ts deleted file mode 100644 index 0c442178cb15..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/this-type-expanded.src.ts +++ /dev/null @@ -1,29 +0,0 @@ -class A { - public a: number; - - public method(this: this): number { - return this.a; - } - - public method2(this: A): this { - return this.a; - } - - public method3(this: this): number { - var fn = () => this.a; - return fn(); - } - - public method4(this: A): number { - var fn = () => this.a; - return fn(); - } - - static staticMethod(this: A): number { - return this.a; - } - - static typeof(this: A): this { - return typeof this; - } -} diff --git a/packages/shared-fixtures/fixtures/typescript/types/this-type.src.ts b/packages/shared-fixtures/fixtures/typescript/types/this-type.src.ts deleted file mode 100644 index d5f87a9f84a2..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/this-type.src.ts +++ /dev/null @@ -1,5 +0,0 @@ -class Message { - clone(): this { - return this; - } -} diff --git a/packages/shared-fixtures/fixtures/typescript/types/tuple-empty.src.ts b/packages/shared-fixtures/fixtures/typescript/types/tuple-empty.src.ts deleted file mode 100644 index f7cd7b5a0e25..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/tuple-empty.src.ts +++ /dev/null @@ -1 +0,0 @@ -let x: []; diff --git a/packages/shared-fixtures/fixtures/typescript/types/tuple-named-optional.src.ts b/packages/shared-fixtures/fixtures/typescript/types/tuple-named-optional.src.ts deleted file mode 100644 index 6704f9b6f114..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/tuple-named-optional.src.ts +++ /dev/null @@ -1 +0,0 @@ -let x: [a: string, b?: number, c?: (string | number)] diff --git a/packages/shared-fixtures/fixtures/typescript/types/tuple-named-rest.src.ts b/packages/shared-fixtures/fixtures/typescript/types/tuple-named-rest.src.ts deleted file mode 100644 index 5320dd800c7f..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/tuple-named-rest.src.ts +++ /dev/null @@ -1 +0,0 @@ -let x: [a: string, ...b: number[]] diff --git a/packages/shared-fixtures/fixtures/typescript/types/tuple-named-type.src.ts b/packages/shared-fixtures/fixtures/typescript/types/tuple-named-type.src.ts deleted file mode 100644 index d0d24cf3b95c..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/tuple-named-type.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Foo = [a: string, b?: string] diff --git a/packages/shared-fixtures/fixtures/typescript/types/tuple-named.src.ts b/packages/shared-fixtures/fixtures/typescript/types/tuple-named.src.ts deleted file mode 100644 index a714c8ab33e9..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/tuple-named.src.ts +++ /dev/null @@ -1 +0,0 @@ -let x: [a: number, b: number, c: number]; diff --git a/packages/shared-fixtures/fixtures/typescript/types/tuple-optional.src.ts b/packages/shared-fixtures/fixtures/typescript/types/tuple-optional.src.ts deleted file mode 100644 index 3b8d21ba958c..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/tuple-optional.src.ts +++ /dev/null @@ -1 +0,0 @@ -let x: [string, number?, (string | number)?] diff --git a/packages/shared-fixtures/fixtures/typescript/types/tuple-rest.src.ts b/packages/shared-fixtures/fixtures/typescript/types/tuple-rest.src.ts deleted file mode 100644 index d7719b2cb4e6..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/tuple-rest.src.ts +++ /dev/null @@ -1 +0,0 @@ -let x: [string, ...number[]] diff --git a/packages/shared-fixtures/fixtures/typescript/types/tuple-type.src.ts b/packages/shared-fixtures/fixtures/typescript/types/tuple-type.src.ts deleted file mode 100644 index 75a6d8e39f36..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/tuple-type.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Foo = [string, string?] diff --git a/packages/shared-fixtures/fixtures/typescript/types/tuple.src.ts b/packages/shared-fixtures/fixtures/typescript/types/tuple.src.ts deleted file mode 100644 index 53c8e72ec952..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/tuple.src.ts +++ /dev/null @@ -1 +0,0 @@ -let x: [number, number, number]; diff --git a/packages/shared-fixtures/fixtures/typescript/types/type-literal.src.ts b/packages/shared-fixtures/fixtures/typescript/types/type-literal.src.ts deleted file mode 100644 index 4193f364788f..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/type-literal.src.ts +++ /dev/null @@ -1 +0,0 @@ -let obj: { x: number }; diff --git a/packages/shared-fixtures/fixtures/typescript/types/type-operator.src.ts b/packages/shared-fixtures/fixtures/typescript/types/type-operator.src.ts deleted file mode 100644 index 1d23f962ef05..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/type-operator.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -let x: keyof T; -let y: unique symbol; diff --git a/packages/shared-fixtures/fixtures/typescript/types/typeof-this.src.ts b/packages/shared-fixtures/fixtures/typescript/types/typeof-this.src.ts deleted file mode 100644 index 6cad5147a8ae..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/typeof-this.src.ts +++ /dev/null @@ -1,2 +0,0 @@ -let self: typeof this; -let foo: typeof this.foo; diff --git a/packages/shared-fixtures/fixtures/typescript/types/typeof-with-type-parameters.src.ts b/packages/shared-fixtures/fixtures/typescript/types/typeof-with-type-parameters.src.ts deleted file mode 100644 index 7287d407d29d..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/typeof-with-type-parameters.src.ts +++ /dev/null @@ -1 +0,0 @@ -let x: typeof y.z; diff --git a/packages/shared-fixtures/fixtures/typescript/types/typeof.src.ts b/packages/shared-fixtures/fixtures/typescript/types/typeof.src.ts deleted file mode 100644 index eebcd19b13a9..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/typeof.src.ts +++ /dev/null @@ -1 +0,0 @@ -let x: typeof y.z; diff --git a/packages/shared-fixtures/fixtures/typescript/types/union-intersection.src.ts b/packages/shared-fixtures/fixtures/typescript/types/union-intersection.src.ts deleted file mode 100644 index 93f391fdc414..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/union-intersection.src.ts +++ /dev/null @@ -1,4 +0,0 @@ -let union: number | null | undefined; -let intersection: number & string; -let precedence1: number | string & boolean; -let precedence2: number & string | boolean; diff --git a/packages/shared-fixtures/fixtures/typescript/types/union-type.src.ts b/packages/shared-fixtures/fixtures/typescript/types/union-type.src.ts deleted file mode 100644 index a2cfaf9af408..000000000000 --- a/packages/shared-fixtures/fixtures/typescript/types/union-type.src.ts +++ /dev/null @@ -1 +0,0 @@ -type Foo = string & number diff --git a/packages/shared-fixtures/package.json b/packages/shared-fixtures/package.json deleted file mode 100644 index c6bd1ccd6645..000000000000 --- a/packages/shared-fixtures/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "description": "Code fixtures used to test the typescript-estree parser.", - "name": "@typescript-eslint/shared-fixtures", - "version": "5.51.0", - "private": true -} diff --git a/packages/shared-fixtures/project.json b/packages/shared-fixtures/project.json deleted file mode 100644 index 412bca4935ff..000000000000 --- a/packages/shared-fixtures/project.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "shared-fixtures", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "type": "library", - "implicitDependencies": [] -} diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 22afddb5fc2c..821688b6e250 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -59,7 +59,6 @@ "@types/is-glob": "*", "@types/semver": "*", "@types/tmp": "*", - "@typescript-eslint/shared-fixtures": "5.51.0", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts deleted file mode 100644 index 6abab590b77c..000000000000 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ /dev/null @@ -1,537 +0,0 @@ -import fs from 'fs'; -import glob from 'glob'; -import path from 'path'; - -import { isJSXFileType } from '../../tools/test-utils'; - -interface Fixture { - filename: string; - jsx: boolean; - ignoreSourceType: boolean; -} - -interface FixturePatternConfig { - pattern: string; - jsx: boolean; - directory: string; - ignoreSourceType: boolean; -} - -interface CreateFixturePatternConfig { - ignore?: string[]; - fileType?: string; - ignoreSourceType?: string[]; -} - -const fixturesDirPath = path.join(__dirname, '../fixtures'); -export const sharedFixturesDirPath = path.join( - __dirname, - '../../../shared-fixtures/fixtures', -); - -class FixturesTester { - protected fixtures: FixturePatternConfig[] = []; - - /** - * Utility to generate a FixturePatternConfig object containing the glob pattern for specific subsections of the fixtures/ directory, - * including the capability to ignore specific nested patterns. - * - * @param fixturesSubPath the sub-path within the fixtures/ directory - * @param config an optional configuration object with optional sub-paths to ignore and/or parse with sourceType: module - */ - public addFixturePatternConfig( - fixturesSubPath: string, - config: CreateFixturePatternConfig = {}, - ): void { - let _fixturesDirPath = fixturesDirPath; - if (!fs.existsSync(path.join(fixturesDirPath, fixturesSubPath))) { - _fixturesDirPath = sharedFixturesDirPath; - if (!fs.existsSync(path.join(sharedFixturesDirPath, fixturesSubPath))) { - throw new Error( - `Registered path '${path.join( - __dirname, - fixturesSubPath, - )}' was not found`, - ); - } - } - - const ignore = config.ignore ?? []; - const fileType = config.fileType ?? 'js'; - const ignoreSourceType = config.ignoreSourceType ?? []; - const jsx = isJSXFileType(fileType); - - /** - * The TypeScript compiler gives us the "externalModuleIndicator" to allow typescript-estree do dynamically detect the "sourceType". - * Babel has similar feature sourceType='unambiguous' but its not perfect, and in some specific cases we sill have to enforce it. - * Known issues: - * - https://github.com/babel/babel/issues/9213 - */ - if (ignoreSourceType.length) { - ignore.push(...ignoreSourceType); - for (const fixture of ignoreSourceType) { - this.fixtures.push({ - // It needs to be the full path from within fixtures/ for the pattern - pattern: `${fixturesSubPath}/${fixture}.src.${fileType}`, - ignoreSourceType: true, - directory: _fixturesDirPath, - jsx, - }); - } - } - - this.fixtures.push({ - pattern: `${fixturesSubPath}/!(${ignore.join('|')}).src.${fileType}`, - ignoreSourceType: false, - directory: _fixturesDirPath, - jsx, - }); - } - - public getFixtures(): Fixture[] { - return this.fixtures - .map(fixture => - glob - .sync(fixture.pattern, { - cwd: fixture.directory, - absolute: true, - }) - .map(filename => ({ - filename, - ignoreSourceType: fixture.ignoreSourceType, - jsx: fixture.jsx, - })), - ) - .reduce((acc, x) => acc.concat(x), []); - } -} - -/** - * An class with FixturePatternConfigs - */ -const tester = new FixturesTester(); - -tester.addFixturePatternConfig('javascript/basics'); - -tester.addFixturePatternConfig('comments'); - -tester.addFixturePatternConfig('javascript/templateStrings', { - ignore: [ - /** - * [BABEL ERRORED, BUT TS-ESTREE DID NOT] - * SyntaxError: Invalid escape sequence in template - */ - 'error-octal-literal', - ], -}); - -tester.addFixturePatternConfig('javascript/arrayLiteral'); - -tester.addFixturePatternConfig('javascript/simple-literals'); - -tester.addFixturePatternConfig('javascript/directives'); - -tester.addFixturePatternConfig('javascript/experimentalObjectRestSpread'); - -tester.addFixturePatternConfig('javascript/arrowFunctions', { - ignore: [ - /** - * Expected babel parse errors - all of these files below produce parse errors in espree - * as well, but the TypeScript compiler is so forgiving during parsing that typescript-estree - * does not actually error on them and will produce an AST. - * - * We are also unable to leverage diagnostics effectively here. The relevant TypeScript diagnostic is: - * - * (ts 3.2) 2300 "Duplicate identifier '{0}'." - * - * ...but this is heavily overloaded. It will also report an error for an object with two properties - * with the same name, for example. - */ - 'error-dup-params', // babel parse errors - 'error-strict-dup-params', // babel parse errors - /** - * typescript reports TS1100 and babel errors on this - * TS1100: "Invalid use of '{0}' in strict mode." - * TODO: do we want TS1100 error code? - */ - 'error-strict-default-param-eval', - 'error-strict-eval', - 'error-strict-eval-return', - 'error-strict-param-arguments', - 'error-strict-param-eval', - 'error-strict-param-names', - 'error-strict-param-no-paren-arguments', - 'error-strict-param-no-paren-eval', - ], -}); -tester.addFixturePatternConfig('javascript/function'); - -tester.addFixturePatternConfig('javascript/bigIntLiterals'); -tester.addFixturePatternConfig('javascript/binaryLiterals'); -tester.addFixturePatternConfig('javascript/blockBindings'); - -tester.addFixturePatternConfig('javascript/callExpression'); - -tester.addFixturePatternConfig('javascript/classes', { - ignore: [ - /** - * [BABEL ERRORED, BUT TS-ESTREE DID NOT] - * super() is being used outside of constructor. - * Other parsers (e.g. espree, acorn) do not error on this. - */ - 'class-one-method-super', - /** - * TS3.6 made computed constructors parse as actual constructors. - */ - 'class-two-methods-computed-constructor', - ], -}); - -tester.addFixturePatternConfig('javascript/commaOperator'); - -tester.addFixturePatternConfig('javascript/defaultParams'); - -tester.addFixturePatternConfig('javascript/destructuring'); -tester.addFixturePatternConfig('javascript/destructuring-and-arrowFunctions'); -tester.addFixturePatternConfig('javascript/destructuring-and-blockBindings'); -tester.addFixturePatternConfig('javascript/destructuring-and-defaultParams'); -tester.addFixturePatternConfig('javascript/destructuring-and-forOf'); -tester.addFixturePatternConfig('javascript/destructuring-and-spread'); - -tester.addFixturePatternConfig('javascript/experimentalAsyncIteration'); -tester.addFixturePatternConfig('javascript/experimentalDynamicImport'); -tester.addFixturePatternConfig('javascript/exponentiationOperators'); -tester.addFixturePatternConfig('javascript/experimentalOptionalCatchBinding'); - -tester.addFixturePatternConfig('javascript/for'); -tester.addFixturePatternConfig('javascript/forIn', { - ignore: [ - /** - * Babel correctly errors on this file, and we can report on it via: - * TS 1189 (ts 3.2) "The variable declaration of a 'for...in' statement cannot have an initializer." - * - * However, if we enable that, we get a lot of cases which ts-estree errors on, but Babel doesn't. - * Therefore, leaving this as the one ignored case for now. - * - * TODO: Investigate this in more detail - */ - 'for-in-with-assigment', // babel parse errors - /** - * [BABEL ERRORED, BUT TS-ESTREE DID NOT] - * SyntaxError: Invalid left-hand side in for-loop - * TODO: Error 2405: `The left-hand side of a 'for...in' statement must be of type 'string' or 'any'."` - */ - 'for-in-with-bare-assigment', - ], -}); - -tester.addFixturePatternConfig('javascript/forOf'); -tester.addFixturePatternConfig('javascript/generators'); -tester.addFixturePatternConfig('javascript/globalReturn'); -tester.addFixturePatternConfig('javascript/hexLiterals'); -tester.addFixturePatternConfig('javascript/importMeta'); -tester.addFixturePatternConfig('javascript/labels'); - -tester.addFixturePatternConfig('javascript/modules', { - ignore: [ - /** - * [BABEL ERRORED, BUT TS-ESTREE DID NOT] - * SyntaxError: Unexpected keyword 'default'. - */ - 'invalid-export-named-default', - ], - ignoreSourceType: [ - 'error-function', - 'error-strict', - 'error-delete', - 'invalid-await', - // babel does not recognize these as modules - 'export-named-as-default', - 'export-named-as-specifier', - 'export-named-as-specifiers', - 'export-named-specifier', - 'export-named-specifiers-comma', - 'export-named-specifiers', - // babel treats declare as not a module - 'import-module', - ], -}); - -tester.addFixturePatternConfig('javascript/newTarget'); - -tester.addFixturePatternConfig('javascript/objectLiteral'); -tester.addFixturePatternConfig('javascript/objectLiteralComputedProperties'); - -tester.addFixturePatternConfig('javascript/objectLiteralDuplicateProperties', { - ignore: [ - /** - * ts-estree throws thanks to TS 1117 (ts 3.2 at time of writing) - * "An object literal cannot have multiple properties with the same name in strict mode." - * - * Babel does not throw for some reason... - */ - 'strict-duplicate-properties', // ts-estree parse errors - 'strict-duplicate-string-properties', - ], -}); - -tester.addFixturePatternConfig('javascript/objectLiteralShorthandMethods'); -tester.addFixturePatternConfig('javascript/objectLiteralShorthandProperties'); -tester.addFixturePatternConfig('javascript/octalLiterals', { - ignore: [ - /** - * Old-style octal literals are not supported in typescript - * @see https://github.com/Microsoft/TypeScript/issues/10101 - */ - 'legacy', - ], -}); -tester.addFixturePatternConfig('javascript/regex'); -tester.addFixturePatternConfig('javascript/regexUFlag'); -tester.addFixturePatternConfig('javascript/regexYFlag'); -tester.addFixturePatternConfig('javascript/restParams'); -tester.addFixturePatternConfig('javascript/spread'); -tester.addFixturePatternConfig('javascript/unicodeCodePointEscapes'); - -/* ================================================== */ - -tester.addFixturePatternConfig('jsx', { - ignore: [ - /** - * JSX fixtures which have known issues for typescript-estree - * https://github.com/Microsoft/TypeScript/issues/7410 - */ - 'embedded-tags', - /** - * [BABEL ERRORED, BUT TS-ESTREE DID NOT] - * SyntaxError: Unexpected token - * TODO: investigate if this code is valid as there is no typescript error - */ - 'invalid-namespace-value-with-dots', - ], -}); -tester.addFixturePatternConfig('jsx-useJSXTextNode'); - -/* ================================================== */ - -/** - * TSX-SPECIFIC FILES - */ - -tester.addFixturePatternConfig('tsx', { - fileType: 'tsx', -}); - -/* ================================================== */ - -/** - * TYPESCRIPT-SPECIFIC FILES - */ - -tester.addFixturePatternConfig('typescript/babylon-convergence', { - fileType: 'ts', -}); - -tester.addFixturePatternConfig('typescript/basics', { - fileType: 'ts', - ignore: [ - /** - * Babel parses it as TSQualifiedName - * ts parses it as MemberExpression - * @see https://github.com/babel/babel/issues/12884 - */ - 'interface-with-extends-member-expression', - /** - * @see https://github.com/typescript-eslint/typescript-eslint/issues/2998 - */ - 'type-import-type', - 'type-import-type-with-type-parameters-in-type-reference', - /** - * Not yet supported in Babel - * Directive field is not added to module and namespace - */ - 'directive-in-module', - 'directive-in-namespace', - /** - * [BABEL ERRORED, BUT TS-ESTREE DID NOT] - * TODO: validate error code TS2451 Cannot redeclare block-scoped variable '{0}'. - */ - 'const-assertions', - /** - * [TS-ESTREE ERRORED, BUT BABEL DID NOT] - * SyntaxError: 'abstract' modifier can only appear on a class, method, or property declaration. - */ - 'abstract-class-with-abstract-constructor', - /** - * [BABEL ERRORED, BUT TS-ESTREE DID NOT] - * babel hard fails on computed string enum members, but TS doesn't - * @see https://github.com/babel/babel/issues/12683 - */ - 'export-named-enum-computed-string', - /** - * [BABEL ERRORED, BUT TS-ESTREE DID NOT] - * This is intentional; we don't error on semantic problems for these cases - */ - 'class-with-constructor-and-type-parameters', - 'class-with-two-methods-computed-constructor', - 'export-type-star-from', - 'import-type-error', - /** - * [TS-ESTREE ERRORED, BUT BABEL DID NOT] - * This is intentional; babel is not checking types - */ - 'catch-clause-with-invalid-annotation', - /** - * [BABEL ERRORED, BUT TS-ESTREE DID NOT] - * TODO: enforce that accessibility is not allowed on a private identifier - */ - 'class-private-identifier-field-with-accessibility-error', - /** - * [TS-ESTREE ERRORED, BUT BABEL DID NOT] - * TypeScript 4.4 new feature - * @see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-4.html#abstract-properties-do-not-allow-initializers - */ - 'abstract-class-with-override-property', - /** - * [BABEL ERRORED, BUT TS-ESTREE DID NOT] - * SyntaxError: Missing initializer in const declaration. - */ - 'var-with-definite-assignment', - /** - * [BABEL ERRORED, BUT TS-ESTREE DID NOT] - * SyntaxError: A JSON module can only be imported with `default`. - */ - 'export-with-import-assertions', - ], - ignoreSourceType: [ - /** - * Babel reports sourceType script - * @see https://github.com/babel/babel/issues/9213 - */ - 'export-assignment', - 'import-equal-declaration', - 'import-export-equal-declaration', - 'import-equal-type-declaration', - 'import-export-equal-type-declaration', - // babel treats declare and types as not a module - 'export-declare-const-named-enum', - 'export-declare-named-enum', - 'type-alias-declaration-export-function-type', - 'type-alias-declaration-export-object-type', - 'type-alias-declaration-export', - // babel treats type import/export as not a module - 'export-type', - 'export-type-as', - 'export-type-from', - 'export-type-from-as', - 'import-type-default', - 'import-type-named', - 'import-type-named-as', - 'import-type-star-as-ns', - 'keyword-variables', - ], -}); - -tester.addFixturePatternConfig('typescript/decorators/accessor-decorators', { - fileType: 'ts', -}); -tester.addFixturePatternConfig('typescript/decorators/class-decorators', { - fileType: 'ts', - ignore: [ - /** - * babel sets the range of the export node to the start of the decorator - * TSESTree sets it to the start of the export keyword - */ - 'export-default-class-decorator', - 'export-named-class-decorator', - /** - * babel sets the range of the export node to the start of the parameter - * TSESTree sets it to the start of the decorator - */ - 'class-parameter-property', - ], -}); -tester.addFixturePatternConfig('typescript/decorators/method-decorators', { - fileType: 'ts', -}); -tester.addFixturePatternConfig('typescript/decorators/parameter-decorators', { - fileType: 'ts', - ignore: [ - /** - * babel does not support decorators on array and rest parameters - * TODO: report this to babel - */ - 'parameter-array-pattern-decorator', - 'parameter-rest-element-decorator', - ], -}); -tester.addFixturePatternConfig('typescript/decorators/property-decorators', { - fileType: 'ts', -}); - -tester.addFixturePatternConfig('typescript/expressions', { - fileType: 'ts', - ignore: [ - /** - * Babel produces incorrect structure for TSInstantiationExpression and optional ChainExpression - * @see https://github.com/babel/babel/issues/14613 - */ - 'instantiation-expression', - ], -}); - -tester.addFixturePatternConfig('typescript/errorRecovery', { - fileType: 'ts', - ignore: [ - /** - * [BABEL ERRORED, BUT TS-ESTREE DID NOT] - * TODO: enable error code TS1019: An index signature parameter cannot have a question mark. - */ - 'interface-with-optional-index-signature', - /** - * Babel correctly errors on this - * TODO: enable error code TS1024: 'readonly' modifier can only appear on a property declaration or index signature. - */ - 'interface-method-readonly', - ], -}); - -tester.addFixturePatternConfig('typescript/types', { - fileType: 'ts', - ignore: [ - /** - * TS Template Literal Types - * - * Babel uses a representation much further from TS's representation. - * They produce TSTypeLiteral -> TemplateLiteral, and then force override the expression parser to parse types - * We instead just emit TSTemplateLiteralType. - */ - 'template-literal-type-2', - 'template-literal-type-3', - 'template-literal-type-4', - /** - * Reported range differs between ts-estree and Babel - * @see https://github.com/babel/babel/issues/14589 - */ - 'optional-variance-in', - 'optional-variance-out', - 'optional-variance-in-out', - 'optional-variance-in-and-out', - ], -}); - -tester.addFixturePatternConfig('typescript/declare', { - fileType: 'ts', -}); - -tester.addFixturePatternConfig('typescript/namespaces-and-modules', { - fileType: 'ts', - ignoreSourceType: [ - 'nested-internal-module', - 'module-with-default-exports', - 'ambient-module-declaration-with-import', - 'declare-namespace-with-exported-function', - ], -}); - -export const fixturesToTest = tester.getFixtures(); diff --git a/packages/typescript-estree/tests/ast-alignment/parse.ts b/packages/typescript-estree/tests/ast-alignment/parse.ts deleted file mode 100644 index b4d5ea1c8f9c..000000000000 --- a/packages/typescript-estree/tests/ast-alignment/parse.ts +++ /dev/null @@ -1,131 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access */ -import { codeFrameColumns } from '@babel/code-frame'; -import type babelParser from '@babel/parser'; -import type { ParserPlugin } from '@babel/parser'; -import type { File } from '@babel/types'; -import type { TSESTree } from '@typescript-eslint/types'; - -import type { TSError } from '../../src/node-utils'; -import type { AST } from '../../src/parser'; -import { parseAndGenerateServices } from '../../src/parser'; - -function createError( - message: string, - line: number, - column: number, -): SyntaxError { - // Construct an error similar to the ones thrown by Babylon. - const error = new SyntaxError(`${message} (${line}:${column})`); - (error as any).loc = { - line, - column, - }; - return error; -} - -function parseWithBabelParser(text: string, jsx = true): File { - const babel = require('@babel/parser') as typeof babelParser; - const plugins: ParserPlugin[] = [ - [ - 'estree', - { - classFeatures: true, - }, - ], - 'decorators-legacy', - 'classStaticBlock', - 'importAssertions', - 'typescript', - ]; - if (jsx) { - plugins.push('jsx'); - } - - return babel.parse(text, { - sourceType: 'unambiguous', - allowImportExportEverywhere: true, - allowReturnOutsideFunction: true, - ranges: true, - plugins, - }); -} - -function parseWithTypeScriptESTree(text: string, jsx = true): AST { - try { - const result = parseAndGenerateServices(text, { - loc: true, - range: true, - tokens: false, - comment: false, - errorOnUnknownASTType: true, - /** - * Babel will always throw on these types of issues, so we enable - * them in typescript-estree when comparing behavior between the - * two parsers. By default, the TypeScript compiler is much more - * forgiving. - */ - errorOnTypeScriptSyntacticAndSemanticIssues: true, - jsx, - }); - return result.ast; - } catch (e: unknown) { - const error = e as TSError; - - throw createError(error.message, error.lineNumber, error.column); - } -} - -interface ASTComparisonParseOptions { - parser: string; - jsx?: boolean; -} - -export function parse( - text: string, - opts: ASTComparisonParseOptions, -): { parseError: any | null; ast: any | null } { - /** - * Always return a consistent interface, there will be times when we expect both - * parsers to fail to parse the invalid source. - */ - const result: { parseError: any | null; ast: any | null } = { - parseError: null, - ast: null, - }; - - try { - switch (opts.parser) { - case '@typescript-eslint/typescript-estree': - result.ast = parseWithTypeScriptESTree(text, opts.jsx); - break; - case '@babel/parser': - result.ast = parseWithBabelParser(text, opts.jsx); - break; - default: - throw new Error( - 'Please provide a valid parser: either "typescript-estree" or "@babel/parser"', - ); - } - } catch (error: any) { - const loc = error.loc as TSESTree.Position | undefined; - if (loc) { - error.codeFrame = codeFrameColumns( - text, - { - start: { - line: loc.line, - column: loc.column + 1, - }, - }, - { - highlightCode: true, - }, - ); - error.message += `\n${error.codeFrame}`; - } - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment - result.parseError = error; - } - - return result; -} diff --git a/packages/typescript-estree/tests/ast-alignment/spec.ts b/packages/typescript-estree/tests/ast-alignment/spec.ts deleted file mode 100644 index d743571f1500..000000000000 --- a/packages/typescript-estree/tests/ast-alignment/spec.ts +++ /dev/null @@ -1,94 +0,0 @@ -import type { File } from '@babel/types'; -import fs from 'fs'; -import path from 'path'; - -import { fixturesToTest, sharedFixturesDirPath } from './fixtures-to-test'; -import { parse } from './parse'; -import { - preprocessBabylonAST, - preprocessTypescriptAST, - removeLocationDataAndSourceTypeFromProgramNode, -} from './utils'; - -fixturesToTest.forEach(fixture => { - const filename = fixture.filename; - const source = fs.readFileSync(filename, 'utf8').replace(/\r\n/g, '\n'); - - /** - * Parse with typescript-estree - */ - const typeScriptESTreeResult = parse(source, { - parser: '@typescript-eslint/typescript-estree', - jsx: fixture.jsx, - }); - - /** - * Parse the source with @babel/parser typescript-plugin - */ - const babelParserResult = parse(source, { - parser: '@babel/parser', - jsx: fixture.jsx, - }); - - /** - * If babel fails to parse the source, ensure that typescript-estree has the same fundamental issue - */ - if (babelParserResult.parseError) { - /** - * FAIL: babel errored but typescript-estree did not - */ - if (!typeScriptESTreeResult.parseError) { - it(`TEST FAIL [BABEL ERRORED, BUT TS-ESTREE DID NOT] - ${filename}`, () => { - expect(typeScriptESTreeResult.parseError).toEqual( - babelParserResult.parseError, - ); - }); - return; - } - /** - * Both parsers errored - this is OK as long as the errors are of the same "type" - * E.g. Both must be a SyntaxError, or both must be a RangeError etc. - */ - it(`[Both parsers error as expected] - ${filename}`, () => { - expect(babelParserResult.parseError.name).toBe( - typeScriptESTreeResult.parseError.name, - ); - }); - return; - } - - /** - * FAIL: typescript-estree errored but babel did not - */ - if (typeScriptESTreeResult.parseError) { - it(`TEST FAIL [TS-ESTREE ERRORED, BUT BABEL DID NOT] - ${filename}`, () => { - expect(babelParserResult.parseError).toEqual( - typeScriptESTreeResult.parseError, - ); - }); - return; - } - - /** - * No errors, assert the two ASTs match - */ - const relativeFilename = path.relative(sharedFixturesDirPath, filename); - it(`${relativeFilename}`, () => { - expect(babelParserResult.ast).toBeTruthy(); - expect(typeScriptESTreeResult.ast).toBeTruthy(); - /** - * Perform some extra formatting steps on the babel AST before comparing - */ - const babelAst = removeLocationDataAndSourceTypeFromProgramNode( - preprocessBabylonAST(babelParserResult.ast as File), - fixture.ignoreSourceType, - ); - const tsestreeAst = removeLocationDataAndSourceTypeFromProgramNode( - preprocessTypescriptAST(typeScriptESTreeResult.ast), - fixture.ignoreSourceType, - ); - - // Received = Babel, Expected = TSESTree - expect(babelAst).toEqual(tsestreeAst); - }); -}); diff --git a/packages/typescript-estree/tests/ast-alignment/utils.ts b/packages/typescript-estree/tests/ast-alignment/utils.ts deleted file mode 100644 index 717a74837b58..000000000000 --- a/packages/typescript-estree/tests/ast-alignment/utils.ts +++ /dev/null @@ -1,358 +0,0 @@ -// babel types are something we don't really care about -/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/restrict-plus-operands */ -import type { File, Identifier, Program, TSTypeQuery } from '@babel/types'; - -import type { TSESTree } from '../../src/ts-estree'; -import { AST_NODE_TYPES } from '../../src/ts-estree'; -import { deeplyCopy, omitDeep } from '../../tools/test-utils'; - -/** - * Common predicates for Babylon AST preprocessing - */ -const always = (): boolean => true; -const ifNumber = (val: unknown): boolean => typeof val === 'number'; - -/** - * - Babylon wraps the "Program" node in an extra "File" node, normalize this for simplicity for now... - * - Remove "start" and "end" values from Babylon nodes to reduce unimportant noise in diffs ("loc" data will still be in - * each final AST and compared). - * - * @param ast raw babylon AST - * @returns processed babylon AST - */ -export function preprocessBabylonAST(ast: File): any { - return omitDeep( - ast.program, - [ - { - key: 'start', - // only remove the "start" number (not the "start" object within loc) - predicate: ifNumber, - }, - { - key: 'end', - // only remove the "end" number (not the "end" object within loc) - predicate: ifNumber, - }, - { - key: 'identifierName', - predicate: always, - }, - { - key: 'extra', - predicate: always, - }, - { - key: 'innerComments', - predicate: always, - }, - { - key: 'leadingComments', - predicate: always, - }, - { - key: 'trailingComments', - predicate: always, - }, - { - key: 'guardedHandlers', - predicate: always, - }, - { - key: 'interpreter', - predicate: always, - }, - ], - { - /** - * Once we use babel 8, this can be removed. - * @see https://github.com/babel/babel/pull/13709 - */ - TSCallSignatureDeclaration(node) { - if (node.typeAnnotation) { - node.returnType = node.typeAnnotation; - delete node.typeAnnotation; - } - if (node.parameters) { - node.params = node.parameters; - delete node.parameters; - } - }, - /** - * Once we use babel 8, this can be removed. - * @see https://github.com/babel/babel/pull/13709 - */ - TSConstructSignatureDeclaration(node) { - if (node.typeAnnotation) { - node.returnType = node.typeAnnotation; - delete node.typeAnnotation; - } - if (node.parameters) { - node.params = node.parameters; - delete node.parameters; - } - }, - /** - * Once we use babel 8, this can be removed. - * @see https://github.com/babel/babel/pull/13709 - */ - TSFunctionType(node) { - if (node.typeAnnotation) { - node.returnType = node.typeAnnotation; - delete node.typeAnnotation; - } - if (node.parameters) { - node.params = node.parameters; - delete node.parameters; - } - }, - /** - * Once we use babel 8, this can be removed. - * @see https://github.com/babel/babel/pull/13709 - */ - TSConstructorType(node) { - if (node.typeAnnotation) { - node.returnType = node.typeAnnotation; - delete node.typeAnnotation; - } - if (node.parameters) { - node.params = node.parameters; - delete node.parameters; - } - }, - /** - * Once we use babel 8, this can be removed. - * @see https://github.com/babel/babel/pull/13709 - */ - TSMethodSignature(node) { - if (node.typeAnnotation) { - node.returnType = node.typeAnnotation; - delete node.typeAnnotation; - } - if (node.parameters) { - node.params = node.parameters; - delete node.parameters; - } - }, - /** - * We want this node to be different - * @see https://github.com/JamesHenry/typescript-estree/issues/109 - * @see https://github.com/prettier/prettier/pull/5728 - */ - TSTypeParameter(node: any) { - if (node.name) { - node.name = { - loc: { - start: { - column: node.loc.start.column, - line: node.loc.start.line, - }, - end: { - column: node.loc.start.column + node.name.length, - line: node.loc.start.line, - }, - }, - name: node.name, - range: [node.range[0], node.range[0] + node.name.length], - type: AST_NODE_TYPES.Identifier, - }; - } - /** - * TS 4.7: optional variance - * babel: sets in/out property as true/undefined - * ts-estree: sets in/out property as true/false - */ - if (!node.in) { - node.in = false; - } - if (!node.out) { - node.out = false; - } - }, - MethodDefinition(node) { - /** - * Babel: MethodDefinition + abstract: true - * ts-estree: TSAbstractClassProperty - */ - if (node.abstract) { - node.type = AST_NODE_TYPES.TSAbstractMethodDefinition; - delete node.abstract; - } - /** - * TS 4.3: overrides on class members - * babel: sets override property as true/undefined - * ts-estree: sets override property as true/false - */ - if (node.override == null) { - node.override = false; - } - }, - PropertyDefinition(node) { - /** - * Babel: ClassProperty + abstract: true - * ts-estree: TSAbstractClassProperty - */ - if (node.abstract) { - node.type = AST_NODE_TYPES.TSAbstractPropertyDefinition; - delete node.abstract; - node.value = null; - } - /** - * TS 3.7: declare class properties - * babel: sets declare property as true/undefined - * ts-estree: sets declare property as true/false - */ - if (!node.declare) { - node.declare = false; - } - /** - * TS 4.3: overrides on class members - * Babel doesn't ever emit a false override flag - */ - if (node.override == null) { - node.override = false; - } - }, - TSExpressionWithTypeArguments(node, parent: any) { - /** - * Babel: TSExpressionWithTypeArguments - * ts-estree: TSClassImplements or TSInterfaceHeritage - */ - if (parent.type === AST_NODE_TYPES.TSInterfaceDeclaration) { - node.type = AST_NODE_TYPES.TSInterfaceHeritage; - } else if ( - parent.type === AST_NODE_TYPES.ClassExpression || - parent.type === AST_NODE_TYPES.ClassDeclaration - ) { - node.type = AST_NODE_TYPES.TSClassImplements; - } - }, - /** - * @see https://github.com/prettier/prettier/issues/5817 - */ - FunctionExpression(node: any, parent: any) { - if (parent.typeParameters && parent.type === AST_NODE_TYPES.Property) { - node.typeParameters = parent.typeParameters; - delete parent.typeParameters; - } - - /** - * babel issue: ranges of typeParameters are not included in FunctionExpression range - */ - if ( - node.typeParameters && - node.typeParameters.range[0] < node.range[0] - ) { - node.range[0] = node.typeParameters.range[0]; - node.loc.start = Object.assign({}, node.typeParameters.loc.start); - } - - /** - * ts-estree: if there's no body, it becomes a TSEmptyBodyFunctionExpression - */ - if (!node.body) { - node.type = AST_NODE_TYPES.TSEmptyBodyFunctionExpression; - node.body = null; - } - }, - /** - * Template strings seem to also be affected by the difference in opinion between different parsers in - * @see https://github.com/babel/babel/issues/6681 - * @see https://github.com/babel/babel/blob/381277a/eslint/babel-eslint-parser/src/convert/convertAST.cjs#L81-L102 - */ - TemplateLiteral(node: any) { - for (const q of node.quasis) { - q.range[0] -= 1; - q.loc.start.column -= 1; - if (q.tail) { - q.range[1] += 1; - q.loc.end.column += 1; - } else { - q.range[1] += 2; - q.loc.end.column += 2; - } - } - }, - /** - * Remove TSParenthesizedType from babel AST. Babel 8 will stop generating the TSParenthesizedType. - * Once we use babel 8, this can be removed. - * @see https://github.com/babel/babel/pull/12608 - */ - TSParenthesizedType(node) { - const { typeAnnotation } = node; - Object.keys(node).forEach(key => delete node[key]); - Object.assign(node, typeAnnotation); - }, - /** - * babel 7.17.x introduced index property to location data to 2 node types - * @see https://github.com/babel/babel/issues/14590 - */ - TSEnumDeclaration(node: any) { - if (node.loc?.start?.index) { - delete node.loc.start.index; - } - }, - TSTypePredicate(node: any) { - if (node.loc?.start?.index) { - delete node.loc.start.index; - } - }, - /** - * ts-estree: `this` in `typeof this` has been converted from `Identifier` to `ThisExpression` - * @see https://github.com/typescript-eslint/typescript-eslint/pull/4382 - */ - TSTypeQuery(node: any) { - const { exprName } = node as TSTypeQuery; - let identifier: Identifier; - if (exprName.type === AST_NODE_TYPES.TSImportType) { - return; - } else if (exprName.type === AST_NODE_TYPES.TSQualifiedName) { - let iter = exprName; - while (iter.left.type === AST_NODE_TYPES.TSQualifiedName) { - iter = iter.left; - } - identifier = iter.left; - } else { - identifier = exprName; - } - - if (identifier.name === 'this') { - (identifier.type as string) = AST_NODE_TYPES.ThisExpression; - delete (identifier as { name?: string }).name; - } - }, - }, - ); -} - -/** - * There is currently a really awkward difference in location data for Program nodes - * between different parsers in the ecosystem. Hack around this by removing the data - * before comparing the ASTs. - * - * See: https://github.com/babel/babel/issues/6681 - * - * @param ast the raw AST with a Program node at its top level - * @param ignoreSourceType fix for issues with unambiguous type detection - * @returns the ast with the location data removed from the Program node - */ -export function removeLocationDataAndSourceTypeFromProgramNode( - ast: any, - ignoreSourceType: boolean, -): any { - delete ast.loc; - delete ast.range; - if (ignoreSourceType) { - delete ast.sourceType; - } - return ast; -} - -/** - * Returns a raw copy of the typescript AST - * @param ast the AST object - * @returns copy of the AST object - */ -export function preprocessTypescriptAST(ast: T): T { - return deeplyCopy(ast); -} diff --git a/packages/typescript-estree/tests/ast-fixtures.test.ts b/packages/typescript-estree/tests/ast-fixtures.test.ts deleted file mode 100644 index 99cf80dd80bb..000000000000 --- a/packages/typescript-estree/tests/ast-fixtures.test.ts +++ /dev/null @@ -1,119 +0,0 @@ -import fs from 'fs'; -import glob from 'glob'; -import { addSerializer } from 'jest-specific-snapshot'; -import makeDir from 'make-dir'; -import path from 'path'; - -import { parseAndGenerateServices } from '../src/parser'; -import { isJSXFileType } from '../tools/test-utils'; -import { serializer } from '../tools/tserror-serializer'; - -addSerializer(serializer); - -// Assign a segment set to this variable to limit the test to only this segment -// This is super helpful if you need to debug why a specific fixture isn't producing the correct output -// eg. ['type-declaration', 'signatures', 'method-generic.src'] will only test /type-declaration/signatures/method-generic.src.ts -// prettier-ignore -const ONLY = [].join(path.sep); - -const fixturesDir = path.resolve( - __dirname, - '..', - '..', - '..', - 'node_modules', - '@typescript-eslint', - 'shared-fixtures', - 'fixtures', -); -const snapshotsDir = path.resolve(__dirname, 'snapshots'); - -const fixtures = glob - .sync(`**/*.src.{js,ts,jsx,tsx}`, { cwd: fixturesDir, absolute: true }) - .map(absolute => { - const relative = path.relative(fixturesDir, absolute); - const { name, dir, ext } = path.parse(relative); - const segments = dir.split(path.sep); - const snapshotPath = path.join(snapshotsDir, dir); - return { - absolute, - isJsx: isJSXFileType(ext), - name, - segments, - snapshotPath, - snapshotFile: path.join(snapshotPath, `${name}${ext}.shot`), - }; - }); - -function nestDescribe( - fixture: typeof fixtures[number], - segments = fixture.segments, -): void { - if (segments.length > 0) { - describe(segments[0], () => { - nestDescribe(fixture, segments.slice(1)); - }); - } else { - const test = (): void => { - const contents = fs.readFileSync(fixture.absolute, 'utf8'); - - try { - makeDir.sync(fixture.snapshotPath); - } catch ( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - e: any - ) { - if ('code' in e && e.code === 'EEXIST') { - // already exists - ignored - } else { - throw e; - } - } - - try { - const { ast } = parseAndGenerateServices(contents, { - comment: true, - errorOnUnknownASTType: true, - jsx: fixture.isJsx, - loc: true, - range: true, - tokens: true, - }); - expect(ast).toMatchSpecificSnapshot(fixture.snapshotFile); - } catch (e) { - expect(e).toMatchSpecificSnapshot(fixture.snapshotFile); - } - }; - - if ([...fixture.segments, fixture.name].join(path.sep) === ONLY) { - // eslint-disable-next-line jest/no-focused-tests - it.only(fixture.name, test); - } else { - it(fixture.name, test); - } - } -} - -fixtures.forEach(f => nestDescribe(f)); - -if (ONLY === '') { - // ensure that the snapshots are cleaned up, because jest-specific-snapshot won't do this check - const snapshots = glob - .sync(`**/*.shot`, { cwd: snapshotsDir, absolute: true }) - .map(absolute => { - const relative = path.relative(snapshotsDir, absolute); - const { name, dir } = path.parse(relative); - return { - relative, - fixturePath: path.join(fixturesDir, dir, name), - }; - }); - - describe('ast snapshots should have an associated test', () => { - for (const snap of snapshots) { - it(snap.relative, () => { - fs.existsSync(snap.fixturePath); - }); - } - }); -} diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap index 204da250a869..f3e70c9914e8 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap @@ -1,893 +1,134 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/block-trailing-comment.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/comment-within-condition.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/export-default-anonymous-class.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsdoc-comment.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-attr-and-text-with-url.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-block-comment.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-comment-after-jsx.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-comment-after-self-closing-jsx.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-generic-with-comment-in-tag.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-tag-comment-after-prop.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-tag-comments.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-text-with-multiline-non-comment.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-text-with-url.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-with-greather-than.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-with-operators.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/line-comment-with-block-syntax.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/mix-line-and-block-comments.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/no-comment-regex.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/no-comment-template.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/surrounding-call-comments.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/surrounding-debugger-comments.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/surrounding-return-comments.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/surrounding-throw-comments.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/surrounding-while-loop-comments.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/switch-fallthrough-comment.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/switch-fallthrough-comment-in-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/switch-no-default-comment.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/switch-no-default-comment-in-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/switch-no-default-comment-in-nested-functions.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/template-string-block.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/type-assertion-regression-test.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrayLiteral/array-literal-in-lhs.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrayLiteral/array-literals-in-binary-expr.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/as-param.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/as-param-with-params.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/basic.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/basic-in-binary-expression.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/block-body.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/block-body-not-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-dup-params.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-missing-paren.src 1`] = ` -TSError { - "column": 9, - "index": 9, - "lineNumber": 1, - "message": "';' expected.", -} -`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-not-arrow.src 1`] = ` -TSError { - "column": 26, - "index": 26, - "lineNumber": 1, - "message": "Expression expected.", -} -`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-numeric-param.src 1`] = ` -TSError { - "column": 5, - "index": 5, - "lineNumber": 1, - "message": "';' expected.", -} -`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-numeric-param-multi.src 1`] = ` -TSError { - "column": 9, - "index": 9, - "lineNumber": 1, - "message": "';' expected.", -} -`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-reverse-arrow.src 1`] = ` -TSError { - "column": 1, - "index": 1, - "lineNumber": 1, - "message": "Expression expected.", -} -`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-default-param-eval.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-dup-params.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-eval.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-eval-return.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-octal.src 1`] = ` -TSError { - "column": 21, - "index": 21, - "lineNumber": 1, - "message": "Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o0'.", -} -`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-param-arguments.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-param-eval.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-param-names.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-param-no-paren-arguments.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-strict-param-no-paren-eval.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-two-lines.src 1`] = ` -TSError { - "column": 1, - "index": 12, - "lineNumber": 2, - "message": "Line terminator not permitted before arrow.", -} -`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/error-wrapped-param.src 1`] = ` -TSError { - "column": 6, - "index": 6, - "lineNumber": 1, - "message": "';' expected.", -} -`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/expression.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/iife.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/multiple-params.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/no-auto-return.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/not-strict-arguments.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/not-strict-eval.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/not-strict-eval-params.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/not-strict-octal.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/return-arrow-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/return-sequence.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/single-param.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/single-param-parens.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/arrowFunctions/single-param-return-identifier.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/and-operator-array-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/delete-expression.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/do-while-statements.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/identifiers-double-underscore.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/instanceof.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/new-with-member-expression.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/new-without-parens.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/or-operator-array-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/typeof-expression.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/update-expression.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/basics/void-expression.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/bigIntLiterals/binary.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/bigIntLiterals/decimal.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/bigIntLiterals/hex.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/bigIntLiterals/numeric-separator.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/bigIntLiterals/octal.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/binaryLiterals/invalid.src 1`] = ` -TSError { - "column": 4, - "index": 4, - "lineNumber": 1, - "message": "';' expected.", -} -`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/binaryLiterals/lowercase.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/binaryLiterals/uppercase.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/blockBindings/const.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/blockBindings/let.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/blockBindings/let-in-switchcase.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/callExpression/call-expression-with-array.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/callExpression/call-expression-with-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/callExpression/mixed-expression.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/callExpression/new-expression-with-array.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/callExpression/new-expression-with-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-accessor-properties.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-computed-static-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-expression.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-method-named-prototype.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-method-named-static.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-method-named-with-space.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-one-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-one-method-super.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-private-identifier-accessor.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-private-identifier-field.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-private-identifier-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-static-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-static-method-named-prototype.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-static-method-named-static.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-static-methods-and-accessor-properties.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-computed-static-methods.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-methods.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-methods-computed-constructor.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-methods-semi.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-methods-three-semi.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-methods-two-semi.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-two-static-methods-named-constructor.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-with-constructor.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-with-constructor-parameters.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-with-constructor-with-space.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/class-with-no-body.src 1`] = ` -TSError { - "column": 0, - "index": 10, - "lineNumber": 2, - "message": "'{' expected.", -} -`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/derived-class-assign-to-var.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/derived-class-expression.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/empty-class.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/empty-class-double-semi.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/empty-class-semi.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/empty-literal-derived-class.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/invalid-class-declaration.src 1`] = ` -TSError { - "column": 0, - "index": 0, - "lineNumber": 1, - "message": "A class declaration without the 'default' modifier must have a name.", -} -`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/invalid-class-setter-declaration.src 1`] = ` -TSError { - "column": 14, - "index": 14, - "lineNumber": 1, - "message": "A 'set' accessor must have exactly one parameter.", -} -`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/invalid-class-two-super-classes.src 1`] = ` -TSError { - "column": 18, - "index": 18, - "lineNumber": 1, - "message": "Classes can only extend a single class.", -} -`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/named-class-expression.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/classes/named-derived-class-expression.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/commaOperator/comma-operator-conditional.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/commaOperator/comma-operator-multi.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/commaOperator/comma-operator-nested.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/commaOperator/comma-operator-return.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/commaOperator/comma-operator-simple.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/commaOperator/comma-operator-simple-nested.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/defaultParams/class-constructor.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/defaultParams/class-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/defaultParams/declaration.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/defaultParams/expression.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/defaultParams/method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/defaultParams/not-all-params.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/array-member.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/array-to-array.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/array-var-undefined.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/call-expression-destruction-array.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/call-expression-destruction-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-constructor-params-array.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-constructor-params-defaults-array.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-constructor-params-defaults-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-constructor-params-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-method-params-array.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-method-params-defaults-array.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-method-params-defaults-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/class-method-params-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array-all.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array-longform-nested-multi.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array-multi.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array-nested-all.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-array-nested-multi.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-all.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-assign.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-longform.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-longform-all.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-longform-multi.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-mixed-multi.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-multi.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-nested-all.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/defaults-object-nested-multi.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/destructured-array-catch.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/destructured-object-catch.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/invalid-defaults-object-assign.src 1`] = ` -TSError { - "column": 0, - "index": 0, - "lineNumber": 1, - "message": "The left-hand side of an assignment expression must be a variable or a property access.", -} -`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/named-param.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/nested-array.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/nested-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/object-var-named.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/object-var-undefined.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/param-defaults-array.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/param-defaults-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/param-defaults-object-nested.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-array.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-array-wrapped.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-multi-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-nested-array.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-nested-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/params-object-wrapped.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring/sparse-array.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-array.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-array.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-nested-object-named.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/arrow-param-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-array.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-arrowFunctions/param-defaults-object-nested.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/array-const-undefined.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/array-let-undefined.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/object-const-named.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/object-const-undefined.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/object-let-named.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-blockBindings/object-let-undefined.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-defaultParams/param-array.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-defaultParams/param-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-defaultParams/param-object-short.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-defaultParams/param-object-wrapped.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-forOf/loop.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/complex-destructured.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/destructured-array-literal.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/destructuring-param.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/error-complex-destructured-spread-first.src 1`] = ` -TSError { - "column": 1, - "index": 1, - "lineNumber": 1, - "message": "A rest element must be last in a destructuring pattern.", -} -`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/invalid-not-final-array-empty.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/_error_/missing-body/fixture 1`] = ` TSError { - "column": 5, - "index": 5, + "column": 9, + "index": 9, "lineNumber": 1, - "message": "A rest parameter or binding pattern may not have a trailing comma.", + "message": "'{' expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/multi-destructured.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/not-final-array.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/fixture 1`] = ` TSError { - "column": 1, - "index": 1, + "column": 17, + "index": 17, "lineNumber": 1, - "message": "A rest element must be last in a destructuring pattern.", + "message": "Type argument list cannot be empty.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/single-destructured.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/var-complex-destructured.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/var-destructured-array-literal.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/var-multi-destructured.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/destructuring-and-spread/var-single-destructured.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/directives/block.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/directives/directive-in-class.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/directives/first-expression.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/directives/function-non-strict.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/directives/non-directive-string.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/directives/non-unique-directive.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/directives/program.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/directives/program-order.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/directives/raw.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalAsyncIteration/async-generators.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalAsyncIteration/async-iterator.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalDynamicImport/dynamic-import.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalDynamicImport/error-dynamic-import-params.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/fixture 1`] = ` TSError { "column": 7, "index": 7, "lineNumber": 1, - "message": "Dynamic import requires exactly one or two arguments.", + "message": "Type parameter list cannot be empty.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/arg-spread.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/destructuring-assign-mirror.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/function-parameter-object-spread.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/invalid-rest.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/fixture 1`] = ` TSError { - "column": 18, - "index": 18, + "column": 6, + "index": 6, "lineNumber": 1, - "message": "',' expected.", + "message": "'{' expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/invalid-rest-trailing-comma.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/_error_/non-identifier-type-param/fixture 1`] = ` TSError { - "column": 16, - "index": 16, + "column": 8, + "index": 8, "lineNumber": 1, - "message": "A rest parameter or binding pattern may not have a trailing comma.", + "message": "Type parameter declaration expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/object-rest.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/abstract/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/property-spread.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/declare/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/shorthand-method-args.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/decorator-many/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/shorthand-methods.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/decorator-one/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/shorthand-properties.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/empty/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/single-spread.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/extends/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/spread-trailing-comma.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/extends-literal/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalObjectRestSpread/two-spread.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/extends-type-param/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalOptionalCatchBinding/optional-catch-binding.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/implements-many/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/experimentalOptionalCatchBinding/optional-catch-binding-finally.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/implements-one/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/exponentiationOperators/exponential-operators.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/type-param/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/for/for-empty.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/for/for-loop.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ClassDeclaration/fixtures/with-member-one/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/for/for-with-coma.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportAllDeclaration/fixtures/_error_/kind-type/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/for/for-with-const.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/for/for-with-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/for/for-with-let.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-array.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-bare-nonstrict.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-destruction.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-destruction-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-object.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/fixture 1`] = ` TSError { - "column": 14, - "index": 14, + "column": 13, + "index": 13, "lineNumber": 1, - "message": "';' expected.", + "message": "Expression expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-object-with-body.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-assigment.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-bare-assigment.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-const.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-milti-asigment.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-rest.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forIn/for-in-with-var.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-array.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-destruction.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-destruction-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-with-function-initializer.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/fixture 1`] = ` TSError { - "column": 9, - "index": 9, + "column": 12, + "index": 12, "lineNumber": 1, - "message": "The variable declaration of a 'for...of' statement cannot have an initializer.", + "message": "Identifier expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-with-rest.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-with-var-and-braces.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/for-of-with-var-and-no-braces.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/invalid-for-of-with-const-and-no-braces.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/forOf/invalid-for-of-with-let-and-no-braces.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/function/return-multiline-sequence.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/function/return-sequence.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/generators/anonymous-generator.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/generators/async-generator-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/generators/async-generator-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/generators/double-yield.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/generators/empty-generator-declaration.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/generators/generator-declaration.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/generators/yield-delegation.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/generators/yield-without-value.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/generators/yield-without-value-in-call.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/generators/yield-without-value-no-semi.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/globalReturn/return-identifier.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/globalReturn/return-no-arg.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/globalReturn/return-true.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/hexLiterals/invalid.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/fixture 1`] = ` TSError { - "column": 4, - "index": 4, + "column": 13, + "index": 13, "lineNumber": 1, - "message": "';' expected.", + "message": "Module specifier must be a string literal.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/hexLiterals/lowercase.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/hexLiterals/uppercase.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/importMeta/simple-import-meta.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/labels/label-break.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/labels/label-continue.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/error-delete.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/error-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/error-strict.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-async-named-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-const.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-array.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-async-named-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-class.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-expression.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-named-class.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-named-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-number.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-default-value.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-batch.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-default.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-named-as-default.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-named-as-specifier.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-named-as-specifiers.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-specifier.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-from-specifiers.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-let.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportAllDeclaration/fixtures/_error_/type-kind/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-as-default.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportAllDeclaration/fixtures/assertion/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-as-specifier.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportAllDeclaration/fixtures/named/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-as-specifiers.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportAllDeclaration/fixtures/unnamed/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-class.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-empty.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-specifier.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-specifiers.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-named-specifiers-comma.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-var.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-var-anonymous-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/export-var-number.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-default.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-default-and-named-specifiers.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-default-and-namespace-specifiers.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-default-as.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-jquery.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-module.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-as-specifier.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-as-specifiers.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-empty.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-specifier.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-specifiers.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-named-specifiers-comma.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-namespace-specifier.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/import-null-as-nil.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-await.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-class.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-batch-missing-from-clause.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/fixture 1`] = ` TSError { - "column": 0, - "index": 9, - "lineNumber": 2, - "message": "'from' expected.", + "column": 15, + "index": 15, + "lineNumber": 1, + "message": "Expression expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-batch-token.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/fixture 1`] = ` TSError { - "column": 9, - "index": 9, + "column": 25, + "index": 25, "lineNumber": 1, - "message": "'from' expected.", + "message": "';' expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-default.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/fixture 1`] = ` TSError { "column": 20, "index": 20, @@ -896,7 +137,7 @@ TSError { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-default-equal.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/fixture 1`] = ` TSError { "column": 15, "index": 15, @@ -905,1897 +146,1811 @@ TSError { } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-default-token.src 1`] = ` -TSError { - "column": 17, - "index": 17, - "lineNumber": 1, - "message": "';' expected.", -} -`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-module-specifier.src 1`] = ` -TSError { - "column": 19, - "index": 19, - "lineNumber": 1, - "message": "Module specifier must be a string literal.", -} -`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-named-default.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-named-extra-comma.src 1`] = ` -TSError { - "column": 16, - "index": 16, - "lineNumber": 1, - "message": "Identifier expected.", -} -`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/class/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-export-named-middle-comma.src 1`] = ` -TSError { - "column": 12, - "index": 12, - "lineNumber": 1, - "message": "Identifier expected.", -} -`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/class-expression/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-default.src 1`] = ` -TSError { - "column": 7, - "index": 7, - "lineNumber": 1, - "message": "Expression expected.", -} -`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/function/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-default-after-named.src 1`] = ` -TSError { - "column": 12, - "index": 12, - "lineNumber": 1, - "message": "'from' expected.", -} -`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/identifier/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/interface/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-default-after-named-after-default.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportDefaultDeclaration/fixtures/literal/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/fixture 1`] = ` TSError { - "column": 17, - "index": 17, + "column": 14, + "index": 14, "lineNumber": 1, - "message": "'from' expected.", + "message": "Identifier expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-default-missing-module-specifier.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/fixture 1`] = ` TSError { "column": 0, - "index": 11, - "lineNumber": 2, - "message": "'=' expected.", + "index": 0, + "lineNumber": 1, + "message": "A class declaration without the 'default' modifier must have a name.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-default-module-specifier.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/fixture 1`] = ` TSError { - "column": 15, - "index": 15, + "column": 16, + "index": 16, "lineNumber": 1, - "message": "Module specifier must be a string literal.", + "message": "Identifier expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-missing-module-specifier.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/fixture 1`] = ` TSError { "column": 0, - "index": 20, - "lineNumber": 2, - "message": "'from' expected.", -} -`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-module-specifier.src 1`] = ` -TSError { - "column": 17, - "index": 17, + "index": 0, "lineNumber": 1, - "message": "Module specifier must be a string literal.", + "message": "Declaration or statement expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-named-after-named.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/fixture 1`] = ` TSError { - "column": 12, - "index": 12, + "column": 0, + "index": 0, "lineNumber": 1, - "message": "'from' expected.", + "message": "Declaration or statement expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-named-after-namespace.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/fixture 1`] = ` TSError { - "column": 15, - "index": 15, + "column": 0, + "index": 0, "lineNumber": 1, - "message": "'from' expected.", + "message": "Declaration or statement expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-named-as-missing-from.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/fixture 1`] = ` TSError { - "column": 0, - "index": 24, - "lineNumber": 2, - "message": "'from' expected.", + "column": 9, + "index": 9, + "lineNumber": 1, + "message": "Identifier expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-named-extra-comma.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/fixture 1`] = ` TSError { - "column": 16, - "index": 16, + "column": 0, + "index": 0, "lineNumber": 1, - "message": "Identifier expected.", + "message": "Declaration or statement expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-named-middle-comma.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/aliased/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/class/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/declare-function/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/enum/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/function-declaration/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/identifier-braced/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/identifier-many/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/interface/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/namespace/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/type-alias/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ExportNamedDeclaration/fixtures/variable-declaration/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/fixture 1`] = ` TSError { - "column": 12, - "index": 12, + "column": 9, + "index": 9, "lineNumber": 1, "message": "Identifier expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-namespace-after-named.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/fixture 1`] = ` TSError { "column": 12, "index": 12, "lineNumber": 1, - "message": "'from' expected.", + "message": "Type parameter list cannot be empty.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/modules/invalid-import-namespace-missing-as.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/fixture 1`] = ` TSError { "column": 9, "index": 9, "lineNumber": 1, - "message": "'as' expected.", + "message": "Identifier expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/newTarget/invalid-new-target.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/fixture 1`] = ` TSError { - "column": 8, - "index": 8, + "column": 13, + "index": 13, "lineNumber": 1, - "message": "Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.", + "message": "Type parameter declaration expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/newTarget/invalid-unknown-property.src 1`] = ` -TSError { - "column": 25, - "index": 25, - "lineNumber": 1, - "message": "'unknown_property' is not a valid meta-property for keyword 'new'. Did you mean 'target'?", -} -`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/async/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/newTarget/simple-new-target.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/empty/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteral/object-literal-in-lhs.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/generator/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/computed-addition-property.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/param-many/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/computed-and-identifier.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/param-one/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/computed-getter-and-setter.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/returnType/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/computed-string-property.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/type-param-many/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/computed-variable-property.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/FunctionDeclaration/fixtures/type-param-one/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/invalid-computed-variable-property.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/fixture 1`] = ` TSError { "column": 0, - "index": 20, - "lineNumber": 3, - "message": "':' expected.", -} -`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/invalid-standalone-computed-variable-property.src 1`] = ` -TSError { - "column": 5, - "index": 5, + "index": 0, "lineNumber": 1, - "message": "':' expected.", + "message": "Declaration or statement expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/standalone-expression.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/standalone-expression-with-addition.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralComputedProperties/standalone-expression-with-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralDuplicateProperties/error-proto-property.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/fixture 1`] = ` TSError { - "column": 1, - "index": 62, - "lineNumber": 7, - "message": "An object literal cannot have multiple properties with the same name.", + "column": 12, + "index": 12, + "lineNumber": 1, + "message": "'from' expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralDuplicateProperties/error-proto-string-property.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/fixture 1`] = ` TSError { - "column": 1, - "index": 64, - "lineNumber": 7, - "message": "An object literal cannot have multiple properties with the same name.", + "column": 9, + "index": 9, + "lineNumber": 1, + "message": "Identifier expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralDuplicateProperties/strict-duplicate-properties.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/fixture 1`] = ` TSError { - "column": 1, - "index": 39, - "lineNumber": 5, - "message": "An object literal cannot have multiple properties with the same name.", + "column": 13, + "index": 13, + "lineNumber": 1, + "message": "'from' expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralDuplicateProperties/strict-duplicate-string-properties.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/fixture 1`] = ` TSError { - "column": 1, - "index": 41, - "lineNumber": 5, - "message": "An object literal cannot have multiple properties with the same name.", + "column": 13, + "index": 13, + "lineNumber": 1, + "message": "'from' expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/invalid-method-no-braces.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/fixture 1`] = ` TSError { "column": 13, - "index": 19, - "lineNumber": 2, - "message": "'{' expected.", + "index": 13, + "lineNumber": 1, + "message": "'from' expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/method-property.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/simple-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/simple-method-named-get.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/simple-method-named-set.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/simple-method-with-argument.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/simple-method-with-string-name.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandMethods/string-name-method-property.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/objectLiteralShorthandProperties/shorthand-properties.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/octalLiterals/invalid.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/fixture 1`] = ` TSError { - "column": 4, - "index": 4, + "column": 12, + "index": 12, "lineNumber": 1, - "message": "';' expected.", + "message": "Identifier expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/octalLiterals/legacy.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/_error_/non-string-source/fixture 1`] = ` TSError { - "column": 0, - "index": 0, + "column": 18, + "index": 18, "lineNumber": 1, - "message": "Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o2343'.", + "message": "Module specifier must be a string literal.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/octalLiterals/lowercase.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/assertion/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/default/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/octalLiterals/strict-uppercase.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/default-and-named-many/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/octalLiterals/uppercase.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/default-and-named-none/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/regex/regexp-simple.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/default-and-named-one/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/regexUFlag/regex-u-extended-escape.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/default-and-namespace/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/regexUFlag/regex-u-invalid-extended-escape.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/named-many/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/regexUFlag/regex-u-simple.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/named-none/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/regexYFlag/regexp-y-simple.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/named-one/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/basic-rest.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/ImportDeclaration/fixtures/side-effect/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/class-constructor.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/_error_/async/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/class-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/error-no-default.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/fixture 1`] = ` TSError { "column": 17, "index": 17, "lineNumber": 1, - "message": "A rest parameter cannot have an initializer.", + "message": "Identifier expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/error-not-last.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/fixture 1`] = ` TSError { - "column": 14, - "index": 14, + "column": 20, + "index": 20, "lineNumber": 1, - "message": "A rest parameter must be last in a parameter list.", + "message": "Type parameter list cannot be empty.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/func-expression.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/func-expression-multi.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/invalid-rest-param.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/restParams/single-rest.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-float.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-float-negative.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-null.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-number.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-number-negative.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-string.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/simple-literals/literal-undefined.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/spread/complex-spread.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/spread/error-invalid-if.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/fixture 1`] = ` TSError { - "column": 6, - "index": 6, + "column": 17, + "index": 17, "lineNumber": 1, - "message": "Expression expected.", + "message": "Identifier expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/spread/error-invalid-sequence.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/fixture 1`] = ` TSError { - "column": 4, - "index": 4, + "column": 19, + "index": 19, "lineNumber": 1, - "message": "Expression expected.", + "message": "Type parameter declaration expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/spread/multi-function-call.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/spread/not-final-param.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/spread/simple-function-call.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/templateStrings/deeply-nested.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/templateStrings/error-octal-literal.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/templateStrings/escape-characters.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/templateStrings/expressions.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/empty/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/templateStrings/multi-line-template-string.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/generator/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/templateStrings/simple-template-string.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/param-many/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/templateStrings/single-dollar-sign.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/param-one/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/templateStrings/tagged-no-placeholders.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/returnType/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/templateStrings/tagged-template-string.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/type-param-many/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/unicodeCodePointEscapes/basic-string-literal.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/type-param-one/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/unicodeCodePointEscapes/complex-string-literal.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSDeclareFunction/fixtures/without-declare/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/unicodeCodePointEscapes/ignored.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/unicodeCodePointEscapes/invalid-empty-escape.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/fixture 1`] = ` TSError { - "column": 4, - "index": 4, + "column": 8, + "index": 8, "lineNumber": 1, - "message": "Hexadecimal digit expected.", + "message": "'{' expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/javascript/unicodeCodePointEscapes/invalid-too-large-escape.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/fixture 1`] = ` TSError { - "column": 10, - "index": 10, + "column": 5, + "index": 5, "lineNumber": 1, - "message": "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.", + "message": "Identifier expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/attributes.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/element-keyword-name.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/embedded-comment.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/embedded-conditional.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/embedded-invalid-js-identifier.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/embedded-tags.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/fixture 1`] = ` TSError { - "column": 40, - "index": 40, + "column": 5, + "index": 5, "lineNumber": 1, - "message": "Unexpected token. Did you mean \`{'>'}\` or \`>\`?", + "message": "Identifier expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/empty-placeholder.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/escape-patterns-ignored.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/escape-patterns-unknown.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSEnumDeclaration/fixtures/const/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/escape-patterns-valid.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSEnumDeclaration/fixtures/declare/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/escape-patters-multi.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSEnumDeclaration/fixtures/empty/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-attribute.src 1`] = ` -TSError { - "column": 5, - "index": 5, - "lineNumber": 1, - "message": "'{' or JSX element expected.", -} -`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSEnumDeclaration/fixtures/with-member-one/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-attribute-missing-equals.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/fixture 1`] = ` TSError { - "column": 14, - "index": 14, + "column": 11, + "index": 11, "lineNumber": 1, "message": "Identifier expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-broken-tag.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/fixture 1`] = ` TSError { - "column": 12, - "index": 12, + "column": 19, + "index": 19, "lineNumber": 1, - "message": "Unterminated string literal.", + "message": "String literal expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-computed-end-tag-name.src 1`] = ` -TSError { - "column": 2, - "index": 2, - "lineNumber": 1, - "message": "Identifier expected.", -} -`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-computed-string-end-tag-name.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/fixture 1`] = ` TSError { - "column": 2, - "index": 2, + "column": 0, + "index": 0, "lineNumber": 1, - "message": "Identifier expected.", + "message": "Declaration or statement expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-embedded-expression.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/fixture 1`] = ` TSError { - "column": 9, - "index": 9, + "column": 8, + "index": 8, "lineNumber": 1, - "message": "'}' expected.", + "message": "'=' expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-leading-dot-tag-name.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSImportEqualsDeclaration/fixtures/entity-name-many/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSImportEqualsDeclaration/fixtures/entity-name-one/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSImportEqualsDeclaration/fixtures/external-module-ref-string/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/fixture 1`] = ` TSError { - "column": 0, - "index": 0, + "column": 11, + "index": 11, "lineNumber": 1, - "message": "Expression expected.", + "message": "'{' expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-matching-placeholder-in-closing-tag.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/fixture 1`] = ` TSError { - "column": 27, - "index": 27, + "column": 19, + "index": 19, "lineNumber": 1, - "message": "'>' expected.", + "message": "'extends' list cannot be empty.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-mismatched-closing-tag.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/fixture 1`] = ` TSError { - "column": 5, - "index": 5, + "column": 10, + "index": 10, "lineNumber": 1, - "message": "Expected corresponding JSX closing tag for 'a'.", + "message": "Interface must be given a name.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-mismatched-closing-tags.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/fixture 1`] = ` TSError { - "column": 1, - "index": 1, + "column": 10, + "index": 10, "lineNumber": 1, - "message": "JSX element 'a' has no corresponding closing tag.", + "message": "Interface name cannot be '1'.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-mismatched-dot-tag-name.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/fixture 1`] = ` TSError { - "column": 9, - "index": 9, + "column": 12, + "index": 12, "lineNumber": 1, - "message": "Expected corresponding JSX closing tag for 'a.b.c'.", + "message": "Type parameter declaration expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-mismatched-namespace-tag.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/declare/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/empty/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/extends-many/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/extends-one/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/type-param-many/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/type-param-one/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSInterfaceDeclaration/fixtures/with-member-one/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/fixture 1`] = ` TSError { "column": 7, "index": 7, "lineNumber": 1, - "message": "Expected corresponding JSX closing tag for 'a:b'.", -} -`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-missing-closing-tag.src 1`] = ` -TSError { - "column": 1, - "index": 1, - "lineNumber": 1, - "message": "JSX element 'a' has no corresponding closing tag.", + "message": "Namespace name cannot be '1'.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-missing-closing-tag-attribute-placeholder.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/fixture 1`] = ` TSError { - "column": 1, - "index": 1, + "column": 8, + "index": 8, "lineNumber": 1, - "message": "JSX element 'a' has no corresponding closing tag.", + "message": "'{' expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-missing-namespace-name.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/fixture 1`] = ` TSError { - "column": 0, - "index": 0, + "column": 19, + "index": 19, "lineNumber": 1, - "message": "Expression expected.", + "message": "'{' expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-missing-namespace-value.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/fixture 1`] = ` TSError { - "column": 2, - "index": 2, + "column": 10, + "index": 10, "lineNumber": 1, "message": "Identifier expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-missing-spread-operator.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/fixture 1`] = ` TSError { - "column": 6, - "index": 6, + "column": 10, + "index": 10, "lineNumber": 1, - "message": "'...' expected.", + "message": "Namespace name cannot be '1'.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-namespace-name-with-docts.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/fixture 1`] = ` TSError { - "column": 4, - "index": 4, + "column": 11, + "index": 11, "lineNumber": 1, - "message": "Identifier expected.", + "message": "'{' expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-namespace-value-with-dots.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/global/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-no-common-parent.src 1`] = ` -TSError { - "column": 8, - "index": 8, - "lineNumber": 1, - "message": "JSX expressions must have one parent element.", -} -`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/module-declare/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-no-common-parent-with-comment.src 1`] = ` -TSError { - "column": 8, - "index": 8, - "lineNumber": 1, - "message": "JSX expressions must have one parent element.", -} -`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/module-declare-no-body/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-no-tag-name.src 1`] = ` -TSError { - "column": 0, - "index": 0, - "lineNumber": 1, - "message": "Declaration or statement expected.", -} -`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/module-id-identifier/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-placeholder-in-closing-tag.src 1`] = ` -TSError { - "column": 16, - "index": 16, - "lineNumber": 1, - "message": "'>' expected.", -} -`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/module-id-literal/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/module-id-qualified-name/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/namespace-declare/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSModuleDeclaration/fixtures/namespace-id-qualified-name/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-shorthand-fragment-no-closing.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/fixture 1`] = ` TSError { - "column": 0, - "index": 0, + "column": 19, + "index": 19, "lineNumber": 1, - "message": "JSX fragment has no corresponding closing tag.", + "message": "Identifier expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-trailing-dot-tag-name.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/fixture 1`] = ` TSError { - "column": 3, - "index": 3, + "column": 20, + "index": 20, "lineNumber": 1, "message": "Identifier expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/invalid-unexpected-comma.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSNamespaceExportDeclaration/fixtures/valid/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/fixture 1`] = ` TSError { - "column": 19, - "index": 19, + "column": 5, + "index": 5, "lineNumber": 1, - "message": "Identifier expected.", + "message": "Type alias name cannot be '1'.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/japanese-characters.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/less-than-operator.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/member-expression.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/member-expression-private.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/fixture 1`] = ` TSError { - "column": 10, - "index": 10, + "column": 7, + "index": 7, "lineNumber": 1, - "message": "Identifier expected.", + "message": "Type parameter declaration expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/member-expression-this.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/multiple-blank-spaces.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSTypeAliasDeclaration/fixtures/declare/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/namespace-this-name.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSTypeAliasDeclaration/fixtures/type-param-many/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/namespaced-attribute-and-value-inserted.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSTypeAliasDeclaration/fixtures/type-param-one/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/namespaced-name-and-attribute.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/TSTypeAliasDeclaration/fixtures/valid/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/newslines-and-entities.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/fixture 1`] = ` TSError { - "column": 8, - "index": 8, + "column": 6, + "index": 6, "lineNumber": 1, - "message": "Invalid character.", + "message": "Variable declaration expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/self-closing-tag.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/self-closing-tag-inside-tag.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/self-closing-tag-with-newline.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/fixture 1`] = ` TSError { - "column": 2, - "index": 2, + "column": 5, + "index": 5, "lineNumber": 1, - "message": "Invalid character.", + "message": "Variable declaration list cannot be empty.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/shorthand-fragment.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/VariableDeclaration/fixtures/const-with-value/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/shorthand-fragment-with-child.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/VariableDeclaration/fixtures/const-without-value/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/spread-child.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/VariableDeclaration/fixtures/declare/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/spread-operator-attribute-and-regular-attribute.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/VariableDeclaration/fixtures/let-with-value/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/spread-operator-attributes.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/VariableDeclaration/fixtures/let-without-value/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/tag-names-with-dots.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/VariableDeclaration/fixtures/multiple-declarations/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/tag-names-with-multi-dots.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/VariableDeclaration/fixtures/var-with-value/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/tag-names-with-multi-dots-multi.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/declaration/VariableDeclaration/fixtures/var-without-value/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/test-content.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/trailing-spread-operator-attribute.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/key-computed-complex/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx-useJSXTextNode/self-closing-tag-inside-tag.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/key-computed-number/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx-useJSXTextNode/test-content.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/key-computed-string/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/tsx/generic-jsx-element.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/key-number/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/tsx/generic-jsx-member-expression-private.src 1`] = ` -TSError { - "column": 22, - "index": 22, - "lineNumber": 1, - "message": "Identifier expected.", -} -`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/key-private/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/tsx/generic-jsx-opening-element.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/key-string/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/tsx/react-typed-props.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/modifier-abstract/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/babylon-convergence/type-parameter-whitespace-loc.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/modifier-abstract-with-value/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/babylon-convergence/type-parameters.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/modifier-declare/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-abstract-constructor.src 1`] = ` -TSError { - "column": 4, - "index": 43, - "lineNumber": 2, - "message": "'abstract' modifier can only appear on a class, method, or property declaration.", -} -`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/modifier-override/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-abstract-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/modifier-private/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-abstract-properties.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/modifier-protected/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-abstract-readonly-property.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/modifier-public/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-abstract-static-constructor.src 1`] = ` -TSError { - "column": 2, - "index": 41, - "lineNumber": 2, - "message": "'abstract' modifier can only appear on a class, method, or property declaration.", -} -`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/modifier-readonly/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-declare-properties.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/modifier-static/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-optional-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/no-annotation-no-value/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-override-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/no-annotation-with-value/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-class-with-override-property.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/with-annotation-no-value/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/abstract-interface.src 1`] = ` -TSError { - "column": 7, - "index": 7, - "lineNumber": 1, - "message": "'abstract' modifier can only appear on a class, method, or property declaration.", -} -`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/element/AccessorProperty/fixtures/with-annotation-with-value/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/angle-bracket-type-assertion.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/array-array/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/angle-bracket-type-assertion-arrow-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/arrow-function-with-optional-parameter.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/arrow-function-with-type-parameters.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/chained-satisfies/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/async-function-expression.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/async-function-with-var-declaration.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/await-without-async-function.src 1`] = ` -TSError { - "column": 14, - "index": 31, - "lineNumber": 2, - "message": "'await' expressions are only allowed within async functions and at the top levels of modules.", -} -`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/identifier-keyword/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/identifier-object-type/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/call-signatures.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/call-signatures-with-generics.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/cast-as-expression.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/cast-as-multi.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/cast-as-multi-assign.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/cast-as-operator.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/cast-as-simple.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/catch-clause-with-annotation.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/catch-clause-with-invalid-annotation.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/babylon-convergence/fixtures/type-parameters/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/fixture 1`] = ` TSError { - "column": 12, - "index": 19, - "lineNumber": 3, - "message": "Catch clause variable type annotation must be 'any' or 'unknown' if specified.", + "column": 2, + "index": 114, + "lineNumber": 4, + "message": "'abstract' modifier can only appear on a class, method, or property declaration.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-multi-line-keyword-abstract.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-multi-line-keyword-declare.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-private-identifier-field-with-accessibility-error.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; - -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-private-identifier-field-with-annotation.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/abstract-interface/fixture 1`] = ` +TSError { + "column": 7, + "index": 80, + "lineNumber": 3, + "message": "'abstract' modifier can only appear on a class, method, or property declaration.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-private-identifier-readonly-field.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/fixture 1`] = ` +TSError { + "column": 14, + "index": 104, + "lineNumber": 4, + "message": "'await' expressions are only allowed within async functions and at the top levels of modules.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-static-blocks.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-accessibility-modifiers.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-constructor-and-modifier.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/fixture 1`] = ` +TSError { + "column": 16, + "index": 101, + "lineNumber": 4, + "message": "'export' modifier cannot appear on a parameter.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-constructor-and-parameter-property-with-modifiers.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/fixture 1`] = ` +TSError { + "column": 57, + "index": 130, + "lineNumber": 3, + "message": "'extends' clause must precede 'implements' clause.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-constructor-and-parameter-proptery-with-override-modifier.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/fixture 1`] = ` +TSError { + "column": 16, + "index": 101, + "lineNumber": 4, + "message": "'static' modifier cannot appear on a parameter.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-constructor-and-return-type.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-constructor-and-type-parameters.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/const-assertions/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-declare-properties.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/fixture 1`] = ` +TSError { + "column": 4, + "index": 95, + "lineNumber": 4, + "message": "An enum member cannot have a numeric name.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-definite-assignment.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-export-parameter-properties.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/fixture 1`] = ` TSError { - "column": 16, - "index": 28, - "lineNumber": 2, - "message": "'export' modifier cannot appear on a parameter.", + "column": 4, + "index": 95, + "lineNumber": 4, + "message": "Computed property names are not allowed in enums.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-extends-and-implements.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/export-type-star-from/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-extends-generic.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-extends-generic-multiple.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/import-type-error/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-generic-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/fixture 1`] = ` +TSError { + "column": 9, + "index": 99, + "lineNumber": 4, + "message": "A parameter property is only allowed in a constructor implementation.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-generic-method-default.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/fixture 1`] = ` +TSError { + "column": 16, + "index": 89, + "lineNumber": 3, + "message": "Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.", +} +`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-implements.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-implements-and-extends.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/fixture 1`] = ` TSError { - "column": 57, - "index": 57, - "lineNumber": 1, - "message": "'extends' clause must precede 'implements' clause.", + "column": 2, + "index": 114, + "lineNumber": 4, + "message": "'abstract' modifier can only appear on a class, method, or property declaration.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-implements-generic.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-implements-generic-multiple.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-mixin.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-mixin-reference.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-optional-computed-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-optional-computed-property.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-optional-methods.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-optional-properties.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-optional-property-undefined.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-override-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/async-function-expression/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-override-property.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-private-optional-property.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/call-signatures/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-private-parameter-properties.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/call-signatures-with-generics/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-property-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/cast-as-expression/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-property-values.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/cast-as-multi/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-protected-parameter-properties.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/cast-as-multi-assign/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-public-parameter-properties.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/cast-as-operator/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-readonly-parameter-properties.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/cast-as-simple/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-readonly-property.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-static-parameter-properties.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/fixture 1`] = ` TSError { - "column": 16, - "index": 28, - "lineNumber": 2, - "message": "'static' modifier cannot appear on a parameter.", + "column": 12, + "index": 91, + "lineNumber": 4, + "message": "Catch clause variable type annotation must be 'any' or 'unknown' if specified.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-two-methods-computed-constructor.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-type-parameter.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-type-parameter-default.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/class-with-type-parameter-underscore.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/const-assertions.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-static-blocks/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/const-enum.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/declare-class-with-optional-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/declare-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/destructuring-assignment.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/destructuring-assignment-nested.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/destructuring-assignment-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-declare-properties/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/destructuring-assignment-property.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-definite-assignment/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/directive-in-module.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/directive-in-namespace.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-extends-generic/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/dynamic-import-with-import-assertions.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-all-with-import-assertions.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-generic-method/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-as-namespace.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-generic-method-default/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-assignment.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-implements/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-declare-const-named-enum.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-implements-generic/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-declare-named-enum.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-default-class-with-generic.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-method/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-default-class-with-multiple-generics.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-mixin/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-default-interface.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-mixin-reference/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-named-class-with-generic.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-named-class-with-multiple-generics.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-named-enum.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-optional-methods/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-named-enum-computed-number.src 1`] = ` -TSError { - "column": 4, - "index": 22, - "lineNumber": 2, - "message": "An enum member cannot have a numeric name.", -} -`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-optional-properties/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-named-enum-computed-string.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-named-enum-computed-var-ref.src 1`] = ` -TSError { - "column": 4, - "index": 22, - "lineNumber": 2, - "message": "Computed property names are not allowed in enums.", -} -`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-override-method/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-star-as-ns-from.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-override-property/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-type.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-private-optional-property/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-type-as.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-type-from.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-property-function/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-type-from-as.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-property-values/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-type-star-from.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/export-with-import-assertions.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/function-anonymus-with-type-parameters.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/function-anynomus-with-return-type.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-readonly-property/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/function-overloads.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-type-parameter/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-await.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-object-type-with-optional-properties.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-object-type-without-annotation.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/const-enum/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-type-parameters.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-type-parameters-that-have-comments.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/declare-function/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-type-parameters-with-constraint.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/destructuring-assignment/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-types.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/function-with-types-assignation.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/destructuring-assignment-object/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/global-this.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/destructuring-assignment-property/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/import-equal-declaration.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/directive-in-module/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/import-equal-type-declaration.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/directive-in-namespace/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/import-export-equal-declaration.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/import-export-equal-type-declaration.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/import-type-default.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-as-namespace/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/import-type-empty.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-assignment/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/import-type-error.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/import-type-named.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-declare-named-enum/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/import-type-named-as.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-default-class-with-generic/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/import-type-star-as-ns.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/import-with-import-assertions.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-default-interface/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-extends.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-named-class-with-generic/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-extends-multiple.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-type-parameters.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-named-enum/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-all-property-types.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-star-as-ns-from/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-construct-signature-with-parameter-accessibility.src 1`] = ` -TSError { - "column": 9, - "index": 26, - "lineNumber": 2, - "message": "A parameter property is only allowed in a constructor implementation.", -} -`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-type/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-extends-member-expression.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-type-as/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-extends-type-parameters.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-type-from/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-generic.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/export-type-from-as/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-jsdoc.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-with-optional-properties.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/function-overloads/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/interface-without-type-annotation.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/function-with-await/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/intrinsic-keyword.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/keyof-operator.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/keyword-variables.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/function-with-type-parameters/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/nested-type-arguments.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/never-type-param.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/new-target-in-arrow-function-body.src 1`] = ` -TSError { - "column": 16, - "index": 16, - "lineNumber": 1, - "message": "Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.", -} -`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/function-with-types/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/function-with-types-assignation/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/non-null-assertion-operator.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/global-this/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/null-and-undefined-type-annotations.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/import-equal-declaration/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/nullish-coalescing.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/import-equal-type-declaration/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/object-with-escaped-properties.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/import-export-equal-declaration/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/object-with-typed-methods.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/optional-chain.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/import-type-default/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/optional-chain-call.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/import-type-empty/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/optional-chain-call-with-non-null-assertion.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/import-type-named/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/optional-chain-call-with-parens.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/import-type-named-as/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/optional-chain-element-access.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/import-type-star-as-ns/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/optional-chain-element-access-with-non-null-assertion.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/import-with-import-assertions/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/optional-chain-element-access-with-parens.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/interface-extends/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/optional-chain-with-non-null-assertion.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/interface-extends-multiple/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/optional-chain-with-parens.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/interface-type-parameters/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/parenthesized-use-strict.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/interface-with-all-property-types/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/private-fields-in-in.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/readonly-arrays.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/readonly-tuples.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/interface-with-generic/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/short-circuiting-assignment-and-and.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/interface-with-jsdoc/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/short-circuiting-assignment-or-or.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/interface-with-method/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/short-circuiting-assignment-question-question.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/interface-with-optional-properties/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/symbol-type-param.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/interface-without-type-annotation/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-alias-declaration.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/intrinsic-keyword/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-alias-declaration-export.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/keyof-operator/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-alias-declaration-export-function-type.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/keyword-variables/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-alias-declaration-export-object-type.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/nested-type-arguments/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-alias-declaration-with-constrained-type-parameter.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/never-type-param/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-alias-object-without-annotation.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/non-null-assertion-operator/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion-in-arrow-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion-in-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/nullish-coalescing/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion-in-interface.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/object-with-escaped-properties/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion-in-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/object-with-typed-methods/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion-with-guard-in-arrow-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/optional-chain/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion-with-guard-in-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/optional-chain-call/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion-with-guard-in-interface.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-assertion-with-guard-in-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-guard-in-arrow-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/optional-chain-element-access/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-guard-in-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-guard-in-interface.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-guard-in-method.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-import-type.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/optional-chain-with-parens/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-import-type-with-type-parameters-in-type-reference.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/parenthesized-use-strict/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-only-export-specifiers.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/private-fields-in-in/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-only-import-specifiers.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/readonly-arrays/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-parameters-comments.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/readonly-tuples/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-parameters-comments-heritage.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/type-reference-comments.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-bigint.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-boolean.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/symbol-type-param/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-false.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-alias-declaration/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-never.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-alias-declaration-export/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-null.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-number.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-object.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-string.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-symbol.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-true.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-assertion-in-function/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-undefined.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-assertion-in-interface/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-unknown.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-assertion-in-method/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-keyword-void.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-method-signature.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/typed-this.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/union-intersection.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/unique-symbol.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/unknown-type-annotation.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-guard-in-function/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/var-with-definite-assignment.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-guard-in-interface/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/var-with-dotted-type.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-guard-in-method/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/var-with-type.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-import-type/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/basics/variable-declaration-type-annotation-spacing.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/declare/abstract-class.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-only-export-specifiers/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/declare/class.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-only-import-specifiers/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/declare/enum.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-parameters-comments/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/declare/function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/declare/interface.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/type-reference-comments/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/declare/module.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-bigint/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/declare/namespace.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-boolean/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/declare/type-alias.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-false/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/declare/variable.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-never/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-instance-member.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-null/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/accessor-decorators/accessor-decorator-factory-static-member.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-number/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/accessor-decorators/accessor-decorator-instance-member.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-object/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/accessor-decorators/accessor-decorator-static-member.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-string/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/class-decorators/class-decorator.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-symbol/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/class-decorators/class-decorator-factory.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-true/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/class-decorators/class-parameter-property.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-undefined/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/class-decorators/export-default-class-decorator.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-unknown/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/class-decorators/export-named-class-decorator.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-keyword-void/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/method-decorators/method-decorator-factory-instance-member.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-method-signature/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/method-decorators/method-decorator-factory-static-member.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/typed-this/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/method-decorators/method-decorator-instance-member.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/union-intersection/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/method-decorators/method-decorator-static-member.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/unique-symbol/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/parameter-decorators/parameter-array-pattern-decorator.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/unknown-type-annotation/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/parameter-decorators/parameter-decorator-constructor.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/var-with-dotted-type/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-instance-member.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/var-with-type/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/parameter-decorators/parameter-decorator-decorator-static-member.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/parameter-decorators/parameter-decorator-instance-member.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/class-decorators/fixtures/class-decorator/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/parameter-decorators/parameter-decorator-static-member.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/parameter-decorators/parameter-object-pattern-decorator.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/class-decorators/fixtures/class-parameter-property/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/parameter-decorators/parameter-rest-element-decorator.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/property-decorators/property-decorator-factory-instance-member.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/property-decorators/property-decorator-factory-static-member.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/comments/fixtures/type-assertion-regression-test/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/property-decorators/property-decorator-instance-member.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/declare/fixtures/abstract-class/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/property-decorators/property-decorator-static-member.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/declare/fixtures/class/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/class-empty-extends.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/declare/fixtures/enum/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/declare/fixtures/function/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/declare/fixtures/interface/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/declare/fixtures/module/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/declare/fixtures/namespace/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/declare/fixtures/type-alias/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/declare/fixtures/variable/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/fixture 1`] = ` TSError { "column": 17, - "index": 17, - "lineNumber": 1, + "index": 90, + "lineNumber": 3, "message": "'extends' list cannot be empty.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/class-empty-extends-implements.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/fixture 1`] = ` TSError { "column": 17, - "index": 17, - "lineNumber": 1, + "index": 90, + "lineNumber": 3, "message": "'extends' list cannot be empty.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/class-extends-empty-implements.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/fixture 1`] = ` TSError { "column": 32, - "index": 32, - "lineNumber": 1, + "index": 105, + "lineNumber": 3, "message": "'implements' list cannot be empty.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/class-multiple-implements.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/fixture 1`] = ` TSError { "column": 21, - "index": 21, - "lineNumber": 1, + "index": 94, + "lineNumber": 3, "message": "'implements' clause already seen.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/decorator-on-enum-declaration.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/fixture 1`] = ` TSError { "column": 0, - "index": 0, - "lineNumber": 1, + "index": 73, + "lineNumber": 3, "message": "Decorators are not valid here.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/decorator-on-function.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/fixture 1`] = ` TSError { "column": 0, - "index": 0, - "lineNumber": 1, + "index": 73, + "lineNumber": 3, "message": "Decorators are not valid here.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/decorator-on-interface-declaration.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/fixture 1`] = ` TSError { "column": 0, - "index": 0, - "lineNumber": 1, + "index": 73, + "lineNumber": 3, "message": "Decorators are not valid here.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/decorator-on-variable.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/fixture 1`] = ` TSError { "column": 0, - "index": 0, - "lineNumber": 1, + "index": 73, + "lineNumber": 3, "message": "Decorators are not valid here.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/empty-type-arguments.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/fixture 1`] = ` TSError { "column": 14, - "index": 14, - "lineNumber": 1, + "index": 87, + "lineNumber": 3, "message": "Type argument list cannot be empty.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/empty-type-arguments-in-call-expression.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/fixture 1`] = ` TSError { "column": 3, - "index": 3, - "lineNumber": 1, + "index": 76, + "lineNumber": 3, "message": "Type argument list cannot be empty.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/empty-type-arguments-in-new-expression.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/fixture 1`] = ` TSError { "column": 7, - "index": 7, - "lineNumber": 1, + "index": 80, + "lineNumber": 3, "message": "Type argument list cannot be empty.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/empty-type-parameters.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/fixture 1`] = ` TSError { "column": 11, - "index": 11, - "lineNumber": 1, + "index": 84, + "lineNumber": 3, "message": "Type parameter list cannot be empty.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/empty-type-parameters-in-arrow-function.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/fixture 1`] = ` TSError { "column": 11, - "index": 11, - "lineNumber": 1, + "index": 84, + "lineNumber": 3, "message": "Type parameter list cannot be empty.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/empty-type-parameters-in-constructor.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/fixture 1`] = ` TSError { "column": 13, - "index": 25, - "lineNumber": 2, + "index": 98, + "lineNumber": 4, "message": "Type parameter list cannot be empty.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/empty-type-parameters-in-function-expression.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/fixture 1`] = ` TSError { "column": 20, - "index": 20, - "lineNumber": 1, + "index": 93, + "lineNumber": 3, "message": "Type parameter list cannot be empty.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/empty-type-parameters-in-method.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/fixture 1`] = ` TSError { "column": 6, - "index": 18, - "lineNumber": 2, + "index": 91, + "lineNumber": 4, "message": "Type parameter list cannot be empty.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/empty-type-parameters-in-method-signature.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/fixture 1`] = ` TSError { "column": 6, - "index": 22, - "lineNumber": 2, + "index": 95, + "lineNumber": 4, "message": "Type parameter list cannot be empty.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/enum-with-keywords.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/fixture 1`] = ` TSError { "column": 7, - "index": 7, - "lineNumber": 1, + "index": 80, + "lineNumber": 3, "message": "'private' modifier cannot appear on a module or namespace element.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/index-signature-parameters.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/fixture 1`] = ` TSError { "column": 3, - "index": 16, - "lineNumber": 2, + "index": 89, + "lineNumber": 4, "message": "An index signature must have exactly one parameter.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-empty-extends.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/fixture 1`] = ` TSError { "column": 21, - "index": 21, - "lineNumber": 1, + "index": 94, + "lineNumber": 3, "message": "'extends' list cannot be empty.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-implements.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/fixture 1`] = ` TSError { "column": 12, - "index": 12, - "lineNumber": 1, + "index": 85, + "lineNumber": 3, "message": "Interface declaration cannot have 'implements' clause.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-index-signature-export.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/fixture 1`] = ` TSError { "column": 2, - "index": 18, - "lineNumber": 2, + "index": 91, + "lineNumber": 4, "message": "'export' modifier cannot appear on an index signature.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-index-signature-private.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/fixture 1`] = ` TSError { "column": 2, - "index": 18, - "lineNumber": 2, + "index": 91, + "lineNumber": 4, "message": "'private' modifier cannot appear on an index signature.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-index-signature-protected.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/fixture 1`] = ` TSError { "column": 2, - "index": 18, - "lineNumber": 2, + "index": 91, + "lineNumber": 4, "message": "'protected' modifier cannot appear on an index signature.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-index-signature-public.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/fixture 1`] = ` TSError { "column": 2, - "index": 18, - "lineNumber": 2, + "index": 91, + "lineNumber": 4, "message": "'public' modifier cannot appear on an index signature.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-index-signature-static.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/fixture 1`] = ` TSError { "column": 2, - "index": 18, - "lineNumber": 2, + "index": 91, + "lineNumber": 4, "message": "'static' modifier cannot appear on an index signature.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-method-export.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/fixture 1`] = ` TSError { "column": 4, - "index": 20, - "lineNumber": 2, + "index": 93, + "lineNumber": 4, "message": "'export' modifier cannot appear on a type member.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-method-private.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/fixture 1`] = ` TSError { "column": 4, - "index": 20, - "lineNumber": 2, + "index": 93, + "lineNumber": 4, "message": "'private' modifier cannot appear on a type member.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-method-protected.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/fixture 1`] = ` TSError { "column": 2, - "index": 18, - "lineNumber": 2, + "index": 91, + "lineNumber": 4, "message": "'protected' modifier cannot appear on a type member.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-method-public.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/fixture 1`] = ` TSError { "column": 4, - "index": 20, - "lineNumber": 2, + "index": 93, + "lineNumber": 4, "message": "'public' modifier cannot appear on a type member.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-method-readonly.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-method-static.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/fixture 1`] = ` TSError { "column": 2, - "index": 18, - "lineNumber": 2, + "index": 91, + "lineNumber": 4, "message": "'static' modifier cannot appear on a type member.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-multiple-extends.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/fixture 1`] = ` TSError { "column": 26, - "index": 26, - "lineNumber": 1, + "index": 99, + "lineNumber": 3, "message": "'extends' clause already seen.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-export.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/fixture 1`] = ` TSError { "column": 2, - "index": 18, - "lineNumber": 2, + "index": 91, + "lineNumber": 4, "message": "'export' modifier cannot appear on a type member.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-private.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/fixture 1`] = ` TSError { "column": 2, - "index": 18, - "lineNumber": 2, + "index": 91, + "lineNumber": 4, "message": "'private' modifier cannot appear on a type member.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-protected.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/fixture 1`] = ` TSError { "column": 2, - "index": 18, - "lineNumber": 2, + "index": 91, + "lineNumber": 4, "message": "'protected' modifier cannot appear on a type member.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-public.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/fixture 1`] = ` TSError { "column": 4, - "index": 20, - "lineNumber": 2, + "index": 93, + "lineNumber": 4, "message": "'public' modifier cannot appear on a type member.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-static.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/fixture 1`] = ` TSError { "column": 2, - "index": 18, - "lineNumber": 2, + "index": 91, + "lineNumber": 4, "message": "'static' modifier cannot appear on a type member.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-property-with-default-value.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/fixture 1`] = ` TSError { "column": 16, - "index": 32, - "lineNumber": 2, + "index": 105, + "lineNumber": 4, "message": "An interface property cannot have an initializer.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-with-no-body.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/fixture 1`] = ` TSError { "column": 0, - "index": 14, - "lineNumber": 2, + "index": 87, + "lineNumber": 4, "message": "'{' expected.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/interface-with-optional-index-signature.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/object-assertion-not-allowed.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/fixture 1`] = ` TSError { "column": 3, - "index": 3, - "lineNumber": 1, + "index": 76, + "lineNumber": 3, "message": "A definite assignment assertion '!' is not permitted in this context.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/object-optional-not-allowed.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/fixture 1`] = ` TSError { "column": 3, - "index": 3, - "lineNumber": 1, + "index": 76, + "lineNumber": 3, "message": "An object member cannot be declared optional.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/errorRecovery/solo-const.src 1`] = ` +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/fixture 1`] = ` TSError { "column": 5, - "index": 5, - "lineNumber": 1, + "index": 78, + "lineNumber": 3, "message": "Variable declaration list cannot be empty.", } `; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/expressions/call-expression-type-arguments.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/fixture 1`] = ` +TSError { + "column": 7, + "index": 87, + "lineNumber": 5, + "message": "Expression expected.", +} +`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/expressions/instantiation-expression.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/expressions/new-expression-type-arguments.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/expressions/optional-call-expression-type-arguments.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/expressions/tagged-template-expression-type-arguments.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/ambient-module-declaration-with-import.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/declare-namespace-with-exported-function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/global-module-declaration.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/module-with-default-exports.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/nested-internal-module.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/shorthand-ambient-module-declaration.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/array-type.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/array-type/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/conditional.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/conditional/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/conditional-infer.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/conditional-infer/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/conditional-infer-nested.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/conditional-infer-nested/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/conditional-infer-simple.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/conditional-infer-simple/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/conditional-infer-with-constraint.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/conditional-with-null.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/conditional-with-null/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/constructor.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/constructor/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/constructor-abstract.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/constructor-abstract/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/constructor-empty.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/constructor-empty/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/constructor-generic.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/constructor-generic/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/constructor-in-generic.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/constructor-in-generic/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/constructor-with-rest.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/constructor-with-rest/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/function.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/function/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/function-generic.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/function-generic/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/function-in-generic.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/function-in-generic/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/function-with-array-destruction.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/function-with-array-destruction/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/function-with-object-destruction.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/function-with-object-destruction/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/function-with-rest.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/function-with-rest/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/function-with-this.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/function-with-this/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/index-signature.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/index-signature/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/index-signature-readonly.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/index-signature-readonly/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/index-signature-without-type.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/index-signature-without-type/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/indexed.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/indexed/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/interface-with-accessors.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/interface-with-accessors/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/intersection-type.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/intersection-type/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/literal-number.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/literal-number/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/literal-number-negative.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/literal-number-negative/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/literal-string.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/literal-string/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/mapped.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/mapped/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/mapped-named-type.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/mapped-named-type/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/mapped-readonly.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/mapped-readonly/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/mapped-readonly-minus.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/mapped-readonly-minus/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/mapped-readonly-plus.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/mapped-readonly-plus/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/mapped-untypped.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/mapped-untypped/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/nested-types.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/nested-types/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/object-literal-type-with-accessors.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/optional-variance-in.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/optional-variance-in/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/optional-variance-in-and-out.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/optional-variance-in-and-out/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/optional-variance-in-out.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/optional-variance-in-out/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/optional-variance-out.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/optional-variance-out/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/parenthesized-type.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/parenthesized-type/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/reference.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/reference/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/reference-generic.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/reference-generic/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/reference-generic-nested.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/reference-generic-nested/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/template-literal-type-1.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/template-literal-type-1/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/template-literal-type-2.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/template-literal-type-2/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/template-literal-type-3.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/template-literal-type-3/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/template-literal-type-4.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/template-literal-type-4/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/this-type.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/this-type/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/this-type-expanded.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/this-type-expanded/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/tuple.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/tuple/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/tuple-empty.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/tuple-empty/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/tuple-named.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/tuple-named/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/tuple-named-optional.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/tuple-named-optional/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/tuple-named-rest.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/tuple-named-rest/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/tuple-named-type.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/tuple-named-type/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/tuple-optional.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/tuple-optional/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/tuple-rest.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/tuple-rest/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/tuple-type.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/tuple-type/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/type-literal.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/type-literal/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/type-operator.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/type-operator/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/typeof.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/typeof/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/typeof-this.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/typeof-this/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/typeof-with-type-parameters.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/typeof-with-type-parameters/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/union-intersection.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/union-intersection/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; -exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/union-type.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/legacy-fixtures/types/fixtures/union-type/fixture 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.test.ts b/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.test.ts index a512e56f93ca..b87abc896cbe 100644 --- a/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.test.ts +++ b/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.test.ts @@ -10,9 +10,9 @@ import { serializer } from '../../tools/tserror-serializer'; * Process all fixtures, we will only snapshot the ones that have semantic errors * which are ignored by default parsing logic. */ -const FIXTURES_DIR = path.join(__dirname, '../../../shared-fixtures/fixtures'); +const FIXTURES_DIR = path.join(__dirname, '../../../ast-spec/src'); -const testFiles = glob.sync('**/*.src.*', { +const testFiles = glob.sync('**/fixture.ts', { cwd: FIXTURES_DIR, }); From 24fdfc827c0689d0b56af62304bbcf4f746340fc Mon Sep 17 00:00:00 2001 From: Muhammad Hammad <33136628+mhnaeem@users.noreply.github.com> Date: Thu, 9 Feb 2023 21:33:20 -0500 Subject: [PATCH 03/15] chore(website): link every rule doc to the playground with default config (#6317) Co-authored-by: Josh Goldberg --- .../website/plugins/generated-rule-docs.ts | 56 +++++++++++++++---- .../MDXComponents/TryInPlayground.module.css | 3 + .../theme/MDXComponents/TryInPlayground.tsx | 19 +++++++ .../website/src/theme/MDXComponents/index.tsx | 2 + 4 files changed, 68 insertions(+), 12 deletions(-) create mode 100644 packages/website/src/theme/MDXComponents/TryInPlayground.module.css create mode 100644 packages/website/src/theme/MDXComponents/TryInPlayground.tsx diff --git a/packages/website/plugins/generated-rule-docs.ts b/packages/website/plugins/generated-rule-docs.ts index 90f0b3fa6f70..d29d240c91fc 100644 --- a/packages/website/plugins/generated-rule-docs.ts +++ b/packages/website/plugins/generated-rule-docs.ts @@ -4,6 +4,7 @@ import * as fs from 'fs'; import type { JSONSchema7 } from 'json-schema'; import type { JSONSchema } from 'json-schema-to-typescript'; import { compile } from 'json-schema-to-typescript'; +import * as lz from 'lzstring.ts'; import type * as mdast from 'mdast'; import { EOL } from 'os'; import * as path from 'path'; @@ -193,35 +194,62 @@ export const generatedRuleDocs: Plugin = () => { type: 'paragraph', } as mdast.Paragraph); + /** + * @param withComment Whether to include a full comment note. + * @remarks `withComment` can't be used inside a JSON object which is needed for eslintrc in the playground + */ + const getEslintrcString = (withComment: boolean): string => { + return `{ + "rules": {${ + withComment + ? '\n // Note: you must disable the base rule as it can report incorrect errors' + : '' + } + "${extendsBaseRuleName}": "off", + "@typescript-eslint/${file.stem}": "${optionLevel}" + } +}`; + }; + root.children.splice(howToUseH2Index + 1, 0, { lang: 'js', type: 'code', meta: 'title=".eslintrc.cjs"', - value: `module.exports = { - "rules": { - // Note: you must disable the base rule as it can report incorrect errors - "${extendsBaseRuleName}": "off", - "@typescript-eslint/${file.stem}": "${optionLevel}" - } -};`, + value: `module.exports = ${getEslintrcString(true)};`, } as mdast.Code); + + root.children.splice(howToUseH2Index + 2, 0, { + value: ``, + type: 'jsx', + } as unist.Node); } else { // For non-extended rules, the code snippet is placed before the first h2 // (i.e. at the end of the initial explanation) const firstH2Index = root.children.findIndex( child => nodeIsHeading(child) && child.depth === 2, ); + + const getEslintrcString = `{ + "rules": { + "@typescript-eslint/${file.stem}": "${optionLevel}" + } +}`; root.children.splice(firstH2Index, 0, { lang: 'js', type: 'code', meta: 'title=".eslintrc.cjs"', - value: `module.exports = { - "rules": { - "@typescript-eslint/${file.stem}": "${optionLevel}" - } -};`, + value: `module.exports = ${getEslintrcString};`, } as mdast.Code); + root.children.splice(firstH2Index + 1, 0, { + value: ``, + type: 'jsx', + } as unist.Node); + if (meta.schema.length === 0) { root.children.splice(optionsH2Index + 1, 0, { children: [ @@ -395,6 +423,10 @@ export const generatedRuleDocs: Plugin = () => { }; }; +function convertToPlaygroundHash(eslintrc: string): string { + return lz.LZString.compressToEncodedURIComponent(eslintrc); +} + function nodeIsHeading(node: unist.Node): node is mdast.Heading { return node.type === 'heading'; } diff --git a/packages/website/src/theme/MDXComponents/TryInPlayground.module.css b/packages/website/src/theme/MDXComponents/TryInPlayground.module.css new file mode 100644 index 000000000000..2830e4da6ec0 --- /dev/null +++ b/packages/website/src/theme/MDXComponents/TryInPlayground.module.css @@ -0,0 +1,3 @@ +.tryInPlaygroundLink { + float: right; +} diff --git a/packages/website/src/theme/MDXComponents/TryInPlayground.tsx b/packages/website/src/theme/MDXComponents/TryInPlayground.tsx new file mode 100644 index 000000000000..d9b096f1d909 --- /dev/null +++ b/packages/website/src/theme/MDXComponents/TryInPlayground.tsx @@ -0,0 +1,19 @@ +import React from 'react'; + +import styles from './TryInPlayground.module.css'; + +export function TryInPlayground({ + eslintrcHash, +}: { + eslintrcHash: string; +}): React.ReactNode { + return ( + + Try this rule in the playground ↗ + + ); +} diff --git a/packages/website/src/theme/MDXComponents/index.tsx b/packages/website/src/theme/MDXComponents/index.tsx index 70fa555536b5..c810e8b72833 100644 --- a/packages/website/src/theme/MDXComponents/index.tsx +++ b/packages/website/src/theme/MDXComponents/index.tsx @@ -1,9 +1,11 @@ import MDXComponents from '@theme-original/MDXComponents'; import { RuleAttributes } from './RuleAttributes'; +import { TryInPlayground } from './TryInPlayground'; // eslint-disable-next-line import/no-default-export export default { ...MDXComponents, 'rule-attributes': RuleAttributes, + 'try-in-playground': TryInPlayground, }; From 2f948df35b73d916e7fe42b21343568b1617e3f1 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Fri, 10 Feb 2023 13:35:03 +1030 Subject: [PATCH 04/15] feat(typescript-estree): add `.kind` to `TSModuleDeclaration` (#6443) --- .../namespace/snapshots/1-TSESTree-AST.shot | 1 + .../snapshots/5-AST-Alignment-AST.shot | 59 ++++++++- .../global/snapshots/1-TSESTree-AST.shot | 1 + .../global/snapshots/5-AST-Alignment-AST.shot | 48 +++++++- .../snapshots/1-TSESTree-AST.shot | 1 + .../snapshots/5-AST-Alignment-AST.shot | 38 +++++- .../snapshots/1-TSESTree-AST.shot | 1 + .../snapshots/5-AST-Alignment-AST.shot | 47 ++++++- .../snapshots/1-TSESTree-AST.shot | 1 + .../snapshots/5-AST-Alignment-AST.shot | 46 ++++++- .../snapshots/1-TSESTree-AST.shot | 1 + .../snapshots/5-AST-Alignment-AST.shot | 47 ++++++- .../snapshots/1-TSESTree-AST.shot | 3 + .../snapshots/5-AST-Alignment-AST.shot | 86 ++++++++++++- .../snapshots/1-TSESTree-AST.shot | 1 + .../snapshots/5-AST-Alignment-AST.shot | 47 ++++++- .../snapshots/1-TSESTree-AST.shot | 1 + .../snapshots/5-AST-Alignment-AST.shot | 46 ++++++- .../snapshots/1-TSESTree-AST.shot | 3 + .../snapshots/5-AST-Alignment-AST.shot | 86 ++++++++++++- .../declaration/TSModuleDeclaration/spec.ts | 116 +++++++++++++++--- .../snapshots/1-TSESTree-AST.shot | 1 + .../snapshots/5-AST-Alignment-AST.shot | 1 + .../snapshots/1-TSESTree-AST.shot | 1 + .../snapshots/5-AST-Alignment-AST.shot | 1 + .../module/snapshots/1-TSESTree-AST.shot | 1 + .../module/snapshots/5-AST-Alignment-AST.shot | 47 ++++++- .../namespace/snapshots/1-TSESTree-AST.shot | 1 + .../snapshots/5-AST-Alignment-AST.shot | 47 ++++++- .../snapshots/1-TSESTree-AST.shot | 1 + .../snapshots/5-AST-Alignment-AST.shot | 1 + .../snapshots/1-TSESTree-AST.shot | 1 + .../snapshots/5-AST-Alignment-AST.shot | 1 + .../snapshots/1-TSESTree-AST.shot | 3 + .../snapshots/5-AST-Alignment-AST.shot | 111 ++++++++++++++++- .../snapshots/1-TSESTree-AST.shot | 1 + .../snapshots/5-AST-Alignment-AST.shot | 1 + .../snapshots/1-TSESTree-AST.shot | 2 + .../snapshots/5-AST-Alignment-AST.shot | 2 + .../snapshots/1-TSESTree-AST.shot | 1 + .../snapshots/5-AST-Alignment-AST.shot | 38 +++++- .../tests/fixtures-with-differences-ast.shot | 14 +++ packages/typescript-estree/src/convert.ts | 65 ++++++++-- .../basics/directive-in-module.src.ts.shot | 1 + .../basics/directive-in-namespace.src.ts.shot | 1 + .../typescript/declare/module.src.ts.shot | 1 + .../typescript/declare/namespace.src.ts.shot | 1 + ...module-declaration-with-import.src.ts.shot | 1 + ...mespace-with-exported-function.src.ts.shot | 1 + .../global-module-declaration.src.ts.shot | 3 + .../module-with-default-exports.src.ts.shot | 1 + .../nested-internal-module.src.ts.shot | 2 + ...and-ambient-module-declaration.src.ts.shot | 1 + 53 files changed, 997 insertions(+), 38 deletions(-) diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/1-TSESTree-AST.shot index 8bee64090fc2..70aa834e1993 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/1-TSESTree-AST.shot @@ -29,6 +29,7 @@ Program { end: { column: 20, line: 1 }, }, }, + kind: "namespace", range: [7, 23], loc: { diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot index 00a19c01c581..d9b1ab535bb8 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot @@ -2,5 +2,62 @@ exports[`AST Fixtures declaration ExportNamedDeclaration namespace AST Alignment - AST 1`] = ` "Snapshot Diff: -Compared values have no visual difference." +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleBlock { + type: 'TSModuleBlock', + body: Array [], + + range: [21, 23], + loc: { + start: { column: 21, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [17, 20], + loc: { + start: { column: 17, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, +- kind: 'namespace', + + range: [7, 23], + loc: { + start: { column: 7, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + exportKind: 'value', + source: null, + specifiers: Array [], + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + ], + sourceType: 'module', + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" `; diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/global/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/global/snapshots/1-TSESTree-AST.shot index 424909a0e10c..6d845973debe 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/global/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/global/snapshots/1-TSESTree-AST.shot @@ -28,6 +28,7 @@ Program { end: { column: 14, line: 1 }, }, }, + kind: "global", range: [0, 17], loc: { diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/global/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/global/snapshots/5-AST-Alignment-AST.shot index bdf259261537..5dc4161ad9a4 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/global/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/global/snapshots/5-AST-Alignment-AST.shot @@ -2,5 +2,51 @@ exports[`AST Fixtures declaration TSModuleDeclaration global AST Alignment - AST 1`] = ` "Snapshot Diff: -Compared values have no visual difference." +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleBlock { + type: 'TSModuleBlock', + body: Array [], + + range: [15, 17], + loc: { + start: { column: 15, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + declare: true, + global: true, + id: Identifier { + type: 'Identifier', + name: 'global', + + range: [8, 14], + loc: { + start: { column: 8, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, +- kind: 'global', + + range: [0, 17], + loc: { + start: { column: 0, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 18], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" `; diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare-no-body/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare-no-body/snapshots/1-TSESTree-AST.shot index a0ad297f73cd..17f754710762 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare-no-body/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare-no-body/snapshots/1-TSESTree-AST.shot @@ -18,6 +18,7 @@ Program { end: { column: 18, line: 1 }, }, }, + kind: "module", range: [0, 19], loc: { diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare-no-body/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare-no-body/snapshots/5-AST-Alignment-AST.shot index 29dc0c7a7765..591ea8c8d32e 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare-no-body/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare-no-body/snapshots/5-AST-Alignment-AST.shot @@ -2,5 +2,41 @@ exports[`AST Fixtures declaration TSModuleDeclaration module-declare-no-body AST Alignment - AST 1`] = ` "Snapshot Diff: -Compared values have no visual difference." +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSModuleDeclaration { + type: 'TSModuleDeclaration', + declare: true, + id: Literal { + type: 'Literal', + raw: '\\\\'a\\\\'', + value: 'a', + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, +- kind: 'module', + + range: [0, 19], + loc: { + start: { column: 0, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 20], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" `; diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare/snapshots/1-TSESTree-AST.shot index 74a329eeb585..026bdc26251d 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare/snapshots/1-TSESTree-AST.shot @@ -27,6 +27,7 @@ Program { end: { column: 16, line: 1 }, }, }, + kind: "module", range: [0, 19], loc: { diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare/snapshots/5-AST-Alignment-AST.shot index d70930f793c0..75dd7304dfaa 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare/snapshots/5-AST-Alignment-AST.shot @@ -2,5 +2,50 @@ exports[`AST Fixtures declaration TSModuleDeclaration module-declare AST Alignment - AST 1`] = ` "Snapshot Diff: -Compared values have no visual difference." +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleBlock { + type: 'TSModuleBlock', + body: Array [], + + range: [17, 19], + loc: { + start: { column: 17, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + declare: true, + id: Identifier { + type: 'Identifier', + name: 'F', + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, +- kind: 'module', + + range: [0, 19], + loc: { + start: { column: 0, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 20], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" `; diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-identifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-identifier/snapshots/1-TSESTree-AST.shot index 3559c1ce1a19..80f52eaeaa38 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-identifier/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-identifier/snapshots/1-TSESTree-AST.shot @@ -26,6 +26,7 @@ Program { end: { column: 8, line: 1 }, }, }, + kind: "module", range: [0, 11], loc: { diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-identifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-identifier/snapshots/5-AST-Alignment-AST.shot index 829de93e3df2..36a5fb1365f5 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-identifier/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-identifier/snapshots/5-AST-Alignment-AST.shot @@ -2,5 +2,49 @@ exports[`AST Fixtures declaration TSModuleDeclaration module-id-identifier AST Alignment - AST 1`] = ` "Snapshot Diff: -Compared values have no visual difference." +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleBlock { + type: 'TSModuleBlock', + body: Array [], + + range: [9, 11], + loc: { + start: { column: 9, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'F', + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, +- kind: 'module', + + range: [0, 11], + loc: { + start: { column: 0, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 12], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" `; diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-literal/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-literal/snapshots/1-TSESTree-AST.shot index da4f7cdc9afb..543f49f139cc 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-literal/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-literal/snapshots/1-TSESTree-AST.shot @@ -27,6 +27,7 @@ Program { end: { column: 10, line: 1 }, }, }, + kind: "module", range: [0, 13], loc: { diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-literal/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-literal/snapshots/5-AST-Alignment-AST.shot index f13f22dfe7df..629052e8a659 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-literal/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-literal/snapshots/5-AST-Alignment-AST.shot @@ -2,5 +2,50 @@ exports[`AST Fixtures declaration TSModuleDeclaration module-id-literal AST Alignment - AST 1`] = ` "Snapshot Diff: -Compared values have no visual difference." +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleBlock { + type: 'TSModuleBlock', + body: Array [], + + range: [11, 13], + loc: { + start: { column: 11, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + id: Literal { + type: 'Literal', + raw: '\\\\'a\\\\'', + value: 'a', + + range: [7, 10], + loc: { + start: { column: 7, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, +- kind: 'module', + + range: [0, 13], + loc: { + start: { column: 0, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 14], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" `; diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-qualified-name/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-qualified-name/snapshots/1-TSESTree-AST.shot index 3dfc069dda7e..c0f09867e6f5 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-qualified-name/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-qualified-name/snapshots/1-TSESTree-AST.shot @@ -30,6 +30,7 @@ Program { end: { column: 12, line: 1 }, }, }, + kind: "module", range: [11, 15], loc: { @@ -47,6 +48,7 @@ Program { end: { column: 10, line: 1 }, }, }, + kind: "module", range: [9, 15], loc: { @@ -64,6 +66,7 @@ Program { end: { column: 8, line: 1 }, }, }, + kind: "module", range: [0, 15], loc: { diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-qualified-name/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-qualified-name/snapshots/5-AST-Alignment-AST.shot index d442f261db29..9c2311d4b6f6 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-qualified-name/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-qualified-name/snapshots/5-AST-Alignment-AST.shot @@ -2,5 +2,89 @@ exports[`AST Fixtures declaration TSModuleDeclaration module-id-qualified-name AST Alignment - AST 1`] = ` "Snapshot Diff: -Compared values have no visual difference." +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleBlock { + type: 'TSModuleBlock', + body: Array [], + + range: [13, 15], + loc: { + start: { column: 13, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'C', + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, +- kind: 'module', + + range: [11, 15], + loc: { + start: { column: 11, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'B', + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, +- kind: 'module', + + range: [9, 15], + loc: { + start: { column: 9, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'A', + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, +- kind: 'module', + + range: [0, 15], + loc: { + start: { column: 0, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 16], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" `; diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-declare/snapshots/1-TSESTree-AST.shot index c373a655222a..d808958c70e3 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-declare/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-declare/snapshots/1-TSESTree-AST.shot @@ -27,6 +27,7 @@ Program { end: { column: 19, line: 1 }, }, }, + kind: "namespace", range: [0, 22], loc: { diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-declare/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-declare/snapshots/5-AST-Alignment-AST.shot index 614b9695a3cf..48f1c28a6f60 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-declare/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-declare/snapshots/5-AST-Alignment-AST.shot @@ -2,5 +2,50 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-declare AST Alignment - AST 1`] = ` "Snapshot Diff: -Compared values have no visual difference." +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleBlock { + type: 'TSModuleBlock', + body: Array [], + + range: [20, 22], + loc: { + start: { column: 20, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + declare: true, + id: Identifier { + type: 'Identifier', + name: 'F', + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, +- kind: 'namespace', + + range: [0, 22], + loc: { + start: { column: 0, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" `; diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/snapshots/1-TSESTree-AST.shot index e6303e2d3edc..05e6c65aa804 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/snapshots/1-TSESTree-AST.shot @@ -26,6 +26,7 @@ Program { end: { column: 11, line: 1 }, }, }, + kind: "namespace", range: [0, 14], loc: { diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/snapshots/5-AST-Alignment-AST.shot index a0aa056256bc..1d16afdfbbb7 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/snapshots/5-AST-Alignment-AST.shot @@ -2,5 +2,49 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-id-identifier AST Alignment - AST 1`] = ` "Snapshot Diff: -Compared values have no visual difference." +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleBlock { + type: 'TSModuleBlock', + body: Array [], + + range: [12, 14], + loc: { + start: { column: 12, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'F', + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, +- kind: 'namespace', + + range: [0, 14], + loc: { + start: { column: 0, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 15], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" `; diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-qualified-name/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-qualified-name/snapshots/1-TSESTree-AST.shot index 98cd5bbe8176..69dbfa38ebbd 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-qualified-name/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-qualified-name/snapshots/1-TSESTree-AST.shot @@ -30,6 +30,7 @@ Program { end: { column: 15, line: 1 }, }, }, + kind: "namespace", range: [14, 18], loc: { @@ -47,6 +48,7 @@ Program { end: { column: 13, line: 1 }, }, }, + kind: "namespace", range: [12, 18], loc: { @@ -64,6 +66,7 @@ Program { end: { column: 11, line: 1 }, }, }, + kind: "namespace", range: [0, 18], loc: { diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-qualified-name/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-qualified-name/snapshots/5-AST-Alignment-AST.shot index a7a16eee58a5..5a99e367a51d 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-qualified-name/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-qualified-name/snapshots/5-AST-Alignment-AST.shot @@ -2,5 +2,89 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-id-qualified-name AST Alignment - AST 1`] = ` "Snapshot Diff: -Compared values have no visual difference." +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleBlock { + type: 'TSModuleBlock', + body: Array [], + + range: [16, 18], + loc: { + start: { column: 16, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'C', + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, +- kind: 'namespace', + + range: [14, 18], + loc: { + start: { column: 14, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'B', + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, +- kind: 'namespace', + + range: [12, 18], + loc: { + start: { column: 12, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'A', + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, +- kind: 'namespace', + + range: [0, 18], + loc: { + start: { column: 0, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 19], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" `; diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/spec.ts b/packages/ast-spec/src/declaration/TSModuleDeclaration/spec.ts index e077d1648e1f..3afa8aee8c62 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/spec.ts +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/spec.ts @@ -1,11 +1,24 @@ import type { AST_NODE_TYPES } from '../../ast-node-types'; import type { BaseNode } from '../../base/BaseNode'; import type { Identifier } from '../../expression/Identifier/spec'; +import type { StringLiteral } from '../../expression/literal/StringLiteral/spec'; import type { TSModuleBlock } from '../../special/TSModuleBlock/spec'; -import type { Literal } from '../../unions/Literal'; import type { Modifier } from '../../unions/Modifier'; -export interface TSModuleDeclaration extends BaseNode { +export type TSModuleDeclarationKind = 'global' | 'module' | 'namespace'; + +/* +TODO(#4966) - we currently emit this due to bad parser handling of nested modules +namespace Foo.Bar {} +^^^^^^^^^^^^^^^^^^^^ TSModuleDeclaration + ^^^^^^ TSModuleDeclaration + ^^ TSModuleBlock + +This should instead emit a TSQualifiedName for the `id` and not emit an inner TSModuleDeclaration +*/ +type ModuleBody_TODOFixThis = TSModuleBlock | TSModuleDeclaration; + +interface TSModuleDeclarationBase extends BaseNode { type: AST_NODE_TYPES.TSModuleDeclaration; /** * The name of the module @@ -15,31 +28,20 @@ export interface TSModuleDeclaration extends BaseNode { * module 'a' {} * ``` */ - id: Identifier | Literal; + id: Identifier | StringLiteral; /** * The body of the module. * This can only be `undefined` for the code `declare module 'mod';` * This will be a `TSModuleDeclaration` if the name is "nested" (`Foo.Bar`). */ - body?: - | TSModuleBlock - /* - TODO(#4966) - we currently emit this due to bad parser handling of nested modules - namespace Foo.Bar {} - ^^^^^^^^^^^^^^^^^^^^ TSModuleDeclaration - ^^^^^^ TSModuleDeclaration - ^^ TSModuleBlock - - This should instead emit a TSQualifiedName for the `id` and not emit an inner TSModuleDeclaration - */ - | TSModuleDeclaration; + body?: ModuleBody_TODOFixThis; /** * Whether this is a global declaration * ``` * declare global {} * ``` */ - // TODO(#5020) - make this `false` if not `global` + // TODO - remove this in the next major (we have `.kind` now) global?: boolean; /** * Whether the module is `declare`d @@ -51,4 +53,86 @@ export interface TSModuleDeclaration extends BaseNode { declare?: boolean; // TODO(#4759) - breaking change remove this modifiers?: Modifier[]; + + /** + * The keyword used to define this module declaration + * ``` + * namespace Foo {} + * ^^^^^^^^^ + * + * module 'foo' {} + * ^^^^^^ + * + * declare global {} + * ^^^^^^ + * ``` + */ + kind: TSModuleDeclarationKind; +} + +export interface TSModuleDeclarationNamespace extends TSModuleDeclarationBase { + kind: 'namespace'; + // namespaces cannot have literal IDs + id: Identifier; + // namespaces must always have a body + body: ModuleBody_TODOFixThis; + + // TODO - remove this in the next major (we have `.kind` now) + global?: undefined; } + +export interface TSModuleDeclarationGlobal extends TSModuleDeclarationBase { + kind: 'global'; + // cannot have a nested namespace for global module augmentation + // cannot have `declare global;` + body: TSModuleBlock; + // this will always be an Identifier with name `global` + id: Identifier; + + // note - it's not syntactically required to have `declare`, but it semantically required + + // TODO - remove this in the next major (we have `.kind` now) + global: true; +} + +interface TSModuleDeclarationModuleBase extends TSModuleDeclarationBase { + kind: 'module'; + + // TODO - remove this in the next major (we have `.kind` now) + global?: undefined; +} + +export type TSModuleDeclarationModule = + | TSModuleDeclarationModuleWithIdentifierId + | TSModuleDeclarationModuleWithStringId; +export type TSModuleDeclarationModuleWithStringId = + | TSModuleDeclarationModuleWithStringIdDeclared + | TSModuleDeclarationModuleWithStringIdNotDeclared; +export interface TSModuleDeclarationModuleWithStringIdNotDeclared + extends TSModuleDeclarationModuleBase { + kind: 'module'; + id: StringLiteral; + declare: false; + // cannot have nested namespaces with a string ID, must have a body + body: TSModuleBlock; +} +export interface TSModuleDeclarationModuleWithStringIdDeclared + extends TSModuleDeclarationModuleBase { + kind: 'module'; + id: StringLiteral; + declare: true; + // cannot have nested namespaces with a string ID, might not have a body + body?: TSModuleBlock; +} +export interface TSModuleDeclarationModuleWithIdentifierId + extends TSModuleDeclarationModuleBase { + kind: 'module'; + id: Identifier; + // modules with an Identifier must always have a body + body: ModuleBody_TODOFixThis; +} + +export type TSModuleDeclaration = + | TSModuleDeclarationGlobal + | TSModuleDeclarationModule + | TSModuleDeclarationNamespace; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/1-TSESTree-AST.shot index b77fc06d204f..3f74d63a87e9 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/1-TSESTree-AST.shot @@ -110,6 +110,7 @@ Program { end: { column: 10, line: 3 }, }, }, + kind: "module", range: [73, 132], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/5-AST-Alignment-AST.shot index c752ccbc4ea3..8ce2d9d2915d 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/5-AST-Alignment-AST.shot @@ -114,6 +114,7 @@ exports[`AST Fixtures legacy-fixtures basics directive-in-module AST Alignment - end: { column: 10, line: 3 }, }, }, +- kind: 'module', range: [73, 132], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/1-TSESTree-AST.shot index 0921c13c37c8..54670d060d5f 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/1-TSESTree-AST.shot @@ -110,6 +110,7 @@ Program { end: { column: 13, line: 3 }, }, }, + kind: "namespace", range: [73, 135], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/5-AST-Alignment-AST.shot index d570c43e3eaf..620319c66453 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/5-AST-Alignment-AST.shot @@ -114,6 +114,7 @@ exports[`AST Fixtures legacy-fixtures basics directive-in-namespace AST Alignmen end: { column: 13, line: 3 }, }, }, +- kind: 'namespace', range: [73, 135], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/1-TSESTree-AST.shot index 17df9ce9c9ff..28b9f673edcf 100644 --- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/1-TSESTree-AST.shot @@ -27,6 +27,7 @@ Program { end: { column: 18, line: 3 }, }, }, + kind: "module", range: [73, 94], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/5-AST-Alignment-AST.shot index 9546b3d34b31..575a9a6bd393 100644 --- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/5-AST-Alignment-AST.shot @@ -2,5 +2,50 @@ exports[`AST Fixtures legacy-fixtures declare module AST Alignment - AST 1`] = ` "Snapshot Diff: -Compared values have no visual difference." +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleBlock { + type: 'TSModuleBlock', + body: Array [], + + range: [92, 94], + loc: { + start: { column: 19, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + declare: true, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [88, 91], + loc: { + start: { column: 15, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, +- kind: 'module', + + range: [73, 94], + loc: { + start: { column: 0, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 95], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" `; diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/1-TSESTree-AST.shot index 85661223163a..131440bf5fe7 100644 --- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/1-TSESTree-AST.shot @@ -27,6 +27,7 @@ Program { end: { column: 21, line: 3 }, }, }, + kind: "namespace", range: [73, 97], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot index 1d5ab5062386..ba41672f8430 100644 --- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot @@ -2,5 +2,50 @@ exports[`AST Fixtures legacy-fixtures declare namespace AST Alignment - AST 1`] = ` "Snapshot Diff: -Compared values have no visual difference." +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleBlock { + type: 'TSModuleBlock', + body: Array [], + + range: [95, 97], + loc: { + start: { column: 22, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + declare: true, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [91, 94], + loc: { + start: { column: 18, line: 3 }, + end: { column: 21, line: 3 }, + }, + }, +- kind: 'namespace', + + range: [73, 97], + loc: { + start: { column: 0, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 98], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" `; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/1-TSESTree-AST.shot index 392a9c23b52d..3cdbc8537ae7 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/1-TSESTree-AST.shot @@ -72,6 +72,7 @@ Program { end: { column: 29, line: 3 }, }, }, + kind: "module", range: [73, 129], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/5-AST-Alignment-AST.shot index 42caff8c0fd1..a6aff688ab87 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/5-AST-Alignment-AST.shot @@ -76,6 +76,7 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules ambient-module-decl end: { column: 29, line: 3 }, }, }, +- kind: 'module', range: [73, 129], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/1-TSESTree-AST.shot index 543c0266dc83..c4767e22bd00 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/1-TSESTree-AST.shot @@ -141,6 +141,7 @@ Program { end: { column: 20, line: 3 }, }, }, + kind: "namespace", range: [73, 157], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/5-AST-Alignment-AST.shot index 4e3ae3412850..0281bcdcbc15 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/5-AST-Alignment-AST.shot @@ -145,6 +145,7 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules declare-namespace-w end: { column: 20, line: 3 }, }, }, +- kind: 'namespace', range: [73, 157], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/1-TSESTree-AST.shot index c44bb057e429..8177f6c6582a 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/1-TSESTree-AST.shot @@ -32,6 +32,7 @@ Program { end: { column: 23, line: 4 }, }, }, + kind: "module", range: [92, 116], loc: { @@ -62,6 +63,7 @@ Program { end: { column: 26, line: 5 }, }, }, + kind: "namespace", range: [119, 146], loc: { @@ -89,6 +91,7 @@ Program { end: { column: 14, line: 3 }, }, }, + kind: "global", range: [73, 148], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/5-AST-Alignment-AST.shot index 33e8853dea71..3256de744361 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/5-AST-Alignment-AST.shot @@ -2,5 +2,114 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules global-module-declaration AST Alignment - AST 1`] = ` "Snapshot Diff: -Compared values have no visual difference." +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleBlock { + type: 'TSModuleBlock', + body: Array [ + TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleBlock { + type: 'TSModuleBlock', + body: Array [], + + range: [114, 116], + loc: { + start: { column: 24, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + declare: true, + id: Identifier { + type: 'Identifier', + name: 'global', + + range: [107, 113], + loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, + }, +- kind: 'module', + + range: [92, 116], + loc: { + start: { column: 2, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleBlock { + type: 'TSModuleBlock', + body: Array [], + + range: [144, 146], + loc: { + start: { column: 27, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + declare: true, + id: Identifier { + type: 'Identifier', + name: 'global', + + range: [137, 143], + loc: { + start: { column: 20, line: 5 }, + end: { column: 26, line: 5 }, + }, + }, +- kind: 'namespace', + + range: [119, 146], + loc: { + start: { column: 2, line: 5 }, + end: { column: 29, line: 5 }, + }, + }, + ], + + range: [88, 148], + loc: { + start: { column: 15, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + declare: true, + global: true, + id: Identifier { + type: 'Identifier', + name: 'global', + + range: [81, 87], + loc: { + start: { column: 8, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, +- kind: 'global', + + range: [73, 148], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 6 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 149], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 7 }, + }, + }" `; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/1-TSESTree-AST.shot index 57b0ed0ed584..8ad7040deeec 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/1-TSESTree-AST.shot @@ -187,6 +187,7 @@ Program { end: { column: 12, line: 3 }, }, }, + kind: "module", range: [73, 174], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/5-AST-Alignment-AST.shot index f7882ef62079..934dda17d284 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/5-AST-Alignment-AST.shot @@ -191,6 +191,7 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules module-with-default end: { column: 12, line: 3 }, }, }, +- kind: 'module', range: [73, 174], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/1-TSESTree-AST.shot index d2b129beb751..e88155e93516 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/1-TSESTree-AST.shot @@ -339,6 +339,7 @@ Program { end: { column: 17, line: 8 }, }, }, + kind: "module", range: [207, 273], loc: { @@ -374,6 +375,7 @@ Program { end: { column: 8, line: 3 }, }, }, + kind: "module", range: [73, 275], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/5-AST-Alignment-AST.shot index a7f07ea2823e..1b64e4bd8e89 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/5-AST-Alignment-AST.shot @@ -343,6 +343,7 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod end: { column: 17, line: 8 }, }, }, +- kind: 'module', range: [207, 273], loc: { @@ -378,6 +379,7 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod end: { column: 8, line: 3 }, }, }, +- kind: 'module', range: [73, 275], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/1-TSESTree-AST.shot index 09f4217111fb..7f7359ae7fa6 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/1-TSESTree-AST.shot @@ -18,6 +18,7 @@ Program { end: { column: 31, line: 3 }, }, }, + kind: "module", range: [73, 105], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/5-AST-Alignment-AST.shot index c44cfa6ec3e8..99c15addea30 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/5-AST-Alignment-AST.shot @@ -2,5 +2,41 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules shorthand-ambient-module-declaration AST Alignment - AST 1`] = ` "Snapshot Diff: -Compared values have no visual difference." +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSModuleDeclaration { + type: 'TSModuleDeclaration', + declare: true, + id: Literal { + type: 'Literal', + raw: '\\\\'hot-new-module\\\\'', + value: 'hot-new-module', + + range: [88, 104], + loc: { + start: { column: 15, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, +- kind: 'module', + + range: [73, 105], + loc: { + start: { column: 0, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [73, 106], + loc: { + start: { column: 0, line: 3 }, + end: { column: 0, line: 4 }, + }, + }" `; diff --git a/packages/ast-spec/tests/fixtures-with-differences-ast.shot b/packages/ast-spec/tests/fixtures-with-differences-ast.shot index 1f4ef6902086..7602cbedcdc1 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-ast.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-ast.shot @@ -12,6 +12,7 @@ Set { "declaration/ExportNamedDeclaration/fixtures/identifier-braced/fixture.ts", "declaration/ExportNamedDeclaration/fixtures/identifier-many/fixture.ts", "declaration/ExportNamedDeclaration/fixtures/interface/fixture.ts", + "declaration/ExportNamedDeclaration/fixtures/namespace/fixture.ts", "declaration/ExportNamedDeclaration/fixtures/type-alias/fixture.ts", "declaration/FunctionDeclaration/fixtures/type-param-many/fixture.ts", "declaration/FunctionDeclaration/fixtures/type-param-one/fixture.ts", @@ -22,6 +23,15 @@ Set { "declaration/TSInterfaceDeclaration/fixtures/extends-one/fixture.ts", "declaration/TSInterfaceDeclaration/fixtures/type-param-many/fixture.ts", "declaration/TSInterfaceDeclaration/fixtures/type-param-one/fixture.ts", + "declaration/TSModuleDeclaration/fixtures/global/fixture.ts", + "declaration/TSModuleDeclaration/fixtures/module-declare-no-body/fixture.ts", + "declaration/TSModuleDeclaration/fixtures/module-declare/fixture.ts", + "declaration/TSModuleDeclaration/fixtures/module-id-identifier/fixture.ts", + "declaration/TSModuleDeclaration/fixtures/module-id-literal/fixture.ts", + "declaration/TSModuleDeclaration/fixtures/module-id-qualified-name/fixture.ts", + "declaration/TSModuleDeclaration/fixtures/namespace-declare/fixture.ts", + "declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/fixture.ts", + "declaration/TSModuleDeclaration/fixtures/namespace-id-qualified-name/fixture.ts", "declaration/TSTypeAliasDeclaration/fixtures/type-param-many/fixture.ts", "declaration/TSTypeAliasDeclaration/fixtures/type-param-one/fixture.ts", "element/AccessorProperty/fixtures/key-computed-complex/fixture.ts", @@ -161,14 +171,18 @@ Set { "legacy-fixtures/class-decorators/fixtures/class-parameter-property/fixture.ts", "legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/fixture.ts", "legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/fixture.ts", + "legacy-fixtures/declare/fixtures/module/fixture.ts", + "legacy-fixtures/declare/fixtures/namespace/fixture.ts", "legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/fixture.ts", "legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/fixture.ts", "legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/fixture.ts", "legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/fixture.ts", "legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/fixture.ts", "legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/fixture.ts", + "legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/fixture.ts", "legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/fixture.ts", "legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/fixture.ts", + "legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/fixture.ts", "legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/fixture.ts", "legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/fixture.ts", "legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/fixture.ts", diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 70ee9da4e0ce..4f7a89d97c14 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -2791,16 +2791,65 @@ export class Converter { case SyntaxKind.ModuleDeclaration: { const result = this.createNode(node, { type: AST_NODE_TYPES.TSModuleDeclaration, - id: this.convertChild(node.name), + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- TODO - add ignore IIFE option + ...(() => { + const id: TSESTree.Identifier | TSESTree.StringLiteral = + this.convertChild(node.name); + const body: + | TSESTree.TSModuleBlock + | TSESTree.TSModuleDeclaration + | null = this.convertChild(node.body); + + // the constraints checked by this function are syntactically enforced by TS + // the checks mostly exist for type's sake + + if (node.flags & ts.NodeFlags.GlobalAugmentation) { + if ( + body == null || + body.type === AST_NODE_TYPES.TSModuleDeclaration + ) { + throw new Error('Expected a valid module body'); + } + if (id.type !== AST_NODE_TYPES.Identifier) { + throw new Error( + 'global module augmentation must have an Identifier id', + ); + } + return { + kind: 'global', + id, + body, + global: true, + } satisfies TSESTree.OptionalRangeAndLoc< + Omit + >; + } else if (node.flags & ts.NodeFlags.Namespace) { + if (body == null) { + throw new Error('Expected a module body'); + } + if (id.type !== AST_NODE_TYPES.Identifier) { + throw new Error('`namespace`s must have an Identifier id'); + } + return { + kind: 'namespace', + id, + body, + } satisfies TSESTree.OptionalRangeAndLoc< + Omit + >; + } else { + return { + kind: 'module', + id, + ...(body != null ? { body } : {}), + } satisfies TSESTree.OptionalRangeAndLoc< + Omit + >; + } + })(), }); - if (node.body) { - result.body = this.convertChild(node.body); - } - // apply modifiers first... this.applyModifiersToResult(result, getModifiers(node)); - if (node.flags & ts.NodeFlags.GlobalAugmentation) { - result.global = true; - } + // ...then check for exports return this.fixExports(node, result); } diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/directive-in-module.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/directive-in-module.src.ts.shot index 4e79f84c3dd1..2a65e53254b6 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/directive-in-module.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/directive-in-module.src.ts.shot @@ -188,6 +188,7 @@ Object { ], "type": "Identifier", }, + "kind": "module", "loc": Object { "end": Object { "column": 1, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/directive-in-namespace.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/directive-in-namespace.src.ts.shot index 6cbcd85aabe6..28b76d987c48 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/directive-in-namespace.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/directive-in-namespace.src.ts.shot @@ -188,6 +188,7 @@ Object { ], "type": "Identifier", }, + "kind": "namespace", "loc": Object { "end": Object { "column": 1, diff --git a/packages/typescript-estree/tests/snapshots/typescript/declare/module.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/declare/module.src.ts.shot index b00d347e536b..a786486f85d1 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/declare/module.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/declare/module.src.ts.shot @@ -41,6 +41,7 @@ Object { ], "type": "Identifier", }, + "kind": "module", "loc": Object { "end": Object { "column": 1, diff --git a/packages/typescript-estree/tests/snapshots/typescript/declare/namespace.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/declare/namespace.src.ts.shot index c38490374609..3823ff07f05a 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/declare/namespace.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/declare/namespace.src.ts.shot @@ -41,6 +41,7 @@ Object { ], "type": "Identifier", }, + "kind": "namespace", "loc": Object { "end": Object { "column": 1, diff --git a/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/ambient-module-declaration-with-import.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/ambient-module-declaration-with-import.src.ts.shot index eca74134194e..0fc1dc4ce2b1 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/ambient-module-declaration-with-import.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/ambient-module-declaration-with-import.src.ts.shot @@ -118,6 +118,7 @@ Object { "type": "Literal", "value": "i-use-things", }, + "kind": "module", "loc": Object { "end": Object { "column": 1, diff --git a/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/declare-namespace-with-exported-function.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/declare-namespace-with-exported-function.src.ts.shot index 1d6f5b2efdac..5a3e8f29ed62 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/declare-namespace-with-exported-function.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/declare-namespace-with-exported-function.src.ts.shot @@ -244,6 +244,7 @@ Object { ], "type": "Identifier", }, + "kind": "namespace", "loc": Object { "end": Object { "column": 1, diff --git a/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/global-module-declaration.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/global-module-declaration.src.ts.shot index 08ed9df51fba..08f680075d90 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/global-module-declaration.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/global-module-declaration.src.ts.shot @@ -44,6 +44,7 @@ Object { ], "type": "Identifier", }, + "kind": "module", "loc": Object { "end": Object { "column": 5, @@ -98,6 +99,7 @@ Object { ], "type": "Identifier", }, + "kind": "namespace", "loc": Object { "end": Object { "column": 5, @@ -151,6 +153,7 @@ Object { ], "type": "Identifier", }, + "kind": "global", "loc": Object { "end": Object { "column": 1, diff --git a/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/module-with-default-exports.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/module-with-default-exports.src.ts.shot index 70ff82a2ec71..7151fa18ddec 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/module-with-default-exports.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/module-with-default-exports.src.ts.shot @@ -322,6 +322,7 @@ Object { "type": "Literal", "value": "foo", }, + "kind": "module", "loc": Object { "end": Object { "column": 1, diff --git a/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/nested-internal-module.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/nested-internal-module.src.ts.shot index 2284e4afed7d..ad77c1edc36d 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/nested-internal-module.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/nested-internal-module.src.ts.shot @@ -595,6 +595,7 @@ Object { ], "type": "Identifier", }, + "kind": "module", "loc": Object { "end": Object { "column": 5, @@ -665,6 +666,7 @@ Object { ], "type": "Identifier", }, + "kind": "module", "loc": Object { "end": Object { "column": 1, diff --git a/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/shorthand-ambient-module-declaration.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/shorthand-ambient-module-declaration.src.ts.shot index 37b859d967fb..5b90f004775a 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/shorthand-ambient-module-declaration.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/shorthand-ambient-module-declaration.src.ts.shot @@ -24,6 +24,7 @@ Object { "type": "Literal", "value": "hot-new-module", }, + "kind": "module", "loc": Object { "end": Object { "column": 32, From 113640e9742acb3a193078e9704648517aebf1d8 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 9 Feb 2023 22:30:24 -0500 Subject: [PATCH 05/15] feat(eslint-plugin): [explicit-function-return-type] add allowFunctionsWithoutTypeParameters option (#6105) --- .../rules/explicit-function-return-type.ts | 16 ++++- .../explicit-function-return-type.test.ts | 63 +++++++++++++++++++ 2 files changed, 76 insertions(+), 3 deletions(-) diff --git a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts index 1d216ebff1d6..9c91aa6d83d9 100644 --- a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts +++ b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts @@ -15,6 +15,7 @@ type Options = [ allowHigherOrderFunctions?: boolean; allowDirectConstAssertionInArrowFunctions?: boolean; allowConciseArrowFunctionExpressionsStartingWithVoid?: boolean; + allowFunctionsWithoutTypeParameters?: boolean; allowedNames?: string[]; }, ]; @@ -61,6 +62,11 @@ export default util.createRule({ 'Whether to ignore arrow functions immediately returning a `as const` value.', type: 'boolean', }, + allowFunctionsWithoutTypeParameters: { + description: + "Whether to ignore functions that don't have generic type parameters.", + type: 'boolean', + }, allowedNames: { description: 'An array of function/method names that will not have their arguments or return values checked.', @@ -86,12 +92,16 @@ export default util.createRule({ ], create(context, [options]) { const sourceCode = context.getSourceCode(); - function isAllowedName( + function isAllowedFunction( node: | TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression | TSESTree.FunctionDeclaration, ): boolean { + if (options.allowFunctionsWithoutTypeParameters && !node.typeParameters) { + return true; + } + if (!options.allowedNames?.length) { return false; } @@ -153,7 +163,7 @@ export default util.createRule({ return; } - if (isAllowedName(node)) { + if (isAllowedFunction(node)) { return; } @@ -174,7 +184,7 @@ export default util.createRule({ ); }, FunctionDeclaration(node): void { - if (isAllowedName(node)) { + if (isAllowedFunction(node)) { return; } if (options.allowTypedFunctionExpressions && node.returnType) { diff --git a/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts b/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts index 40c15a89a2f1..912242247af7 100644 --- a/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts +++ b/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts @@ -400,6 +400,46 @@ new Foo(1, () => {}); code: 'const log = (message: string) => void console.log(message);', options: [{ allowConciseArrowFunctionExpressionsStartingWithVoid: true }], }, + { + code: 'const log = (a: string) => a;', + options: [{ allowFunctionsWithoutTypeParameters: true }], + }, + { + code: 'const log = (a: A): A => a;', + options: [{ allowFunctionsWithoutTypeParameters: true }], + }, + { + code: ` +function log(a: A): A { + return a; +} + `, + options: [{ allowFunctionsWithoutTypeParameters: true }], + }, + { + code: ` +function log(a: string) { + return a; +} + `, + options: [{ allowFunctionsWithoutTypeParameters: true }], + }, + { + code: ` +const log = function (a: A): A { + return a; +}; + `, + options: [{ allowFunctionsWithoutTypeParameters: true }], + }, + { + code: ` +const log = function (a: A): string { + return a; +}; + `, + options: [{ allowFunctionsWithoutTypeParameters: true }], + }, { filename: 'test.ts', options: [ @@ -1319,6 +1359,29 @@ const func = (value: number) => ({ type: 'X', value } as const); }, ], }, + { + code: 'const log = (a: A) => a;', + errors: [{ messageId: 'missingReturnType' }], + options: [{ allowFunctionsWithoutTypeParameters: true }], + }, + { + code: ` +function log(a: A) { + return a; +} + `, + errors: [{ messageId: 'missingReturnType' }], + options: [{ allowFunctionsWithoutTypeParameters: true }], + }, + { + code: ` +const log = function (a: A) { + return a; +}; + `, + errors: [{ messageId: 'missingReturnType' }], + options: [{ allowFunctionsWithoutTypeParameters: true }], + }, { filename: 'test.ts', options: [ From 3eb2eed6167e2ffad6c44c0fcbd86be4b6202aeb Mon Sep 17 00:00:00 2001 From: Eliott C Date: Fri, 10 Feb 2023 04:32:23 +0100 Subject: [PATCH 06/15] fix(eslint-plugin): fix key-spacing when type starts on next line (#6412) * fix(eslint-plugin): fix key-spacing when type starts on next line * fixup! fix(eslint-plugin): fix key-spacing when type starts on next line --- .../eslint-plugin/src/rules/key-spacing.ts | 13 +++++- .../tests/rules/key-spacing.test.ts | 42 +++++++++++++++++++ 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin/src/rules/key-spacing.ts b/packages/eslint-plugin/src/rules/key-spacing.ts index 2562107ee050..2d4d3f5c11df 100644 --- a/packages/eslint-plugin/src/rules/key-spacing.ts +++ b/packages/eslint-plugin/src/rules/key-spacing.ts @@ -85,6 +85,15 @@ export default util.createRule({ ); } + function isApplicable( + node: TSESTree.Node, + ): node is KeyTypeNodeWithTypeAnnotation { + return ( + isKeyTypeNode(node) && + node.typeAnnotation.loc.start.line === node.loc.end.line + ); + } + /** * To handle index signatures, to get the whole text for the parameters */ @@ -281,7 +290,7 @@ export default util.createRule({ } for (const node of group) { - if (!isKeyTypeNode(node)) { + if (!isApplicable(node)) { continue; } const { typeAnnotation } = node; @@ -356,7 +365,7 @@ export default util.createRule({ ? options.multiLine.mode : options.mode) ?? 'strict'; - if (isKeyTypeNode(node)) { + if (isApplicable(node)) { checkBeforeColon(node, expectedWhitespaceBeforeColon, mode); checkAfterColon(node, expectedWhitespaceAfterColon, mode); } diff --git a/packages/eslint-plugin/tests/rules/key-spacing.test.ts b/packages/eslint-plugin/tests/rules/key-spacing.test.ts index 40206258671c..e7828e01ffe0 100644 --- a/packages/eslint-plugin/tests/rules/key-spacing.test.ts +++ b/packages/eslint-plugin/tests/rules/key-spacing.test.ts @@ -11,6 +11,48 @@ const ruleTester = new RuleTester({ ruleTester.run('key-spacing', rule, { valid: [ + // non-applicable + { + code: ` +interface X { + x: + | number + | string; +} + `, + options: [{ align: 'value' }], + }, + { + code: ` +interface X { + x: + | number + | string; +} + `, + options: [{}], + }, + { + code: ` +interface X { + abcdef: string; + x: + | number + | string; + defgh: string; +} + `, + options: [{ align: 'value' }], + }, + { + code: ` +interface X { + x: + | number; abcd: string; +} + `, + options: [{ align: 'value' }], + }, // align: value { code: ` From dcd05f0b3ab62779571294d08a4542d66ebb2294 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 9 Feb 2023 22:32:35 -0500 Subject: [PATCH 07/15] feat(typescript-estree): allow specifying project: true (#6084) * feat(typescript-estree): allow specifying project: true * Also fix unchanged file for lint I guess * Added docs * More tsconfigRootDir: __dirname removal * Added some unit tests * you don't say * Undo createWatchProgram.ts * Added parse tests * Fixed monorepos link * Cache under all directories * Added another test, just to be sure * lint fix * Add back tsconfigRootDir * Apply suggestions from code review Co-authored-by: Brad Zacher * Back to string | * Fix website build * Fix the build * A global tsconfigMatchCache, with a test --------- Co-authored-by: Brad Zacher --- docs/architecture/Parser.mdx | 9 +- docs/architecture/TypeScript-ESTree.mdx | 5 +- docs/linting/Typed_Linting.mdx | 27 ++- docs/linting/typed-linting/Monorepos.mdx | 2 +- packages/types/src/parser-options.ts | 2 +- .../src/parseSettings/ExpiringCache.ts | 29 ++-- .../src/parseSettings/createParseSettings.ts | 18 +- .../parseSettings/getProjectConfigFiles.ts | 59 +++++++ .../src/parseSettings/index.ts | 6 + .../typescript-estree/src/parser-options.ts | 5 +- .../projectTrue/nested/deep/included.ts | 1 + .../fixtures/projectTrue/nested/included.ts | 1 + .../fixtures/projectTrue/nested/tsconfig.json | 3 + .../tests/fixtures/projectTrue/notIncluded.ts | 1 + .../tests/lib/createParseSettings.test.ts | 14 ++ .../tests/lib/getProjectConfigFiles.test.ts | 158 ++++++++++++++++++ .../tests/lib/parse.project-true.test.ts | 49 ++++++ .../website/src/components/linter/config.ts | 1 + 18 files changed, 363 insertions(+), 27 deletions(-) create mode 100644 packages/typescript-estree/src/parseSettings/getProjectConfigFiles.ts create mode 100644 packages/typescript-estree/tests/fixtures/projectTrue/nested/deep/included.ts create mode 100644 packages/typescript-estree/tests/fixtures/projectTrue/nested/included.ts create mode 100644 packages/typescript-estree/tests/fixtures/projectTrue/nested/tsconfig.json create mode 100644 packages/typescript-estree/tests/fixtures/projectTrue/notIncluded.ts create mode 100644 packages/typescript-estree/tests/lib/createParseSettings.test.ts create mode 100644 packages/typescript-estree/tests/lib/getProjectConfigFiles.test.ts create mode 100644 packages/typescript-estree/tests/lib/parse.project-true.test.ts diff --git a/docs/architecture/Parser.mdx b/docs/architecture/Parser.mdx index 5039dc1bec55..39ade74168a0 100644 --- a/docs/architecture/Parser.mdx +++ b/docs/architecture/Parser.mdx @@ -45,7 +45,7 @@ interface ParserOptions { lib?: string[]; moduleResolver?: string; program?: import('typescript').Program; - project?: string | string[]; + project?: string | string[] | true; projectFolderIgnoreList?: string[]; tsconfigRootDir?: string; warnOnUnsupportedTypeScriptVersion?: boolean; @@ -188,6 +188,9 @@ This option allows you to provide a path to your project's `tsconfig.json`. **Th - Accepted values: ```js + // find the tsconfig.json nearest each source file + project: true, + // path project: './tsconfig.json'; @@ -198,6 +201,10 @@ This option allows you to provide a path to your project's `tsconfig.json`. **Th project: ['./packages/**/tsconfig.json', './separate-package/tsconfig.json']; ``` +- If `true`, each source file's parse will find the nearest `tsconfig.json` file to that source file. + + - This is done by checking that source file's directory tree for the nearest `tsconfig.json`. + - If you use project references, TypeScript will not automatically use project references to resolve files. This means that you will have to add each referenced tsconfig to the `project` field either separately, or via a glob. - Note that using wide globs `**` in your `parserOptions.project` may cause performance implications. Instead of globs that use `**` to recursively check all folders, prefer paths that use a single `*` at a time. For more info see [#2611](https://github.com/typescript-eslint/typescript-eslint/issues/2611). diff --git a/docs/architecture/TypeScript-ESTree.mdx b/docs/architecture/TypeScript-ESTree.mdx index f74aa65e2234..40d426062965 100644 --- a/docs/architecture/TypeScript-ESTree.mdx +++ b/docs/architecture/TypeScript-ESTree.mdx @@ -174,10 +174,11 @@ interface ParseAndGenerateServicesOptions extends ParseOptions { preserveNodeMaps?: boolean; /** - * Absolute (or relative to `tsconfigRootDir`) paths to the tsconfig(s). + * Absolute (or relative to `tsconfigRootDir`) paths to the tsconfig(s), + * or `true` to find the nearest tsconfig.json to the file. * If this is provided, type information will be returned. */ - project?: string | string[]; + project?: string | string[] | true; /** * If you provide a glob (or globs) to the project option, you can use this option to ignore certain folders from diff --git a/docs/linting/Typed_Linting.mdx b/docs/linting/Typed_Linting.mdx index 7d9de2f25bb1..a51afdad02b5 100644 --- a/docs/linting/Typed_Linting.mdx +++ b/docs/linting/Typed_Linting.mdx @@ -18,7 +18,7 @@ module.exports = { parser: '@typescript-eslint/parser', // Added lines start parserOptions: { - project: ['./tsconfig.json'], + project: true, tsconfigRootDir: __dirname, }, // Added lines end @@ -36,6 +36,31 @@ In more detail: With that done, run the same lint command you ran before. You may see new rules reporting errors based on type information! +## Specifying TSConfigs + +The `parserOptions.project` option can be turned on with either: + +- `true`: to always use `tsconfig.json`s nearest to source files +- `string | string[]`: any number of glob paths to match TSConfig files relative to the + +For example, if you use a specific `tsconfig.eslint.json` for linting, you'd specify: + +```js title=".eslintrc.js" +module.exports = { + // ... + parserOptions: { + project: './tsconfig.eslint.json', + }, + // ... +}; +``` + +See [the `@typescript-eslint/parser` docs for more details](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/README.md#parseroptionsproject). + +:::note +If your project is a multi-package monorepo, see [our docs on configuring a monorepo](./typed-linting/Monorepos.mdx). +::: + ## FAQs ### How is performance? diff --git a/docs/linting/typed-linting/Monorepos.mdx b/docs/linting/typed-linting/Monorepos.mdx index 7b01b81d6622..9d0d67e331fa 100644 --- a/docs/linting/typed-linting/Monorepos.mdx +++ b/docs/linting/typed-linting/Monorepos.mdx @@ -53,7 +53,7 @@ module.exports = { parserOptions: { tsconfigRootDir: __dirname, // Remove this line - project: ['./tsconfig.json'], + project: true, // Add this line project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'], }, diff --git a/packages/types/src/parser-options.ts b/packages/types/src/parser-options.ts index a7fe3ce3ab36..f77b601e0d05 100644 --- a/packages/types/src/parser-options.ts +++ b/packages/types/src/parser-options.ts @@ -52,7 +52,7 @@ interface ParserOptions { filePath?: string; loc?: boolean; program?: Program; - project?: string | string[]; + project?: string | string[] | true; projectFolderIgnoreList?: (string | RegExp)[]; range?: boolean; sourceType?: SourceType; diff --git a/packages/typescript-estree/src/parseSettings/ExpiringCache.ts b/packages/typescript-estree/src/parseSettings/ExpiringCache.ts index f296c9f5f590..e28506d1d9bd 100644 --- a/packages/typescript-estree/src/parseSettings/ExpiringCache.ts +++ b/packages/typescript-estree/src/parseSettings/ExpiringCache.ts @@ -3,15 +3,18 @@ import type { CacheDurationSeconds } from '@typescript-eslint/types'; export const DEFAULT_TSCONFIG_CACHE_DURATION_SECONDS = 30; const ZERO_HR_TIME: [number, number] = [0, 0]; +export interface CacheLike { + get(key: Key): Value | void; + set(key: Key, value: Value): this; +} + /** * A map with key-level expiration. */ -export class ExpiringCache { +export class ExpiringCache implements CacheLike { readonly #cacheDurationSeconds: CacheDurationSeconds; - /** - * The mapping of path-like string to the resolved TSConfig(s) - */ - protected readonly map = new Map< + + readonly #map = new Map< TKey, Readonly<{ value: TValue; @@ -24,7 +27,7 @@ export class ExpiringCache { } set(key: TKey, value: TValue): this { - this.map.set(key, { + this.#map.set(key, { value, lastSeen: this.#cacheDurationSeconds === 'Infinity' @@ -36,7 +39,7 @@ export class ExpiringCache { } get(key: TKey): TValue | undefined { - const entry = this.map.get(key); + const entry = this.#map.get(key); if (entry?.value != null) { if (this.#cacheDurationSeconds === 'Infinity') { return entry.value; @@ -48,22 +51,14 @@ export class ExpiringCache { return entry.value; } else { // key has expired - clean it up to free up memory - this.cleanupKey(key); + this.#map.delete(key); } } // no hit :'( return undefined; } - protected cleanupKey(key: TKey): void { - this.map.delete(key); - } - - get size(): number { - return this.map.size; - } - clear(): void { - this.map.clear(); + this.#map.clear(); } } diff --git a/packages/typescript-estree/src/parseSettings/createParseSettings.ts b/packages/typescript-estree/src/parseSettings/createParseSettings.ts index e7267a852686..028088765a28 100644 --- a/packages/typescript-estree/src/parseSettings/createParseSettings.ts +++ b/packages/typescript-estree/src/parseSettings/createParseSettings.ts @@ -2,6 +2,11 @@ import debug from 'debug'; import { ensureAbsolutePath } from '../create-program/shared'; import type { TSESTreeOptions } from '../parser-options'; +import { + DEFAULT_TSCONFIG_CACHE_DURATION_SECONDS, + ExpiringCache, +} from './ExpiringCache'; +import { getProjectConfigFiles } from './getProjectConfigFiles'; import type { MutableParseSettings } from './index'; import { inferSingleRun } from './inferSingleRun'; import { resolveProjectList } from './resolveProjectList'; @@ -11,10 +16,13 @@ const log = debug( 'typescript-eslint:typescript-estree:parser:parseSettings:createParseSettings', ); +let TSCONFIG_MATCH_CACHE: ExpiringCache | null; + export function createParseSettings( code: string, options: Partial = {}, ): MutableParseSettings { + const singleRun = inferSingleRun(options); const tsconfigRootDir = typeof options.tsconfigRootDir === 'string' ? options.tsconfigRootDir @@ -58,8 +66,14 @@ export function createParseSettings( programs: Array.isArray(options.programs) ? options.programs : null, projects: [], range: options.range === true, - singleRun: inferSingleRun(options), + singleRun, tokens: options.tokens === true ? [] : null, + tsconfigMatchCache: (TSCONFIG_MATCH_CACHE ??= new ExpiringCache( + singleRun + ? 'Infinity' + : options.cacheLifetime?.glob ?? + DEFAULT_TSCONFIG_CACHE_DURATION_SECONDS, + )), tsconfigRootDir, }; @@ -95,7 +109,7 @@ export function createParseSettings( if (!parseSettings.programs) { parseSettings.projects = resolveProjectList({ cacheLifetime: options.cacheLifetime, - project: options.project, + project: getProjectConfigFiles(parseSettings, options.project), projectFolderIgnoreList: options.projectFolderIgnoreList, singleRun: parseSettings.singleRun, tsconfigRootDir: tsconfigRootDir, diff --git a/packages/typescript-estree/src/parseSettings/getProjectConfigFiles.ts b/packages/typescript-estree/src/parseSettings/getProjectConfigFiles.ts new file mode 100644 index 000000000000..d3b97d6102ab --- /dev/null +++ b/packages/typescript-estree/src/parseSettings/getProjectConfigFiles.ts @@ -0,0 +1,59 @@ +import debug from 'debug'; +import * as fs from 'fs'; +import * as path from 'path'; + +import type { ParseSettings } from '.'; + +const log = debug('typescript-eslint:typescript-estree:getProjectConfigFiles'); + +/** + * Checks for a matching TSConfig to a file including its parent directories, + * permanently caching results under each directory it checks. + * + * @remarks + * We don't (yet!) have a way to attach file watchers on disk, but still need to + * cache file checks for rapid subsequent calls to fs.existsSync. See discussion + * in https://github.com/typescript-eslint/typescript-eslint/issues/101. + */ +export function getProjectConfigFiles( + parseSettings: Pick< + ParseSettings, + 'filePath' | 'tsconfigMatchCache' | 'tsconfigRootDir' + >, + project: string | string[] | true | undefined, +): string[] | undefined { + if (project !== true) { + return project === undefined || Array.isArray(project) + ? project + : [project]; + } + + log('Looking for tsconfig.json at or above file: %s', parseSettings.filePath); + let directory = path.dirname(parseSettings.filePath); + const checkedDirectories = [directory]; + + do { + log('Checking tsconfig.json path: %s', directory); + const tsconfigPath = path.join(directory, 'tsconfig.json'); + const cached = + parseSettings.tsconfigMatchCache.get(directory) ?? + (fs.existsSync(tsconfigPath) && tsconfigPath); + + if (cached) { + for (const directory of checkedDirectories) { + parseSettings.tsconfigMatchCache.set(directory, cached); + } + return [cached]; + } + + directory = path.dirname(directory); + checkedDirectories.push(directory); + } while ( + directory.length > 1 && + directory.length >= parseSettings.tsconfigRootDir.length + ); + + throw new Error( + `project was set to \`true\` but couldn't find any tsconfig.json relative to '${parseSettings.filePath}' within '${parseSettings.tsconfigRootDir}'.`, + ); +} diff --git a/packages/typescript-estree/src/parseSettings/index.ts b/packages/typescript-estree/src/parseSettings/index.ts index 53b1acf4a6fb..11df4c78489e 100644 --- a/packages/typescript-estree/src/parseSettings/index.ts +++ b/packages/typescript-estree/src/parseSettings/index.ts @@ -2,6 +2,7 @@ import type * as ts from 'typescript'; import type { CanonicalPath } from '../create-program/shared'; import type { TSESTree } from '../ts-estree'; +import type { CacheLike } from './ExpiringCache'; type DebugModule = 'typescript-eslint' | 'eslint' | 'typescript'; @@ -115,6 +116,11 @@ export interface MutableParseSettings { */ tokens: null | TSESTree.Token[]; + /** + * Caches searches for TSConfigs from project directories. + */ + tsconfigMatchCache: CacheLike; + /** * The absolute path to the root directory for all provided `project`s. */ diff --git a/packages/typescript-estree/src/parser-options.ts b/packages/typescript-estree/src/parser-options.ts index 8cfe3c934c2c..57feea094278 100644 --- a/packages/typescript-estree/src/parser-options.ts +++ b/packages/typescript-estree/src/parser-options.ts @@ -120,10 +120,11 @@ interface ParseAndGenerateServicesOptions extends ParseOptions { preserveNodeMaps?: boolean; /** - * Absolute (or relative to `tsconfigRootDir`) paths to the tsconfig(s). + * Absolute (or relative to `tsconfigRootDir`) paths to the tsconfig(s), + * or `true` to find the nearest tsconfig.json to the file. * If this is provided, type information will be returned. */ - project?: string | string[]; + project?: string | string[] | true; /** * If you provide a glob (or globs) to the project option, you can use this option to ignore certain folders from diff --git a/packages/typescript-estree/tests/fixtures/projectTrue/nested/deep/included.ts b/packages/typescript-estree/tests/fixtures/projectTrue/nested/deep/included.ts new file mode 100644 index 000000000000..9fe571f28c0d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/projectTrue/nested/deep/included.ts @@ -0,0 +1 @@ +const b = true; diff --git a/packages/typescript-estree/tests/fixtures/projectTrue/nested/included.ts b/packages/typescript-estree/tests/fixtures/projectTrue/nested/included.ts new file mode 100644 index 000000000000..9fe571f28c0d --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/projectTrue/nested/included.ts @@ -0,0 +1 @@ +const b = true; diff --git a/packages/typescript-estree/tests/fixtures/projectTrue/nested/tsconfig.json b/packages/typescript-estree/tests/fixtures/projectTrue/nested/tsconfig.json new file mode 100644 index 000000000000..d144c8ddb02c --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/projectTrue/nested/tsconfig.json @@ -0,0 +1,3 @@ +{ + "include": ["."] +} diff --git a/packages/typescript-estree/tests/fixtures/projectTrue/notIncluded.ts b/packages/typescript-estree/tests/fixtures/projectTrue/notIncluded.ts new file mode 100644 index 000000000000..7ceea3e98854 --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/projectTrue/notIncluded.ts @@ -0,0 +1 @@ +const c = true; diff --git a/packages/typescript-estree/tests/lib/createParseSettings.test.ts b/packages/typescript-estree/tests/lib/createParseSettings.test.ts new file mode 100644 index 000000000000..043050cdd2bc --- /dev/null +++ b/packages/typescript-estree/tests/lib/createParseSettings.test.ts @@ -0,0 +1,14 @@ +import { createParseSettings } from '../../src/parseSettings/createParseSettings'; + +describe('createParseSettings', () => { + describe('tsconfigMatchCache', () => { + it('reuses the TSConfig match cache when called a subsequent time', () => { + const parseSettings1 = createParseSettings('input.ts'); + const parseSettings2 = createParseSettings('input.ts'); + + expect(parseSettings1.tsconfigMatchCache).toBe( + parseSettings2.tsconfigMatchCache, + ); + }); + }); +}); diff --git a/packages/typescript-estree/tests/lib/getProjectConfigFiles.test.ts b/packages/typescript-estree/tests/lib/getProjectConfigFiles.test.ts new file mode 100644 index 000000000000..7378508b001c --- /dev/null +++ b/packages/typescript-estree/tests/lib/getProjectConfigFiles.test.ts @@ -0,0 +1,158 @@ +import { ExpiringCache } from '../../src/parseSettings/ExpiringCache'; +import { getProjectConfigFiles } from '../../src/parseSettings/getProjectConfigFiles'; + +const mockExistsSync = jest.fn(); + +jest.mock('fs', () => ({ + ...jest.requireActual('fs'), + existsSync: (filePath: string): boolean => mockExistsSync(filePath), +})); + +const parseSettings = { + filePath: './repos/repo/packages/package/file.ts', + tsconfigMatchCache: new ExpiringCache(1), + tsconfigRootDir: './repos/repo', +}; + +beforeEach(() => { + parseSettings.tsconfigMatchCache.clear(); + jest.clearAllMocks(); +}); + +describe('getProjectConfigFiles', () => { + it('returns an array with just the project when given as a string', () => { + const project = './tsconfig.eslint.json'; + + const actual = getProjectConfigFiles(parseSettings, project); + + expect(actual).toEqual([project]); + }); + + it('returns the project when given as a string array', () => { + const project = ['./tsconfig.eslint.json']; + + const actual = getProjectConfigFiles(parseSettings, project); + + expect(actual).toEqual(project); + }); + + it('returns the project when given as undefined', () => { + const project = undefined; + + const actual = getProjectConfigFiles(parseSettings, project); + + expect(actual).toEqual(project); + }); + + describe('when caching hits', () => { + it('returns a local tsconfig.json without calling existsSync a second time', () => { + mockExistsSync.mockReturnValue(true); + + getProjectConfigFiles(parseSettings, true); + const actual = getProjectConfigFiles(parseSettings, true); + + expect(actual).toEqual(['repos/repo/packages/package/tsconfig.json']); + expect(mockExistsSync).toHaveBeenCalledTimes(1); + }); + + it('returns a nearby parent tsconfig.json when it was previously cached by a different directory search', () => { + mockExistsSync.mockImplementation(input => input === 'a/tsconfig.json'); + + const tsconfigMatchCache = new ExpiringCache(1); + + // This should call to fs.existsSync three times: c, b, a + getProjectConfigFiles( + { + filePath: './a/b/c/d.ts', + tsconfigRootDir: './a', + tsconfigMatchCache, + }, + true, + ); + + // This should call to fs.existsSync once: e + // Then it should retrieve c from cache, pointing to a + const actual = getProjectConfigFiles( + { + filePath: './a/b/c/e/f.ts', + tsconfigRootDir: './a', + tsconfigMatchCache, + }, + true, + ); + + expect(actual).toEqual(['a/tsconfig.json']); + expect(mockExistsSync).toHaveBeenCalledTimes(4); + }); + + it('returns a distant parent tsconfig.json when it was previously cached by a different directory search', () => { + mockExistsSync.mockImplementation(input => input === 'a/tsconfig.json'); + + const tsconfigMatchCache = new ExpiringCache(1); + + // This should call to fs.existsSync 4 times: d, c, b, a + getProjectConfigFiles( + { + filePath: './a/b/c/d/e.ts', + tsconfigRootDir: './a', + tsconfigMatchCache, + }, + true, + ); + + // This should call to fs.existsSync 2: g, f + // Then it should retrieve b from cache, pointing to a + const actual = getProjectConfigFiles( + { + filePath: './a/b/f/g/h.ts', + tsconfigRootDir: './a', + tsconfigMatchCache, + }, + true, + ); + + expect(actual).toEqual(['a/tsconfig.json']); + expect(mockExistsSync).toHaveBeenCalledTimes(6); + }); + }); + + describe('when caching misses', () => { + it('returns a local tsconfig.json when matched', () => { + mockExistsSync.mockReturnValue(true); + + const actual = getProjectConfigFiles(parseSettings, true); + + expect(actual).toEqual(['repos/repo/packages/package/tsconfig.json']); + }); + + it('returns a parent tsconfig.json when matched', () => { + mockExistsSync.mockImplementation( + filePath => filePath === 'repos/repo/tsconfig.json', + ); + + const actual = getProjectConfigFiles(parseSettings, true); + + expect(actual).toEqual(['repos/repo/tsconfig.json']); + }); + + it('throws when searching hits .', () => { + mockExistsSync.mockReturnValue(false); + + expect(() => + getProjectConfigFiles(parseSettings, true), + ).toThrowErrorMatchingInlineSnapshot( + `"project was set to \`true\` but couldn't find any tsconfig.json relative to './repos/repo/packages/package/file.ts' within './repos/repo'."`, + ); + }); + + it('throws when searching passes the tsconfigRootDir', () => { + mockExistsSync.mockReturnValue(false); + + expect(() => + getProjectConfigFiles({ ...parseSettings, tsconfigRootDir: '/' }, true), + ).toThrowErrorMatchingInlineSnapshot( + `"project was set to \`true\` but couldn't find any tsconfig.json relative to './repos/repo/packages/package/file.ts' within '/'."`, + ); + }); + }); +}); diff --git a/packages/typescript-estree/tests/lib/parse.project-true.test.ts b/packages/typescript-estree/tests/lib/parse.project-true.test.ts new file mode 100644 index 000000000000..3e4e47cb2c94 --- /dev/null +++ b/packages/typescript-estree/tests/lib/parse.project-true.test.ts @@ -0,0 +1,49 @@ +import { join } from 'path'; + +import * as parser from '../../src'; + +const PROJECT_DIR = join(__dirname, '../fixtures/projectTrue'); + +const config = { + tsconfigRootDir: PROJECT_DIR, + project: true, +} satisfies Partial; + +describe('parseAndGenerateServices', () => { + describe('when project is true', () => { + it('finds a parent project when it exists in the project', () => { + const result = parser.parseAndGenerateServices('const a = true', { + ...config, + filePath: join(PROJECT_DIR, 'nested/deep/included.ts'), + }); + + expect(result).toEqual({ + ast: expect.any(Object), + services: expect.any(Object), + }); + }); + + it('finds a sibling project when it exists in the project', () => { + const result = parser.parseAndGenerateServices('const a = true', { + ...config, + filePath: join(PROJECT_DIR, 'nested/included.ts'), + }); + + expect(result).toEqual({ + ast: expect.any(Object), + services: expect.any(Object), + }); + }); + + it('throws an error when a parent project does not exist', () => { + expect(() => + parser.parseAndGenerateServices('const a = true', { + ...config, + filePath: join(PROJECT_DIR, 'notIncluded.ts'), + }), + ).toThrow( + /project was set to `true` but couldn't find any tsconfig.json relative to '.+\/tests\/fixtures\/projectTrue\/notIncluded.ts' within '.+\/tests\/fixtures\/projectTrue'./, + ); + }); + }); +}); diff --git a/packages/website/src/components/linter/config.ts b/packages/website/src/components/linter/config.ts index f077f3786ee1..5fa05a4a11b7 100644 --- a/packages/website/src/components/linter/config.ts +++ b/packages/website/src/components/linter/config.ts @@ -18,6 +18,7 @@ export const parseSettings: ParseSettings = { range: true, tokens: [], tsconfigRootDir: '/', + tsconfigMatchCache: new Map(), errorOnTypeScriptSyntacticAndSemanticIssues: false, EXPERIMENTAL_useSourceOfProjectReferenceRedirect: false, singleRun: false, From d6126b88d00601cfc9df9085e21fdb21b58f63cb Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Fri, 10 Feb 2023 14:40:08 +1030 Subject: [PATCH 08/15] chore: add merge_group trigger to run ci on the merge queue (#6445) --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index def7977921ba..4eed32afb742 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,7 @@ on: pull_request: branches: - '**' + merge_group: env: PRIMARY_NODE_VERSION: 18 From e1d9c67981be53e091a4107f326b9bf097650c1f Mon Sep 17 00:00:00 2001 From: Cparros <65684072+cparros@users.noreply.github.com> Date: Thu, 9 Feb 2023 21:17:52 -0700 Subject: [PATCH 09/15] fix(eslint-plugin): [no-unnecessary-condition] account for optional chaining on potentially void values (#6432) * Update error message per #5255 discussion * Add void check to no-unnecessary-condition and test case * Cleanup, update type checks --- .../eslint-plugin/src/rules/no-unnecessary-condition.ts | 7 ++++--- .../tests/rules/no-unnecessary-condition.test.ts | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts index 42f12748af90..596dcf798467 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts @@ -574,10 +574,11 @@ export default createRule({ node.type === AST_NODE_TYPES.MemberExpression ? !isNullableOriginFromPrev(node) : true; + const possiblyVoid = isTypeFlagSet(type, ts.TypeFlags.Void); return ( - isTypeAnyType(type) || - isTypeUnknownType(type) || - (isNullableType(type, { allowUndefined: true }) && isOwnNullable) + isTypeFlagSet(type, ts.TypeFlags.Any | ts.TypeFlags.Unknown) || + (isOwnNullable && + (isNullableType(type, { allowUndefined: true }) || possiblyVoid)) ); } diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts index af8b189f8994..6a5f803605f0 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts @@ -346,6 +346,10 @@ do {} while (true); options: [{ allowConstantLoopConditions: true }], }, ` +let variable = 'abc' as string | void; +variable?.[0]; + `, + ` let foo: undefined | { bar: true }; foo?.bar; `, From bbfed02ce62533d2020dc0b834cfa17e26a6d523 Mon Sep 17 00:00:00 2001 From: Joshua Chen Date: Fri, 10 Feb 2023 11:56:07 -0500 Subject: [PATCH 10/15] chore(website): use Docusaurus Link component, fix broken link (#6448) --- .../website/src/components/ErrorsViewer.tsx | 5 ++-- .../FinancialContributors/Sponsor.tsx | 6 ++-- .../src/components/ast/PropertyName.tsx | 13 ++++---- .../theme/MDXComponents/RuleAttributes.tsx | 30 +++++++------------ .../theme/MDXComponents/TryInPlayground.tsx | 7 +++-- 5 files changed, 28 insertions(+), 33 deletions(-) diff --git a/packages/website/src/components/ErrorsViewer.tsx b/packages/website/src/components/ErrorsViewer.tsx index 0789b84d78c0..178d3fd6573a 100644 --- a/packages/website/src/components/ErrorsViewer.tsx +++ b/packages/website/src/components/ErrorsViewer.tsx @@ -1,3 +1,4 @@ +import Link from '@docusaurus/Link'; import IconExternalLink from '@theme/Icon/ExternalLink'; import clsx from 'clsx'; import type Monaco from 'monaco-editor'; @@ -134,9 +135,9 @@ export default function ErrorsViewer({ {uri && ( <> {' - '} - + docs - + )} diff --git a/packages/website/src/components/FinancialContributors/Sponsor.tsx b/packages/website/src/components/FinancialContributors/Sponsor.tsx index c50ab89b609c..5a9bf43e0410 100644 --- a/packages/website/src/components/FinancialContributors/Sponsor.tsx +++ b/packages/website/src/components/FinancialContributors/Sponsor.tsx @@ -1,3 +1,4 @@ +import Link from '@docusaurus/Link'; import React from 'react'; import styles from './styles.module.css'; @@ -21,14 +22,13 @@ export function Sponsor({ includeName, sponsor }: SponsorProps): JSX.Element { } return ( - {children} - + ); } diff --git a/packages/website/src/components/ast/PropertyName.tsx b/packages/website/src/components/ast/PropertyName.tsx index 41d0f93ca602..5b8afce5d303 100644 --- a/packages/website/src/components/ast/PropertyName.tsx +++ b/packages/website/src/components/ast/PropertyName.tsx @@ -1,3 +1,4 @@ +import Link from '@docusaurus/Link'; import type { MouseEvent } from 'react'; import React, { useCallback } from 'react'; @@ -32,27 +33,27 @@ export default function PropertyName(props: PropertyNameProps): JSX.Element { return props.onClick || props.onHover ? ( <> {props.propName && ( - {props.propName} - + )} {props.propName && : } {props.typeName && ( - {props.typeName} - + )} {props.typeName && } diff --git a/packages/website/src/theme/MDXComponents/RuleAttributes.tsx b/packages/website/src/theme/MDXComponents/RuleAttributes.tsx index 075d0a6af8e1..572ab28dad8a 100644 --- a/packages/website/src/theme/MDXComponents/RuleAttributes.tsx +++ b/packages/website/src/theme/MDXComponents/RuleAttributes.tsx @@ -1,3 +1,4 @@ +import Link from '@docusaurus/Link'; import type { RuleMetaDataDocs } from '@site/../utils/dist/ts-eslint/Rule'; import { useRulesMeta } from '@site/src/hooks/useRulesMeta'; import React from 'react'; @@ -29,18 +30,15 @@ export function RuleAttributes({ name }: { name: string }): React.ReactNode { children: ( <> Extending{' '} - + "plugin:@typescript-eslint/{recommendation}" - {' '} + {' '} in an{' '} - + ESLint configuration - {' '} + {' '} enables this rule. ), @@ -53,12 +51,9 @@ export function RuleAttributes({ name }: { name: string }): React.ReactNode { children: ( <> Some problems reported by this rule are automatically fixable by the{' '} - + --fix ESLint command line option - + . ), @@ -71,12 +66,9 @@ export function RuleAttributes({ name }: { name: string }): React.ReactNode { children: ( <> Some problems reported by this rule are manually fixable by editor{' '} - + suggestions - + . ), @@ -89,9 +81,9 @@ export function RuleAttributes({ name }: { name: string }): React.ReactNode { children: ( <> This rule requires{' '} - + type information - {' '} + {' '} to run. ), diff --git a/packages/website/src/theme/MDXComponents/TryInPlayground.tsx b/packages/website/src/theme/MDXComponents/TryInPlayground.tsx index d9b096f1d909..cc062f6242db 100644 --- a/packages/website/src/theme/MDXComponents/TryInPlayground.tsx +++ b/packages/website/src/theme/MDXComponents/TryInPlayground.tsx @@ -1,3 +1,4 @@ +import Link from '@docusaurus/Link'; import React from 'react'; import styles from './TryInPlayground.module.css'; @@ -8,12 +9,12 @@ export function TryInPlayground({ eslintrcHash: string; }): React.ReactNode { return ( - Try this rule in the playground ↗ - + ); } From 766ab1de882b5af6d570988dd4ba7c30fb0ceabb Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sat, 11 Feb 2023 17:14:44 -0500 Subject: [PATCH 11/15] chore: check package.json existence in package-packages.ts (#6454) --- tests/integration/pack-packages.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/integration/pack-packages.ts b/tests/integration/pack-packages.ts index 6be072edb088..7674f70a1735 100644 --- a/tests/integration/pack-packages.ts +++ b/tests/integration/pack-packages.ts @@ -30,10 +30,12 @@ const tarFolder = tmp.dirSync({ const tseslintPackages: PackageJSON['devDependencies'] = {}; for (const pkg of PACKAGES) { const packageDir = path.join(PACKAGES_DIR, pkg); - const packageJson: PackageJSON = require(path.join( - packageDir, - 'package.json', - )); + const packagePath = path.join(packageDir, 'package.json'); + if (!fs.existsSync(packagePath)) { + continue; + } + + const packageJson = require(packagePath) as PackageJSON; if (packageJson.private === true) { continue; } From a1b3f7b4d97154ac4b0d7934d12f1d5970cffe15 Mon Sep 17 00:00:00 2001 From: YeonJuan Date: Mon, 13 Feb 2023 03:07:23 +0900 Subject: [PATCH 12/15] feat(eslint-plugin): [explicit-function-return-type] add allowIIFEs option (#6237) * feat(eslint-plugin): [explicit-function-return-type] add allowIIFEs option * remove useless code * fix tests * apply reviews * remove useless lint * add tc * fix * add test cases * fix * fix * add test cases * add test case * Update packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts --------- Co-authored-by: Josh Goldberg --- .../rules/explicit-function-return-type.md | 20 ++ .../rules/explicit-function-return-type.ts | 21 ++ .../explicit-function-return-type.test.ts | 214 ++++++++++++++++++ 3 files changed, 255 insertions(+) diff --git a/packages/eslint-plugin/docs/rules/explicit-function-return-type.md b/packages/eslint-plugin/docs/rules/explicit-function-return-type.md index 3a67a7e23721..a5df82f958ab 100644 --- a/packages/eslint-plugin/docs/rules/explicit-function-return-type.md +++ b/packages/eslint-plugin/docs/rules/explicit-function-return-type.md @@ -257,6 +257,26 @@ You may pass function/method names you would like this rule to ignore, like so: } ``` +### `allowIIFE` + +Examples of code for this rule with `{ allowIIFE: true }`: + +#### ❌ Incorrect + +```ts +var func = () => 'foo'; +``` + +#### ✅ Correct + +```ts +var foo = (() => 'foo')(); + +var bar = (function () { + return 'bar'; +})(); +``` + ## When Not To Use It If you don't wish to prevent calling code from using function return values in unexpected ways, then diff --git a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts index 9c91aa6d83d9..254c48a0965c 100644 --- a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts +++ b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts @@ -17,6 +17,7 @@ type Options = [ allowConciseArrowFunctionExpressionsStartingWithVoid?: boolean; allowFunctionsWithoutTypeParameters?: boolean; allowedNames?: string[]; + allowIIFEs?: boolean; }, ]; type MessageIds = 'missingReturnType'; @@ -75,6 +76,11 @@ export default util.createRule({ }, type: 'array', }, + allowIIFEs: { + description: + 'Whether to ignore immediately invoked function expressions (IIFEs).', + type: 'boolean', + }, }, additionalProperties: false, }, @@ -88,6 +94,7 @@ export default util.createRule({ allowDirectConstAssertionInArrowFunctions: true, allowConciseArrowFunctionExpressionsStartingWithVoid: false, allowedNames: [], + allowIIFEs: false, }, ], create(context, [options]) { @@ -102,6 +109,10 @@ export default util.createRule({ return true; } + if (options.allowIIFEs && isIIFE(node)) { + return true; + } + if (!options.allowedNames?.length) { return false; } @@ -149,6 +160,16 @@ export default util.createRule({ } return false; } + + function isIIFE( + node: + | TSESTree.ArrowFunctionExpression + | TSESTree.FunctionExpression + | TSESTree.FunctionDeclaration, + ): boolean { + return node.parent!.type === AST_NODE_TYPES.CallExpression; + } + return { 'ArrowFunctionExpression, FunctionExpression'( node: TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression, diff --git a/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts b/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts index 912242247af7..d3c1a5401926 100644 --- a/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts +++ b/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts @@ -595,6 +595,132 @@ const x: Bar = arg1 => arg2 => arg1 + arg2; }, ], }, + { + filename: 'test.ts', + code: ` +let foo = function (): number { + return 1; +}; + `, + options: [ + { + allowIIFEs: true, + }, + ], + }, + { + filename: 'test.ts', + code: ` +const foo = (function () { + return 1; +})(); + `, + options: [ + { + allowIIFEs: true, + }, + ], + }, + { + filename: 'test.ts', + code: ` +const foo = (() => { + return 1; +})(); + `, + options: [ + { + allowIIFEs: true, + }, + ], + }, + { + filename: 'test.ts', + code: ` +const foo = ((arg: number): number => { + return arg; +})(0); + `, + options: [ + { + allowIIFEs: true, + }, + ], + }, + { + filename: 'test.ts', + code: ` +const foo = (() => (() => 'foo')())(); + `, + options: [ + { + allowIIFEs: true, + }, + ], + }, + { + filename: 'test.ts', + code: ` +let foo = (() => (): string => { + return 'foo'; +})()(); + `, + options: [ + { + allowIIFEs: true, + }, + ], + }, + { + filename: 'test.ts', + code: ` +let foo = (() => (): string => { + return 'foo'; +})(); + `, + options: [ + { + allowIIFEs: true, + allowHigherOrderFunctions: false, + }, + ], + }, + { + filename: 'test.ts', + code: ` +let foo = (() => (): string => { + return 'foo'; +})()(); + `, + options: [ + { + allowIIFEs: true, + allowHigherOrderFunctions: true, + }, + ], + }, + { + filename: 'test.ts', + code: ` +let foo = (() => (): void => {})()(); + `, + options: [ + { + allowIIFEs: true, + }, + ], + }, + { + filename: 'test.ts', + code: ` +let foo = (() => (() => {})())(); + `, + options: [ + { + allowIIFEs: true, + }, + ], + }, ], invalid: [ { @@ -1477,5 +1603,93 @@ class Foo { }, ], }, + { + filename: 'test.ts', + code: ` +const foo = (function () { + return 'foo'; +})(); + `, + options: [ + { + allowIIFEs: false, + }, + ], + errors: [ + { + messageId: 'missingReturnType', + line: 2, + endLine: 2, + column: 14, + endColumn: 25, + }, + ], + }, + { + filename: 'test.ts', + code: ` +const foo = (function () { + return () => { + return 1; + }; +})(); + `, + options: [ + { + allowIIFEs: true, + }, + ], + errors: [ + { + messageId: 'missingReturnType', + line: 3, + endLine: 3, + column: 10, + endColumn: 15, + }, + ], + }, + { + filename: 'test.ts', + code: ` +let foo = function () { + return 'foo'; +}; + `, + options: [ + { + allowIIFEs: true, + }, + ], + errors: [ + { + messageId: 'missingReturnType', + line: 2, + endLine: 2, + column: 11, + endColumn: 22, + }, + ], + }, + { + filename: 'test.ts', + code: ` +let foo = (() => () => {})()(); + `, + options: [ + { + allowIIFEs: true, + }, + ], + errors: [ + { + messageId: 'missingReturnType', + line: 2, + endLine: 2, + column: 18, + endColumn: 23, + }, + ], + }, ], }); From d569924cf3c223c185f6ba913390cd865cd33197 Mon Sep 17 00:00:00 2001 From: uhyo Date: Mon, 13 Feb 2023 10:52:25 +0900 Subject: [PATCH 13/15] fix(eslint-plugin): [no-unnecessary-condition] fix false positive when checking indexed access types (#6452) * add new tests * allow naked index access type to be a condition --- .../src/rules/no-unnecessary-condition.ts | 4 +- .../rules/no-unnecessary-condition.test.ts | 75 +++++++++++++++++++ 2 files changed, 77 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts index 596dcf798467..4951e281af4e 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts @@ -235,13 +235,13 @@ export default createRule({ const type = getNodeType(node); // Conditional is always necessary if it involves: - // `any` or `unknown` or a naked type parameter + // `any` or `unknown` or a naked type variable if ( unionTypeParts(type).some( part => isTypeAnyType(part) || isTypeUnknownType(part) || - isTypeFlagSet(part, ts.TypeFlags.TypeParameter), + isTypeFlagSet(part, ts.TypeFlags.TypeVariable), ) ) { return; diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts index 6a5f803605f0..96cad00c908b 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts @@ -549,6 +549,36 @@ type OptionalFoo = Foo | undefined; declare const foo: OptionalFoo; foo?.[1]?.length; `, + // https://github.com/typescript-eslint/typescript-eslint/issues/6264 + ` +function get(obj: Obj, key: Key) { + const value = obj[key]; + if (value) { + return value; + } + throw new Error('BOOM!'); +} + +get({ foo: null }, 'foo'); + `, + { + code: ` +function getElem(dict: Record, key: string) { + if (dict[key]) { + return dict[key].foo; + } else { + return ''; + } +} + `, + parserOptions: { + tsconfigRootDir: getFixturesRootDir(), + project: './tsconfig.noUncheckedIndexedAccess.json', + }, + dependencyConstraints: { + typescript: '4.1', + }, + }, ], invalid: [ // Ensure that it's checking in all the right places @@ -1601,5 +1631,50 @@ foo?.test.length; }, ], }, + { + code: ` +function pick, Key extends keyof Obj>( + obj: Obj, + key: Key, +): Obj[Key] { + const k = obj[key]; + if (obj[key]) { + return obj[key]; + } + throw new Error('Boom!'); +} + +pick({ foo: 1, bar: 2 }, 'bar'); + `, + errors: [ + { + messageId: 'alwaysTruthy', + line: 7, + endLine: 7, + column: 7, + endColumn: 15, + }, + ], + }, + { + code: ` +function getElem(dict: Record, key: string) { + if (dict[key]) { + return dict[key].foo; + } else { + return ''; + } +} + `, + errors: [ + { + messageId: 'alwaysTruthy', + line: 3, + endLine: 3, + column: 7, + endColumn: 16, + }, + ], + }, ], }); From b2db3f57d3b551e1159380c3d23edee14f133ac1 Mon Sep 17 00:00:00 2001 From: Omri Luzon Date: Mon, 13 Feb 2023 03:53:21 +0200 Subject: [PATCH 14/15] feat(eslint-plugin): [block-spacing] extending base rule for TS related blocks (#6195) * feat/issue5990-extend-base-block-spacing * for history * fixes * cleanup * with a comment for the option * support enums as well * template string * fix doc * fix doc * typescript -> TypeScript * add missing things * CR: remove jsdoc types * rename typeDeclaration -> typeDeclarations * more valid cases with comments * invalid cases with block comments * more concise * fix comment * fix lint error --- .../eslint-plugin/docs/rules/block-spacing.md | 12 ++ packages/eslint-plugin/src/configs/all.ts | 2 + .../eslint-plugin/src/rules/block-spacing.ts | 163 ++++++++++++++++++ packages/eslint-plugin/src/rules/index.ts | 2 + .../src/util/getESLintCoreRule.ts | 1 + .../tests/rules/block-spacing.test.ts | 145 ++++++++++++++++ .../eslint-plugin/typings/eslint-rules.d.ts | 15 ++ 7 files changed, 340 insertions(+) create mode 100644 packages/eslint-plugin/docs/rules/block-spacing.md create mode 100644 packages/eslint-plugin/src/rules/block-spacing.ts create mode 100644 packages/eslint-plugin/tests/rules/block-spacing.test.ts diff --git a/packages/eslint-plugin/docs/rules/block-spacing.md b/packages/eslint-plugin/docs/rules/block-spacing.md new file mode 100644 index 000000000000..6a902214bbb4 --- /dev/null +++ b/packages/eslint-plugin/docs/rules/block-spacing.md @@ -0,0 +1,12 @@ +--- +description: 'Disallow or enforce spaces inside of blocks after opening block and before closing block.' +--- + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/block-spacing** for documentation. + +## Examples + +This rule extends the base [`eslint/block-spacing`](https://eslint.org/docs/rules/block-spacing) rule. +This version adds support for TypeScript related blocks (interfaces, object type literals and enums). diff --git a/packages/eslint-plugin/src/configs/all.ts b/packages/eslint-plugin/src/configs/all.ts index eb3856f10c3b..834f4dbb7aea 100644 --- a/packages/eslint-plugin/src/configs/all.ts +++ b/packages/eslint-plugin/src/configs/all.ts @@ -11,6 +11,8 @@ export = { '@typescript-eslint/ban-ts-comment': 'error', '@typescript-eslint/ban-tslint-comment': 'error', '@typescript-eslint/ban-types': 'error', + 'block-spacing': 'off', + '@typescript-eslint/block-spacing': 'error', 'brace-style': 'off', '@typescript-eslint/brace-style': 'error', '@typescript-eslint/class-literal-property-style': 'error', diff --git a/packages/eslint-plugin/src/rules/block-spacing.ts b/packages/eslint-plugin/src/rules/block-spacing.ts new file mode 100644 index 000000000000..745132978f77 --- /dev/null +++ b/packages/eslint-plugin/src/rules/block-spacing.ts @@ -0,0 +1,163 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_TOKEN_TYPES } from '@typescript-eslint/utils'; + +import * as util from '../util'; +import { getESLintCoreRule } from '../util/getESLintCoreRule'; + +const baseRule = getESLintCoreRule('block-spacing'); + +export type Options = util.InferOptionsTypeFromRule; +export type MessageIds = util.InferMessageIdsTypeFromRule; + +export default util.createRule({ + name: 'block-spacing', + meta: { + type: 'layout', + docs: { + description: + 'Disallow or enforce spaces inside of blocks after opening block and before closing block', + recommended: false, + extendsBaseRule: true, + }, + fixable: 'whitespace', + hasSuggestions: baseRule.meta.hasSuggestions, + schema: baseRule.meta.schema, + messages: baseRule.meta.messages, + }, + defaultOptions: ['always'], + + create(context, [whenToApplyOption]) { + const sourceCode = context.getSourceCode(); + const baseRules = baseRule.create(context); + const always = whenToApplyOption !== 'never'; + const messageId = always ? 'missing' : 'extra'; + /** + * Gets the open brace token from a given node. + * @returns The token of the open brace. + */ + function getOpenBrace( + node: TSESTree.TSEnumDeclaration, + ): TSESTree.PunctuatorToken { + // guaranteed for enums + // This is the only change made here from the base rule + return sourceCode.getFirstToken(node, { + filter: token => + token.type === AST_TOKEN_TYPES.Punctuator && token.value === '{', + }) as TSESTree.PunctuatorToken; + } + + /** + * Checks whether or not: + * - given tokens are on same line. + * - there is/isn't a space between given tokens. + * @param left A token to check. + * @param right The token which is next to `left`. + * @returns + * When the option is `"always"`, `true` if there are one or more spaces between given tokens. + * When the option is `"never"`, `true` if there are not any spaces between given tokens. + * If given tokens are not on same line, it's always `true`. + */ + function isValid(left: TSESTree.Token, right: TSESTree.Token): boolean { + return ( + !util.isTokenOnSameLine(left, right) || + sourceCode.isSpaceBetween!(left, right) === always + ); + } + + /** + * Checks and reports invalid spacing style inside braces. + */ + function checkSpacingInsideBraces(node: TSESTree.TSEnumDeclaration): void { + // Gets braces and the first/last token of content. + const openBrace = getOpenBrace(node); + const closeBrace = sourceCode.getLastToken(node)!; + const firstToken = sourceCode.getTokenAfter(openBrace, { + includeComments: true, + })!; + const lastToken = sourceCode.getTokenBefore(closeBrace, { + includeComments: true, + })!; + + // Skip if the node is invalid or empty. + if ( + openBrace.type !== AST_TOKEN_TYPES.Punctuator || + openBrace.value !== '{' || + closeBrace.type !== AST_TOKEN_TYPES.Punctuator || + closeBrace.value !== '}' || + firstToken === closeBrace + ) { + return; + } + + // Skip line comments for option never + if (!always && firstToken.type === AST_TOKEN_TYPES.Line) { + return; + } + + if (!isValid(openBrace, firstToken)) { + let loc = openBrace.loc; + + if (messageId === 'extra') { + loc = { + start: openBrace.loc.end, + end: firstToken.loc.start, + }; + } + + context.report({ + node, + loc, + messageId, + data: { + location: 'after', + token: openBrace.value, + }, + fix(fixer) { + if (always) { + return fixer.insertTextBefore(firstToken, ' '); + } + + return fixer.removeRange([openBrace.range[1], firstToken.range[0]]); + }, + }); + } + if (!isValid(lastToken, closeBrace)) { + let loc = closeBrace.loc; + + if (messageId === 'extra') { + loc = { + start: lastToken.loc.end, + end: closeBrace.loc.start, + }; + } + context.report({ + node, + loc, + messageId, + data: { + location: 'before', + token: closeBrace.value, + }, + fix(fixer) { + if (always) { + return fixer.insertTextAfter(lastToken, ' '); + } + + return fixer.removeRange([lastToken.range[1], closeBrace.range[0]]); + }, + }); + } + } + return { + ...baseRules, + + // This code worked "out of the box" for interface and type literal + // Enums were very close to match as well, the only reason they are not is that was that enums don't have a body node in the parser + // So the opening brace punctuator starts in the middle of the node - `getFirstToken` in + // the base rule did not filter for the first opening brace punctuator + TSInterfaceBody: baseRules.BlockStatement as never, + TSTypeLiteral: baseRules.BlockStatement as never, + TSEnumDeclaration: checkSpacingInsideBraces, + }; + }, +}); diff --git a/packages/eslint-plugin/src/rules/index.ts b/packages/eslint-plugin/src/rules/index.ts index bbddfc8d4709..4f96ec29364f 100644 --- a/packages/eslint-plugin/src/rules/index.ts +++ b/packages/eslint-plugin/src/rules/index.ts @@ -4,6 +4,7 @@ import awaitThenable from './await-thenable'; import banTsComment from './ban-ts-comment'; import banTslintComment from './ban-tslint-comment'; import banTypes from './ban-types'; +import blockSpacing from './block-spacing'; import braceStyle from './brace-style'; import classLiteralPropertyStyle from './class-literal-property-style'; import commaDangle from './comma-dangle'; @@ -137,6 +138,7 @@ export default { 'ban-ts-comment': banTsComment, 'ban-tslint-comment': banTslintComment, 'ban-types': banTypes, + 'block-spacing': blockSpacing, 'brace-style': braceStyle, 'class-literal-property-style': classLiteralPropertyStyle, 'comma-dangle': commaDangle, diff --git a/packages/eslint-plugin/src/util/getESLintCoreRule.ts b/packages/eslint-plugin/src/util/getESLintCoreRule.ts index 80962a677b05..ae68a317e080 100644 --- a/packages/eslint-plugin/src/util/getESLintCoreRule.ts +++ b/packages/eslint-plugin/src/util/getESLintCoreRule.ts @@ -7,6 +7,7 @@ const isESLintV8 = semver.major(version) >= 8; interface RuleMap { /* eslint-disable @typescript-eslint/consistent-type-imports -- more concise to use inline imports */ 'arrow-parens': typeof import('eslint/lib/rules/arrow-parens'); + 'block-spacing': typeof import('eslint/lib/rules/block-spacing'); 'brace-style': typeof import('eslint/lib/rules/brace-style'); 'comma-dangle': typeof import('eslint/lib/rules/comma-dangle'); 'dot-notation': typeof import('eslint/lib/rules/dot-notation'); diff --git a/packages/eslint-plugin/tests/rules/block-spacing.test.ts b/packages/eslint-plugin/tests/rules/block-spacing.test.ts new file mode 100644 index 000000000000..49578b8c0618 --- /dev/null +++ b/packages/eslint-plugin/tests/rules/block-spacing.test.ts @@ -0,0 +1,145 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + +import rule from '../../src/rules/block-spacing'; +import type { InvalidTestCase, ValidTestCase } from '../RuleTester'; +import { RuleTester } from '../RuleTester'; + +const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', +}); + +type InvalidBlockSpacingTestCase = InvalidTestCase< + 'missing' | 'extra', + ['always' | 'never'] +>; + +const options = ['always', 'never'] as const; +const typeDeclarations = [ + { + nodeType: AST_NODE_TYPES.TSInterfaceBody, + stringPrefix: 'interface Foo ', + }, + { + nodeType: AST_NODE_TYPES.TSTypeLiteral, + stringPrefix: 'type Foo = ', + }, + { + nodeType: AST_NODE_TYPES.TSEnumDeclaration, + stringPrefix: 'enum Foo ', + }, + { + nodeType: AST_NODE_TYPES.TSEnumDeclaration, + stringPrefix: 'const enum Foo ', + }, +]; +const emptyBlocks = ['{}', '{ }']; +const singlePropertyBlocks = ['{bar: true}', '{ bar: true }']; +const blockComment = '/* comment */'; + +ruleTester.run('block-spacing', rule, { + valid: [ + // Empty blocks don't apply + ...options.flatMap(option => + typeDeclarations.flatMap(typeDec => + emptyBlocks.map>(blockType => ({ + code: typeDec.stringPrefix + blockType, + options: [option], + })), + ), + ), + ...typeDeclarations.flatMap>( + typeDec => { + const property = + typeDec.nodeType === AST_NODE_TYPES.TSEnumDeclaration + ? 'bar = 1' + : 'bar: true;'; + return [ + { + code: `${typeDec.stringPrefix}{ /* comment */ ${property} /* comment */ } // always`, + options: ['always'], + }, + { + code: `${typeDec.stringPrefix}{/* comment */ ${property} /* comment */} // never`, + options: ['never'], + }, + { + code: `${typeDec.stringPrefix}{ //comment\n ${property}}`, + options: ['never'], + }, + ]; + }, + ), + ], + invalid: [ + ...options.flatMap(option => + typeDeclarations.flatMap(typeDec => { + return singlePropertyBlocks.flatMap( + (blockType, blockIndex) => { + // These are actually valid, so filter them out + if ( + (option === 'always' && blockType.startsWith('{ ')) || + (option === 'never' && blockType.startsWith('{bar')) + ) { + return []; + } + const reverseBlockType = singlePropertyBlocks[1 - blockIndex]; + let code = `${typeDec.stringPrefix}${blockType}; /* ${option} */`; + let output = `${typeDec.stringPrefix}${reverseBlockType}; /* ${option} */`; + if (typeDec.nodeType === AST_NODE_TYPES.TSEnumDeclaration) { + output = output.replace(':', '='); + code = code.replace(':', '='); + } + + return { + code, + options: [option], + output, + errors: [ + { + type: typeDec.nodeType, + messageId: option === 'always' ? 'missing' : 'extra', + data: { location: 'after', token: '{' }, + }, + { + type: typeDec.nodeType, + messageId: option === 'always' ? 'missing' : 'extra', + data: { location: 'before', token: '}' }, + }, + ], + }; + }, + ); + }), + ), + // With block comments + ...options.flatMap(option => + typeDeclarations.flatMap(typeDec => { + const property = + typeDec.nodeType === AST_NODE_TYPES.TSEnumDeclaration + ? 'bar = 1' + : 'bar: true;'; + const alwaysSpace = option === 'always' ? '' : ' '; + const neverSpace = option === 'always' ? ' ' : ''; + return [ + { + code: `${typeDec.stringPrefix}{${alwaysSpace}${blockComment}${property}${blockComment}${alwaysSpace}} /* ${option} */`, + output: `${typeDec.stringPrefix}{${neverSpace}${blockComment}${property}${blockComment}${neverSpace}} /* ${option} */`, + options: [option], + errors: [ + { + type: typeDec.nodeType, + messageId: option === 'always' ? 'missing' : 'extra', + data: { location: 'after', token: '{' }, + }, + { + type: typeDec.nodeType, + messageId: option === 'always' ? 'missing' : 'extra', + data: { location: 'before', token: '}' }, + }, + ], + }, + ]; + }), + ), + ], +}); diff --git a/packages/eslint-plugin/typings/eslint-rules.d.ts b/packages/eslint-plugin/typings/eslint-rules.d.ts index 38682f60c5b2..f5e0f715f0b4 100644 --- a/packages/eslint-plugin/typings/eslint-rules.d.ts +++ b/packages/eslint-plugin/typings/eslint-rules.d.ts @@ -661,6 +661,21 @@ declare module 'eslint/lib/rules/quotes' { export = rule; } +declare module 'eslint/lib/rules/block-spacing' { + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; + + const rule: TSESLint.RuleModule< + 'missing' | 'extra', + ['always' | 'never'], + { + BlockStatement(node: TSESTree.BlockStatement): void; + StaticBlock(node: TSESTree.StaticBlock): void; + SwitchStatement(node: TSESTree.SwitchStatement): void; + } + >; + export = rule; +} + declare module 'eslint/lib/rules/brace-style' { import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; From c46c793a34f82914a54b624adb57dfd4ac493633 Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 13 Feb 2023 17:16:10 +0000 Subject: [PATCH 15/15] chore: publish v5.52.0 --- CHANGELOG.md | 23 ++++++++++++++++++++ lerna.json | 2 +- packages/ast-spec/CHANGELOG.md | 11 ++++++++++ packages/ast-spec/package.json | 2 +- packages/eslint-plugin-internal/CHANGELOG.md | 8 +++++++ packages/eslint-plugin-internal/package.json | 8 +++---- packages/eslint-plugin-tslint/CHANGELOG.md | 8 +++++++ packages/eslint-plugin-tslint/package.json | 6 ++--- packages/eslint-plugin/CHANGELOG.md | 21 ++++++++++++++++++ packages/eslint-plugin/package.json | 8 +++---- packages/experimental-utils/CHANGELOG.md | 8 +++++++ packages/experimental-utils/package.json | 4 ++-- packages/parser/CHANGELOG.md | 8 +++++++ packages/parser/package.json | 8 +++---- packages/scope-manager/CHANGELOG.md | 8 +++++++ packages/scope-manager/package.json | 8 +++---- packages/type-utils/CHANGELOG.md | 8 +++++++ packages/type-utils/package.json | 8 +++---- packages/types/CHANGELOG.md | 11 ++++++++++ packages/types/package.json | 2 +- packages/typescript-estree/CHANGELOG.md | 12 ++++++++++ packages/typescript-estree/package.json | 6 ++--- packages/utils/CHANGELOG.md | 8 +++++++ packages/utils/package.json | 10 ++++----- packages/visitor-keys/CHANGELOG.md | 8 +++++++ packages/visitor-keys/package.json | 4 ++-- packages/website-eslint/CHANGELOG.md | 8 +++++++ packages/website-eslint/package.json | 16 +++++++------- packages/website/CHANGELOG.md | 11 ++++++++++ packages/website/package.json | 8 +++---- 30 files changed, 211 insertions(+), 50 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 951438d13b65..255561e80f28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,29 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.52.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.51.0...v5.52.0) (2023-02-13) + + +### Bug Fixes + +* **eslint-plugin:** [no-import-type-side-effects] correctly ignore zero-specifier imports ([#6444](https://github.com/typescript-eslint/typescript-eslint/issues/6444)) ([d5a6688](https://github.com/typescript-eslint/typescript-eslint/commit/d5a6688a22ebaa2992e549f44c224fc8d0fc5cc7)) +* **eslint-plugin:** [no-unnecessary-condition] account for optional chaining on potentially void values ([#6432](https://github.com/typescript-eslint/typescript-eslint/issues/6432)) ([e1d9c67](https://github.com/typescript-eslint/typescript-eslint/commit/e1d9c67981be53e091a4107f326b9bf097650c1f)), closes [#5255](https://github.com/typescript-eslint/typescript-eslint/issues/5255) +* **eslint-plugin:** [no-unnecessary-condition] fix false positive when checking indexed access types ([#6452](https://github.com/typescript-eslint/typescript-eslint/issues/6452)) ([d569924](https://github.com/typescript-eslint/typescript-eslint/commit/d569924cf3c223c185f6ba913390cd865cd33197)) +* **eslint-plugin:** fix key-spacing when type starts on next line ([#6412](https://github.com/typescript-eslint/typescript-eslint/issues/6412)) ([3eb2eed](https://github.com/typescript-eslint/typescript-eslint/commit/3eb2eed6167e2ffad6c44c0fcbd86be4b6202aeb)) + + +### Features + +* **eslint-plugin:** [block-spacing] extending base rule for TS related blocks ([#6195](https://github.com/typescript-eslint/typescript-eslint/issues/6195)) ([b2db3f5](https://github.com/typescript-eslint/typescript-eslint/commit/b2db3f57d3b551e1159380c3d23edee14f133ac1)) +* **eslint-plugin:** [explicit-function-return-type] add allowFunctionsWithoutTypeParameters option ([#6105](https://github.com/typescript-eslint/typescript-eslint/issues/6105)) ([113640e](https://github.com/typescript-eslint/typescript-eslint/commit/113640e9742acb3a193078e9704648517aebf1d8)) +* **eslint-plugin:** [explicit-function-return-type] add allowIIFEs option ([#6237](https://github.com/typescript-eslint/typescript-eslint/issues/6237)) ([a1b3f7b](https://github.com/typescript-eslint/typescript-eslint/commit/a1b3f7b4d97154ac4b0d7934d12f1d5970cffe15)) +* **typescript-estree:** add `.kind` to `TSModuleDeclaration` ([#6443](https://github.com/typescript-eslint/typescript-eslint/issues/6443)) ([2f948df](https://github.com/typescript-eslint/typescript-eslint/commit/2f948df35b73d916e7fe42b21343568b1617e3f1)) +* **typescript-estree:** allow specifying project: true ([#6084](https://github.com/typescript-eslint/typescript-eslint/issues/6084)) ([dcd05f0](https://github.com/typescript-eslint/typescript-eslint/commit/dcd05f0b3ab62779571294d08a4542d66ebb2294)) + + + + + # [5.51.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.50.0...v5.51.0) (2023-02-06) diff --git a/lerna.json b/lerna.json index 719e543d7471..34a5c794792f 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "5.51.0", + "version": "5.52.0", "npmClient": "yarn", "useWorkspaces": true, "stream": true diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 4b57fd921e85..6ab088872202 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.52.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.51.0...v5.52.0) (2023-02-13) + + +### Features + +* **typescript-estree:** add `.kind` to `TSModuleDeclaration` ([#6443](https://github.com/typescript-eslint/typescript-eslint/issues/6443)) ([2f948df](https://github.com/typescript-eslint/typescript-eslint/commit/2f948df35b73d916e7fe42b21343568b1617e3f1)) + + + + + # [5.51.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.50.0...v5.51.0) (2023-02-06) **Note:** Version bump only for package @typescript-eslint/ast-spec diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index c1e472c43655..20958b3936cc 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "5.51.0", + "version": "5.52.0", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin-internal/CHANGELOG.md b/packages/eslint-plugin-internal/CHANGELOG.md index 1cec28fd8aea..dffac1534ac0 100644 --- a/packages/eslint-plugin-internal/CHANGELOG.md +++ b/packages/eslint-plugin-internal/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.52.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.51.0...v5.52.0) (2023-02-13) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal + + + + + # [5.51.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.50.0...v5.51.0) (2023-02-06) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json index f5d0e2b957e5..1c0f3366bc67 100644 --- a/packages/eslint-plugin-internal/package.json +++ b/packages/eslint-plugin-internal/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin-internal", - "version": "5.51.0", + "version": "5.52.0", "private": true, "main": "dist/index.js", "scripts": { @@ -14,9 +14,9 @@ }, "dependencies": { "@types/prettier": "*", - "@typescript-eslint/scope-manager": "5.51.0", - "@typescript-eslint/type-utils": "5.51.0", - "@typescript-eslint/utils": "5.51.0", + "@typescript-eslint/scope-manager": "5.52.0", + "@typescript-eslint/type-utils": "5.52.0", + "@typescript-eslint/utils": "5.52.0", "prettier": "*" } } diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md index 992cc4adb477..d2ea44737e17 100644 --- a/packages/eslint-plugin-tslint/CHANGELOG.md +++ b/packages/eslint-plugin-tslint/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.52.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.51.0...v5.52.0) (2023-02-13) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint + + + + + # [5.51.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.50.0...v5.51.0) (2023-02-06) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json index 764c382788dd..3766fbc2785c 100644 --- a/packages/eslint-plugin-tslint/package.json +++ b/packages/eslint-plugin-tslint/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin-tslint", - "version": "5.51.0", + "version": "5.52.0", "main": "dist/index.js", "typings": "src/index.ts", "description": "ESLint plugin that wraps a TSLint configuration and lints the whole source using TSLint", @@ -38,7 +38,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/utils": "5.51.0", + "@typescript-eslint/utils": "5.52.0", "lodash": "^4.17.21" }, "peerDependencies": { @@ -48,6 +48,6 @@ }, "devDependencies": { "@types/lodash": "*", - "@typescript-eslint/parser": "5.51.0" + "@typescript-eslint/parser": "5.52.0" } } diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 3df0f2a57df7..38b4abf48f7f 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -3,6 +3,27 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.52.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.51.0...v5.52.0) (2023-02-13) + + +### Bug Fixes + +* **eslint-plugin:** [no-import-type-side-effects] correctly ignore zero-specifier imports ([#6444](https://github.com/typescript-eslint/typescript-eslint/issues/6444)) ([d5a6688](https://github.com/typescript-eslint/typescript-eslint/commit/d5a6688a22ebaa2992e549f44c224fc8d0fc5cc7)) +* **eslint-plugin:** [no-unnecessary-condition] account for optional chaining on potentially void values ([#6432](https://github.com/typescript-eslint/typescript-eslint/issues/6432)) ([e1d9c67](https://github.com/typescript-eslint/typescript-eslint/commit/e1d9c67981be53e091a4107f326b9bf097650c1f)), closes [#5255](https://github.com/typescript-eslint/typescript-eslint/issues/5255) +* **eslint-plugin:** [no-unnecessary-condition] fix false positive when checking indexed access types ([#6452](https://github.com/typescript-eslint/typescript-eslint/issues/6452)) ([d569924](https://github.com/typescript-eslint/typescript-eslint/commit/d569924cf3c223c185f6ba913390cd865cd33197)) +* **eslint-plugin:** fix key-spacing when type starts on next line ([#6412](https://github.com/typescript-eslint/typescript-eslint/issues/6412)) ([3eb2eed](https://github.com/typescript-eslint/typescript-eslint/commit/3eb2eed6167e2ffad6c44c0fcbd86be4b6202aeb)) + + +### Features + +* **eslint-plugin:** [block-spacing] extending base rule for TS related blocks ([#6195](https://github.com/typescript-eslint/typescript-eslint/issues/6195)) ([b2db3f5](https://github.com/typescript-eslint/typescript-eslint/commit/b2db3f57d3b551e1159380c3d23edee14f133ac1)) +* **eslint-plugin:** [explicit-function-return-type] add allowFunctionsWithoutTypeParameters option ([#6105](https://github.com/typescript-eslint/typescript-eslint/issues/6105)) ([113640e](https://github.com/typescript-eslint/typescript-eslint/commit/113640e9742acb3a193078e9704648517aebf1d8)) +* **eslint-plugin:** [explicit-function-return-type] add allowIIFEs option ([#6237](https://github.com/typescript-eslint/typescript-eslint/issues/6237)) ([a1b3f7b](https://github.com/typescript-eslint/typescript-eslint/commit/a1b3f7b4d97154ac4b0d7934d12f1d5970cffe15)) + + + + + # [5.51.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.50.0...v5.51.0) (2023-02-06) diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 0a4fa810a7e4..6a1a7a11ef97 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "5.51.0", + "version": "5.52.0", "description": "TypeScript plugin for ESLint", "keywords": [ "eslint", @@ -44,9 +44,9 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/scope-manager": "5.51.0", - "@typescript-eslint/type-utils": "5.51.0", - "@typescript-eslint/utils": "5.51.0", + "@typescript-eslint/scope-manager": "5.52.0", + "@typescript-eslint/type-utils": "5.52.0", + "@typescript-eslint/utils": "5.52.0", "debug": "^4.3.4", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", diff --git a/packages/experimental-utils/CHANGELOG.md b/packages/experimental-utils/CHANGELOG.md index ddc32b003c5b..94427418823f 100644 --- a/packages/experimental-utils/CHANGELOG.md +++ b/packages/experimental-utils/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.52.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.51.0...v5.52.0) (2023-02-13) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + # [5.51.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.50.0...v5.51.0) (2023-02-06) **Note:** Version bump only for package @typescript-eslint/experimental-utils diff --git a/packages/experimental-utils/package.json b/packages/experimental-utils/package.json index 361143560976..ff26cba1efc0 100644 --- a/packages/experimental-utils/package.json +++ b/packages/experimental-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/experimental-utils", - "version": "5.51.0", + "version": "5.52.0", "description": "(Experimental) Utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -38,7 +38,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/utils": "5.51.0" + "@typescript-eslint/utils": "5.52.0" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index b6d0b1016f3b..fc2559102482 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.52.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.51.0...v5.52.0) (2023-02-13) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + # [5.51.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.50.0...v5.51.0) (2023-02-06) **Note:** Version bump only for package @typescript-eslint/parser diff --git a/packages/parser/package.json b/packages/parser/package.json index e2bddc8fca28..796da4dda8a1 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "5.51.0", + "version": "5.52.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -45,9 +45,9 @@ "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "5.51.0", - "@typescript-eslint/types": "5.51.0", - "@typescript-eslint/typescript-estree": "5.51.0", + "@typescript-eslint/scope-manager": "5.52.0", + "@typescript-eslint/types": "5.52.0", + "@typescript-eslint/typescript-estree": "5.52.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index c19e0b075295..f471f61a2344 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.52.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.51.0...v5.52.0) (2023-02-13) + +**Note:** Version bump only for package @typescript-eslint/scope-manager + + + + + # [5.51.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.50.0...v5.51.0) (2023-02-06) **Note:** Version bump only for package @typescript-eslint/scope-manager diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index c600e4ff2fd7..9ab6b584821d 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "5.51.0", + "version": "5.52.0", "description": "TypeScript scope analyser for ESLint", "keywords": [ "eslint", @@ -38,12 +38,12 @@ "typecheck": "nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "5.51.0", - "@typescript-eslint/visitor-keys": "5.51.0" + "@typescript-eslint/types": "5.52.0", + "@typescript-eslint/visitor-keys": "5.52.0" }, "devDependencies": { "@types/glob": "*", - "@typescript-eslint/typescript-estree": "5.51.0", + "@typescript-eslint/typescript-estree": "5.52.0", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index 1c6a2a15d959..f5b1ab9fdb55 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.52.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.51.0...v5.52.0) (2023-02-13) + +**Note:** Version bump only for package @typescript-eslint/type-utils + + + + + # [5.51.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.50.0...v5.51.0) (2023-02-06) **Note:** Version bump only for package @typescript-eslint/type-utils diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index f4354a5342b6..73ec846283b2 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "5.51.0", + "version": "5.52.0", "description": "Type utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -39,13 +39,13 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/typescript-estree": "5.51.0", - "@typescript-eslint/utils": "5.51.0", + "@typescript-eslint/typescript-estree": "5.52.0", + "@typescript-eslint/utils": "5.52.0", "debug": "^4.3.4", "tsutils": "^3.21.0" }, "devDependencies": { - "@typescript-eslint/parser": "5.51.0", + "@typescript-eslint/parser": "5.52.0", "typescript": "*" }, "peerDependencies": { diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 497e08356510..ad1c26611b24 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.52.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.51.0...v5.52.0) (2023-02-13) + + +### Features + +* **typescript-estree:** allow specifying project: true ([#6084](https://github.com/typescript-eslint/typescript-eslint/issues/6084)) ([dcd05f0](https://github.com/typescript-eslint/typescript-eslint/commit/dcd05f0b3ab62779571294d08a4542d66ebb2294)) + + + + + # [5.51.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.50.0...v5.51.0) (2023-02-06) diff --git a/packages/types/package.json b/packages/types/package.json index fd48c6e4466a..8f1903cf4567 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "5.51.0", + "version": "5.52.0", "description": "Types for the TypeScript-ESTree AST spec", "keywords": [ "eslint", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index 8d1eb8e9a854..ebc02b2cac5e 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.52.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.51.0...v5.52.0) (2023-02-13) + + +### Features + +* **typescript-estree:** add `.kind` to `TSModuleDeclaration` ([#6443](https://github.com/typescript-eslint/typescript-eslint/issues/6443)) ([2f948df](https://github.com/typescript-eslint/typescript-eslint/commit/2f948df35b73d916e7fe42b21343568b1617e3f1)) +* **typescript-estree:** allow specifying project: true ([#6084](https://github.com/typescript-eslint/typescript-eslint/issues/6084)) ([dcd05f0](https://github.com/typescript-eslint/typescript-eslint/commit/dcd05f0b3ab62779571294d08a4542d66ebb2294)) + + + + + # [5.51.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.50.0...v5.51.0) (2023-02-06) diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 821688b6e250..80b46a0debfb 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "5.51.0", + "version": "5.52.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -42,8 +42,8 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "5.51.0", - "@typescript-eslint/visitor-keys": "5.51.0", + "@typescript-eslint/types": "5.52.0", + "@typescript-eslint/visitor-keys": "5.52.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index f15c36d7d73f..40fb3390513e 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.52.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.51.0...v5.52.0) (2023-02-13) + +**Note:** Version bump only for package @typescript-eslint/utils + + + + + # [5.51.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.50.0...v5.51.0) (2023-02-06) diff --git a/packages/utils/package.json b/packages/utils/package.json index bc80a009477f..2dbc840eef71 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "5.51.0", + "version": "5.52.0", "description": "Utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -41,9 +41,9 @@ "dependencies": { "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.51.0", - "@typescript-eslint/types": "5.51.0", - "@typescript-eslint/typescript-estree": "5.51.0", + "@typescript-eslint/scope-manager": "5.52.0", + "@typescript-eslint/types": "5.52.0", + "@typescript-eslint/typescript-estree": "5.52.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0", "semver": "^7.3.7" @@ -52,7 +52,7 @@ "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "devDependencies": { - "@typescript-eslint/parser": "5.51.0", + "@typescript-eslint/parser": "5.52.0", "typescript": "*" }, "funding": { diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 3fa63a830424..8b4c72805391 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.52.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.51.0...v5.52.0) (2023-02-13) + +**Note:** Version bump only for package @typescript-eslint/visitor-keys + + + + + # [5.51.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.50.0...v5.51.0) (2023-02-06) **Note:** Version bump only for package @typescript-eslint/visitor-keys diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index b984c406ee51..0973334db8ff 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "5.51.0", + "version": "5.52.0", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "keywords": [ "eslint", @@ -39,7 +39,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "5.51.0", + "@typescript-eslint/types": "5.52.0", "eslint-visitor-keys": "^3.3.0" }, "devDependencies": { diff --git a/packages/website-eslint/CHANGELOG.md b/packages/website-eslint/CHANGELOG.md index 33686f6b038c..b8a34c86b14e 100644 --- a/packages/website-eslint/CHANGELOG.md +++ b/packages/website-eslint/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.52.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.51.0...v5.52.0) (2023-02-13) + +**Note:** Version bump only for package @typescript-eslint/website-eslint + + + + + # [5.51.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.50.0...v5.51.0) (2023-02-06) **Note:** Version bump only for package @typescript-eslint/website-eslint diff --git a/packages/website-eslint/package.json b/packages/website-eslint/package.json index df5766f2ebe3..baceadb1b690 100644 --- a/packages/website-eslint/package.json +++ b/packages/website-eslint/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/website-eslint", - "version": "5.51.0", + "version": "5.52.0", "private": true, "description": "ESLint which works in browsers.", "engines": { @@ -16,19 +16,19 @@ "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore" }, "dependencies": { - "@typescript-eslint/types": "5.51.0", - "@typescript-eslint/utils": "5.51.0" + "@typescript-eslint/types": "5.52.0", + "@typescript-eslint/utils": "5.52.0" }, "devDependencies": { "@rollup/plugin-commonjs": "^23.0.0", "@rollup/plugin-json": "^5.0.0", "@rollup/plugin-node-resolve": "^15.0.0", "@rollup/pluginutils": "^5.0.0", - "@typescript-eslint/eslint-plugin": "5.51.0", - "@typescript-eslint/parser": "5.51.0", - "@typescript-eslint/scope-manager": "5.51.0", - "@typescript-eslint/typescript-estree": "5.51.0", - "@typescript-eslint/visitor-keys": "5.51.0", + "@typescript-eslint/eslint-plugin": "5.52.0", + "@typescript-eslint/parser": "5.52.0", + "@typescript-eslint/scope-manager": "5.52.0", + "@typescript-eslint/typescript-estree": "5.52.0", + "@typescript-eslint/visitor-keys": "5.52.0", "eslint": "*", "rollup": "^2.75.4", "rollup-plugin-terser": "^7.0.2", diff --git a/packages/website/CHANGELOG.md b/packages/website/CHANGELOG.md index 2a28e8cdda0b..43c76bcad0ad 100644 --- a/packages/website/CHANGELOG.md +++ b/packages/website/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [5.52.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.51.0...v5.52.0) (2023-02-13) + + +### Features + +* **typescript-estree:** allow specifying project: true ([#6084](https://github.com/typescript-eslint/typescript-eslint/issues/6084)) ([dcd05f0](https://github.com/typescript-eslint/typescript-eslint/commit/dcd05f0b3ab62779571294d08a4542d66ebb2294)) + + + + + # [5.51.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.50.0...v5.51.0) (2023-02-06) **Note:** Version bump only for package website diff --git a/packages/website/package.json b/packages/website/package.json index 30e2fdf8fba9..c2a71694bcd6 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -1,6 +1,6 @@ { "name": "website", - "version": "5.51.0", + "version": "5.52.0", "private": true, "scripts": { "build": "docusaurus build", @@ -21,8 +21,8 @@ "@docusaurus/remark-plugin-npm2yarn": "~2.2.0", "@docusaurus/theme-common": "~2.2.0", "@mdx-js/react": "1.6.22", - "@typescript-eslint/parser": "5.51.0", - "@typescript-eslint/website-eslint": "5.51.0", + "@typescript-eslint/parser": "5.52.0", + "@typescript-eslint/website-eslint": "5.52.0", "clsx": "^1.1.1", "eslint": "*", "json-schema": "^0.4.0", @@ -48,7 +48,7 @@ "@types/react": "^18.0.9", "@types/react-helmet": "^6.1.5", "@types/react-router-dom": "^5.3.3", - "@typescript-eslint/eslint-plugin": "5.51.0", + "@typescript-eslint/eslint-plugin": "5.52.0", "copy-webpack-plugin": "^11.0.0", "eslint-plugin-jsx-a11y": "^6.5.1", "eslint-plugin-react": "^7.29.4",