From 376997ff7bee65ab996b67f769c54b046f4c4472 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Thu, 1 Apr 2021 15:22:01 -0700 Subject: [PATCH] feat(ast-spec): add fixtures Add fixture tests for each and every AST node. To make things more readable I: - separated the AST from the tokens - this stops the individual snapshot from being so long it's impossible to understand - if there are changes to tokens - then they should be more obvious now. Before you had to expand the snapshot in github to understand that the token was part of the tokens array. - always write error snapshot, and always write AST/token snapshots - This is just for consistency and to make it easier whilst you're developing. - It will prevent us from accidentally leaving behind error snapshots if they weren't supposed to be there. - added a custom snapshot serializer - Having learned how useful they are with scope manager - I created a new one to improve the look of the snapshots. - Instead of sorting alphabetically, I place `type` at the top, and `range`/`loc` at the end. - Instead of outputting `Object` ahead of every node, instead it outputs the node `type`. - I adjusted the output `range`/`loc` so they take up fewer lines and are more compact. I prefixed the snapshot names with numbers just so we can control the sorting of them. No other reason. --- .github/workflows/ci.yml | 7 + .nxignore | 2 + .prettierignore | 1 + .vscode/launch.json | 32 ++ .vscode/settings.json | 5 +- package.json | 7 + packages/ast-spec/jest.config.js | 5 + packages/ast-spec/package.json | 12 + packages/ast-spec/src/base/TSHeritageBase.ts | 1 + .../implements-non-identifier/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixtures/_error_/no-body/fixture.ts | 1 + .../no-body/snapshots/1-TSESTree-Error.shot | 3 + .../no-body/snapshots/2-Babel-Error.shot | 3 + .../no-body/snapshots/3-Alignment-Error.shot | 3 + .../_error_/non-identifier-name/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixtures/abstract/fixture.ts | 1 + .../abstract/snapshots/1-TSESTree-AST.shot | 47 +++ .../abstract/snapshots/2-TSESTree-Tokens.shot | 56 +++ .../abstract/snapshots/3-Babel-AST.shot | 47 +++ .../abstract/snapshots/4-Babel-Tokens.shot | 56 +++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/declare/fixture.ts | 1 + .../declare/snapshots/1-TSESTree-AST.shot | 47 +++ .../declare/snapshots/2-TSESTree-Tokens.shot | 56 +++ .../declare/snapshots/3-Babel-AST.shot | 47 +++ .../declare/snapshots/4-Babel-Tokens.shot | 56 +++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/decoratorMany/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 86 ++++ .../snapshots/2-TSESTree-Tokens.shot | 86 ++++ .../decoratorMany/snapshots/3-Babel-AST.shot | 86 ++++ .../snapshots/4-Babel-Tokens.shot | 86 ++++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/decoratorOne/fixture.ts | 2 + .../snapshots/1-TSESTree-AST.shot | 67 ++++ .../snapshots/2-TSESTree-Tokens.shot | 66 +++ .../decoratorOne/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 + .../fixtures/empty/fixture.ts | 1 + .../empty/snapshots/1-TSESTree-AST.shot | 46 +++ .../empty/snapshots/2-TSESTree-Tokens.shot | 46 +++ .../fixtures/empty/snapshots/3-Babel-AST.shot | 46 +++ .../empty/snapshots/4-Babel-Tokens.shot | 46 +++ .../empty/snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/extends-literal/README.md | 1 + .../fixtures/extends-literal/fixture.ts | 1 + .../snapshots/1-TSESTree-AST.shot | 56 +++ .../snapshots/2-TSESTree-Tokens.shot | 66 +++ .../snapshots/3-Babel-AST.shot | 56 +++ .../snapshots/4-Babel-Tokens.shot | 66 +++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../extends-type-parameters/fixture.ts | 1 + .../snapshots/1-TSESTree-AST.shot | 75 ++++ .../snapshots/2-TSESTree-Tokens.shot | 96 +++++ .../snapshots/3-Babel-AST.shot | 75 ++++ .../snapshots/4-Babel-Tokens.shot | 96 +++++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/extends/fixture.ts | 1 + .../extends/snapshots/1-TSESTree-AST.shot | 55 +++ .../extends/snapshots/2-TSESTree-Tokens.shot | 66 +++ .../extends/snapshots/3-Babel-AST.shot | 55 +++ .../extends/snapshots/4-Babel-Tokens.shot | 66 +++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/implements-many/fixture.ts | 1 + .../snapshots/1-TSESTree-AST.shot | 105 +++++ .../snapshots/2-TSESTree-Tokens.shot | 106 +++++ .../snapshots/3-Babel-AST.shot | 105 +++++ .../snapshots/4-Babel-Tokens.shot | 106 +++++ .../snapshots/5-AST-Alignment-AST.shot | 115 ++++++ .../snapshots/6-AST-Alignment-Tokens.shot | 112 ++++++ .../fixtures/implements-one/fixture.ts | 1 + .../snapshots/1-TSESTree-AST.shot | 67 ++++ .../snapshots/2-TSESTree-Tokens.shot | 66 +++ .../implements-one/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 ++++ .../fixture.ts | 1 + .../snapshots/1-TSESTree-AST.shot | 115 ++++++ .../snapshots/2-TSESTree-Tokens.shot | 126 ++++++ .../snapshots/3-Babel-AST.shot | 106 +++++ .../snapshots/4-Babel-Tokens.shot | 126 ++++++ .../snapshots/5-AST-Alignment-AST.shot | 120 ++++++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/type-parameters/fixture.ts | 1 + .../snapshots/1-TSESTree-AST.shot | 76 ++++ .../snapshots/2-TSESTree-Tokens.shot | 76 ++++ .../snapshots/3-Babel-AST.shot | 67 ++++ .../snapshots/4-Babel-Tokens.shot | 76 ++++ .../snapshots/5-AST-Alignment-AST.shot | 81 ++++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../_error_/named-non-identifier/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixtures/_error_/no-source/fixture.ts | 1 + .../no-source/snapshots/1-TSESTree-Error.shot | 3 + .../no-source/snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../_error_/non-string-source/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixtures/_error_/type-kind/fixture.ts | 1 + .../type-kind/snapshots/1-TSESTree-Error.shot | 3 + .../type-kind/snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixtures/assertion/fixture.ts | 1 + .../assertion/snapshots/1-TSESTree-AST.shot | 70 ++++ .../snapshots/2-TSESTree-Tokens.shot | 116 ++++++ .../assertion/snapshots/3-Babel-AST.shot | 70 ++++ .../assertion/snapshots/4-Babel-Tokens.shot | 116 ++++++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/named/fixture.ts | 1 + .../named/snapshots/1-TSESTree-AST.shot | 48 +++ .../named/snapshots/2-TSESTree-Tokens.shot | 76 ++++ .../fixtures/named/snapshots/3-Babel-AST.shot | 48 +++ .../named/snapshots/4-Babel-Tokens.shot | 76 ++++ .../named/snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/unnamed/fixture.ts | 1 + .../unnamed/snapshots/1-TSESTree-AST.shot | 39 ++ .../unnamed/snapshots/2-TSESTree-Tokens.shot | 56 +++ .../unnamed/snapshots/3-Babel-AST.shot | 39 ++ .../unnamed/snapshots/4-Babel-Tokens.shot | 56 +++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/_error_/enum/fixture.ts | 1 + .../enum/snapshots/1-TSESTree-Error.shot | 3 + .../_error_/enum/snapshots/2-Babel-Error.shot | 3 + .../enum/snapshots/3-Alignment-Error.shot | 3 + .../fixtures/_error_/namespace/fixture.ts | 1 + .../namespace/snapshots/1-TSESTree-Error.shot | 3 + .../namespace/snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixtures/_error_/type-alias/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 3 + .../type-alias/snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../_error_/variable-declaration/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixtures/anonymous-class/fixture.ts | 1 + .../snapshots/1-TSESTree-AST.shot | 47 +++ .../snapshots/2-TSESTree-Tokens.shot | 56 +++ .../snapshots/3-Babel-AST.shot | 47 +++ .../snapshots/4-Babel-Tokens.shot | 56 +++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/anonymous-function/fixture.ts | 1 + .../snapshots/1-TSESTree-AST.shot | 50 +++ .../snapshots/2-TSESTree-Tokens.shot | 76 ++++ .../snapshots/3-Babel-AST.shot | 50 +++ .../snapshots/4-Babel-Tokens.shot | 76 ++++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../arrow-function-expression/fixture.ts | 1 + .../snapshots/1-TSESTree-AST.shot | 50 +++ .../snapshots/2-TSESTree-Tokens.shot | 86 ++++ .../snapshots/3-Babel-AST.shot | 50 +++ .../snapshots/4-Babel-Tokens.shot | 86 ++++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/class-expression/fixture.ts | 1 + .../snapshots/1-TSESTree-AST.shot | 56 +++ .../snapshots/2-TSESTree-Tokens.shot | 96 +++++ .../snapshots/3-Babel-AST.shot | 56 +++ .../snapshots/4-Babel-Tokens.shot | 96 +++++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/class/fixture.ts | 1 + .../class/snapshots/1-TSESTree-AST.shot | 56 +++ .../class/snapshots/2-TSESTree-Tokens.shot | 66 +++ .../fixtures/class/snapshots/3-Babel-AST.shot | 56 +++ .../class/snapshots/4-Babel-Tokens.shot | 66 +++ .../class/snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/function/fixture.ts | 1 + .../function/snapshots/1-TSESTree-AST.shot | 59 +++ .../function/snapshots/2-TSESTree-Tokens.shot | 86 ++++ .../function/snapshots/3-Babel-AST.shot | 59 +++ .../function/snapshots/4-Babel-Tokens.shot | 86 ++++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/identifier/fixture.ts | 1 + .../identifier/snapshots/1-TSESTree-AST.shot | 36 ++ .../snapshots/2-TSESTree-Tokens.shot | 46 +++ .../identifier/snapshots/3-Babel-AST.shot | 36 ++ .../identifier/snapshots/4-Babel-Tokens.shot | 46 +++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/interface/fixture.ts | 1 + .../interface/snapshots/1-TSESTree-AST.shot | 55 +++ .../snapshots/2-TSESTree-Tokens.shot | 66 +++ .../interface/snapshots/3-Babel-AST.shot | 55 +++ .../interface/snapshots/4-Babel-Tokens.shot | 66 +++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 72 ++++ .../fixtures/literal/fixture.ts | 1 + .../literal/snapshots/1-TSESTree-AST.shot | 37 ++ .../literal/snapshots/2-TSESTree-Tokens.shot | 46 +++ .../literal/snapshots/3-Babel-AST.shot | 37 ++ .../literal/snapshots/4-Babel-Tokens.shot | 46 +++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../ExportDefaultDeclaration/spec.ts | 6 +- .../_error_/aliased-literal/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../_error_/anonymous-class/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../anonymous-function-expression/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../_error_/arrow-function/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../_error_/class-expression/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../_error_/identifier-direct/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../_error_/literal-braced/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 6 + .../snapshots/3-Alignment-Error.shot | 3 + .../_error_/literal-direct/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 3 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixtures/aliased/fixture.ts | 1 + .../aliased/snapshots/1-TSESTree-AST.shot | 61 +++ .../aliased/snapshots/2-TSESTree-Tokens.shot | 76 ++++ .../aliased/snapshots/3-Babel-AST.shot | 61 +++ .../aliased/snapshots/4-Babel-Tokens.shot | 76 ++++ .../snapshots/5-AST-Alignment-AST.shot | 66 +++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/assertion/fixture.ts | 1 + .../assertion/snapshots/1-TSESTree-AST.shot | 102 +++++ .../snapshots/2-TSESTree-Tokens.shot | 136 +++++++ .../assertion/snapshots/3-Babel-AST.shot | 102 +++++ .../assertion/snapshots/4-Babel-Tokens.shot | 136 +++++++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/class/fixture.ts | 1 + .../class/snapshots/1-TSESTree-AST.shot | 59 +++ .../class/snapshots/2-TSESTree-Tokens.shot | 56 +++ .../fixtures/class/snapshots/3-Babel-AST.shot | 59 +++ .../class/snapshots/4-Babel-Tokens.shot | 56 +++ .../class/snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/declare-function/fixture.ts | 1 + .../snapshots/1-TSESTree-AST.shot | 71 ++++ .../snapshots/2-TSESTree-Tokens.shot | 96 +++++ .../snapshots/3-Babel-AST.shot | 71 ++++ .../snapshots/4-Babel-Tokens.shot | 96 +++++ .../snapshots/5-AST-Alignment-AST.shot | 76 ++++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/enum/fixture.ts | 1 + .../enum/snapshots/1-TSESTree-AST.shot | 49 +++ .../enum/snapshots/2-TSESTree-Tokens.shot | 56 +++ .../fixtures/enum/snapshots/3-Babel-AST.shot | 49 +++ .../enum/snapshots/4-Babel-Tokens.shot | 56 +++ .../enum/snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 62 +++ .../fixtures/function-declaration/fixture.ts | 1 + .../snapshots/1-TSESTree-AST.shot | 62 +++ .../snapshots/2-TSESTree-Tokens.shot | 76 ++++ .../snapshots/3-Babel-AST.shot | 62 +++ .../snapshots/4-Babel-Tokens.shot | 76 ++++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/identifier-braced/fixture.ts | 1 + .../snapshots/1-TSESTree-AST.shot | 61 +++ .../snapshots/2-TSESTree-Tokens.shot | 56 +++ .../snapshots/3-Babel-AST.shot | 61 +++ .../snapshots/4-Babel-Tokens.shot | 56 +++ .../snapshots/5-AST-Alignment-AST.shot | 66 +++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/identifier-many/fixture.ts | 1 + .../snapshots/1-TSESTree-AST.shot | 91 +++++ .../snapshots/2-TSESTree-Tokens.shot | 76 ++++ .../snapshots/3-Babel-AST.shot | 91 +++++ .../snapshots/4-Babel-Tokens.shot | 76 ++++ .../snapshots/5-AST-Alignment-AST.shot | 96 +++++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/interface/fixture.ts | 1 + .../interface/snapshots/1-TSESTree-AST.shot | 58 +++ .../snapshots/2-TSESTree-Tokens.shot | 56 +++ .../interface/snapshots/3-Babel-AST.shot | 58 +++ .../interface/snapshots/4-Babel-Tokens.shot | 56 +++ .../snapshots/5-AST-Alignment-AST.shot | 63 +++ .../snapshots/6-AST-Alignment-Tokens.shot | 62 +++ .../fixtures/namespace/fixture.ts | 1 + .../namespace/snapshots/1-TSESTree-AST.shot | 58 +++ .../snapshots/2-TSESTree-Tokens.shot | 56 +++ .../namespace/snapshots/3-Babel-AST.shot | 58 +++ .../namespace/snapshots/4-Babel-Tokens.shot | 56 +++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/type-alias/fixture.ts | 1 + .../type-alias/snapshots/1-TSESTree-AST.shot | 68 ++++ .../snapshots/2-TSESTree-Tokens.shot | 66 +++ .../type-alias/snapshots/3-Babel-AST.shot | 68 ++++ .../type-alias/snapshots/4-Babel-Tokens.shot | 66 +++ .../snapshots/5-AST-Alignment-AST.shot | 73 ++++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../fixtures/variable-declaration/fixture.ts | 1 + .../snapshots/1-TSESTree-AST.shot | 71 ++++ .../snapshots/2-TSESTree-Tokens.shot | 66 +++ .../snapshots/3-Babel-AST.shot | 71 ++++ .../snapshots/4-Babel-Tokens.shot | 66 +++ .../snapshots/5-AST-Alignment-AST.shot | 6 + .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../ExportNamedDeclaration/spec.ts | 1 + ....ts => PunctuatorTokenToText.type-test.ts} | 0 ...es.test.ts => ast-node-types.type-test.ts} | 0 .../tests/fixtures-with-differences-ast.shot | 16 + .../fixtures-with-differences-errors.shot | 15 + .../fixtures-with-differences-tokens.shot | 11 + packages/ast-spec/tests/fixtures.test.ts | 249 ++++++++++++ packages/ast-spec/tests/util/parsers/babel.ts | 50 +++ .../tests/util/parsers/parser-types.ts | 33 ++ .../tests/util/parsers/typescript-estree.ts | 33 ++ .../ast-spec/tests/util/serializers/Node.ts | 83 ++++ .../ast-spec/tests/util/serializers/index.ts | 6 + .../ast-spec/tests/util/serializers/string.ts | 38 ++ packages/ast-spec/tests/util/setupJest.ts | 8 + packages/ast-spec/tests/util/snapshot-diff.ts | 67 ++++ .../tests/util/typescript-estree-import.ts | 17 + packages/ast-spec/tsconfig.build.json | 3 +- packages/ast-spec/tsconfig.json | 4 +- .../ast-spec/typings/babel-eslint-parser.d.ts | 24 ++ packages/scope-manager/package.json | 1 + packages/scope-manager/project.json | 10 + packages/scope-manager/tests/fixtures.test.ts | 2 +- packages/types/tools/copy-ast-spec.ts | 37 +- .../visitor-keys/tests/visitor-keys.test.ts | 5 + yarn.lock | 375 ++++++++++++++++-- 364 files changed, 12709 insertions(+), 47 deletions(-) create mode 100644 .nxignore create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/no-body/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/no-body/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/no-body/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/no-body/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/README.md create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/no-source/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/no-source/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/no-source/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/no-source/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/type-kind/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/type-kind/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/type-kind/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/type-kind/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/6-AST-Alignment-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/fixture.ts create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/6-AST-Alignment-Tokens.shot rename packages/ast-spec/tests/{PunctuatorTokenToText.test.ts => PunctuatorTokenToText.type-test.ts} (100%) rename packages/ast-spec/tests/{ast-node-types.test.ts => ast-node-types.type-test.ts} (100%) create mode 100644 packages/ast-spec/tests/fixtures-with-differences-ast.shot create mode 100644 packages/ast-spec/tests/fixtures-with-differences-errors.shot create mode 100644 packages/ast-spec/tests/fixtures-with-differences-tokens.shot create mode 100644 packages/ast-spec/tests/fixtures.test.ts create mode 100644 packages/ast-spec/tests/util/parsers/babel.ts create mode 100644 packages/ast-spec/tests/util/parsers/parser-types.ts create mode 100644 packages/ast-spec/tests/util/parsers/typescript-estree.ts create mode 100644 packages/ast-spec/tests/util/serializers/Node.ts create mode 100644 packages/ast-spec/tests/util/serializers/index.ts create mode 100644 packages/ast-spec/tests/util/serializers/string.ts create mode 100644 packages/ast-spec/tests/util/setupJest.ts create mode 100644 packages/ast-spec/tests/util/snapshot-diff.ts create mode 100644 packages/ast-spec/tests/util/typescript-estree-import.ts create mode 100644 packages/ast-spec/typings/babel-eslint-parser.d.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 116e43fdd53..a3534dd85c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,6 +96,12 @@ jobs: # Website will be built by the Netlify GitHub App yarn build --exclude website + - name: Run unit tests for ast-spec + run: yarn test + working-directory: packages/ast-spec + env: + CI: true + - name: Run unit tests for typescript-estree run: npx nx test @typescript-eslint/typescript-estree env: @@ -308,6 +314,7 @@ jobs: env: CI: true + # ast-spec is internal only - so don't care about compat on other versions # eslint-plugin-internal is internal only - so don't care about compat on other versions website_tests: diff --git a/.nxignore b/.nxignore new file mode 100644 index 00000000000..8f084f13c12 --- /dev/null +++ b/.nxignore @@ -0,0 +1,2 @@ +# See the notes in the file for why this is needed +packages/ast-spec/tests/util/typescript-estree-import.ts diff --git a/.prettierignore b/.prettierignore index 93e27c9f84d..896d5c464a3 100644 --- a/.prettierignore +++ b/.prettierignore @@ -12,6 +12,7 @@ packages/eslint-plugin-tslint/tests/test-tslint-rules-directory/alwaysFailRule.j packages/eslint-plugin/src/configs/*.json .all-contributorsrc CONTRIBUTORS.md +packages/ast-spec/src/*/*/fixtures/_error_/*/fixture.ts # Ignore CHANGELOG.md files to avoid issues with automated release job CHANGELOG.md diff --git a/.vscode/launch.json b/.vscode/launch.json index d61dbf50a74..aee0ff73ab0 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -242,5 +242,37 @@ "${workspaceFolder}/packages/scope-manager/dist/index.js", ], }, + { + "type": "node", + "request": "launch", + "name": "Run currently opened ast-spec test", + "cwd": "${workspaceFolder}/packages/ast-spec/", + "program": "${workspaceFolder}/node_modules/jest/bin/jest.js", + "args": [ + "--runInBand", + "--no-cache", + "--no-coverage", + "${fileBasename}" + ], + "sourceMaps": true, + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen", + "skipFiles": [ + "${workspaceFolder}/packages/experimental-utils/src/index.ts", + "${workspaceFolder}/packages/experimental-utils/dist/index.js", + "${workspaceFolder}/packages/experimental-utils/src/ts-estree.ts", + "${workspaceFolder}/packages/experimental-utils/dist/ts-estree.js", + "${workspaceFolder}/packages/parser/src/index.ts", + "${workspaceFolder}/packages/parser/dist/index.js", + "${workspaceFolder}/packages/typescript-estree/src/index.ts", + "${workspaceFolder}/packages/typescript-estree/dist/index.js", + "${workspaceFolder}/packages/types/src/index.ts", + "${workspaceFolder}/packages/types/dist/index.js", + "${workspaceFolder}/packages/visitor-keys/src/index.ts", + "${workspaceFolder}/packages/visitor-keys/dist/index.js", + "${workspaceFolder}/packages/scope-manager/dist/index.js", + "${workspaceFolder}/packages/scope-manager/dist/index.js", + ], + }, ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index f0677068d03..c33f13702f8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -27,10 +27,7 @@ { "icon": "jest_snapshot", "extensions": [ - ".ts.shot", - ".tsx.shot", - ".js.shot", - ".jsx.shot", + ".shot", ], "extends": "jest_snapshot" }, diff --git a/package.json b/package.json index d889f08dffa..a57385f883d 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,10 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "devDependencies": { + "@babel/code-frame": "^7.14.5", + "@babel/eslint-parser": "^7.15.4", + "@babel/parser": "^7.15.7", + "@babel/types": "^7.15.6", "@commitlint/cli": "^16.0.1", "@commitlint/config-conventional": "^16.0.0", "@nrwl/cli": "13.8.5", @@ -63,6 +67,7 @@ "@nrwl/workspace": "13.8.5", "@swc/core": "^1.2.159", "@swc/jest": "^0.2.20", + "@types/babel__code-frame": "^7.0.3", "@types/debug": "^4.1.7", "@types/eslint-visitor-keys": "^1.0.0", "@types/glob": "^7.2.0", @@ -93,6 +98,8 @@ "glob": "^8.0.1", "husky": "^7.0.4", "jest": "^27.3.1", + "jest-diff": "^27.3.1", + "jest-snapshot": "^27.3.1", "jest-specific-snapshot": "^5.0.0", "lerna": "^4.0.0", "lint-staged": "^12.0.2", diff --git a/packages/ast-spec/jest.config.js b/packages/ast-spec/jest.config.js index 77fe4d022a9..ac3b63608b7 100644 --- a/packages/ast-spec/jest.config.js +++ b/packages/ast-spec/jest.config.js @@ -5,4 +5,9 @@ module.exports = { ...require('../../jest.config.base.js'), testRegex: ['./tests/.+\\.test\\.ts$'], + collectCoverage: false, + collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'], + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], + coverageReporters: ['text-summary', 'lcov'], + setupFilesAfterEnv: ['./tests/util/setupJest.ts'], }; diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index c07b779e4dc..caacd9859ff 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -32,8 +32,10 @@ "build": "tsc -b tsconfig.build.json && api-extractor run --local", "clean": "tsc -b tsconfig.build.json --clean", "postclean": "rimraf dist && rimraf _ts3.4 && rimraf .rollup.cache && rimraf coverage", + "clean-fixtures": "rimraf -g \"./src/**/fixtures/**/snapshots\"", "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'", + "test": "jest", "typecheck": "tsc -p tsconfig.json --noEmit" }, "funding": { @@ -41,7 +43,17 @@ "url": "https://opencollective.com/typescript-eslint" }, "devDependencies": { + "@babel/core": "*", + "@babel/eslint-parser": "*", + "@babel/parser": "*", "@microsoft/api-extractor": "^7.18.16", + "@types/babel__core": "*", + "glob": "*", + "jest-diff": "*", + "jest-snapshot": "*", + "jest-specific-snapshot": "*", + "make-dir": "*", + "pretty-format": "*", "typescript": "*" } } diff --git a/packages/ast-spec/src/base/TSHeritageBase.ts b/packages/ast-spec/src/base/TSHeritageBase.ts index b3ed1770b67..5c20542e4f9 100644 --- a/packages/ast-spec/src/base/TSHeritageBase.ts +++ b/packages/ast-spec/src/base/TSHeritageBase.ts @@ -3,6 +3,7 @@ import type { Expression } from '../unions/Expression'; import type { BaseNode } from './BaseNode'; export interface TSHeritageBase extends BaseNode { + // TODO(error handling) - this should be restricted to MemberExpression | Identifier expression: Expression; typeParameters?: TSTypeParameterInstantiation; } diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/fixture.ts new file mode 100644 index 00000000000..d9bb750ada2 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/fixture.ts @@ -0,0 +1 @@ +class Foo implements 'thing' {} diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..d4b25d3584b --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration _error_ implements-non-identifier TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..32918ff7c5f --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration _error_ implements-non-identifier Babel - Error 1`] = `[SyntaxError: Unexpected token (1:21)]`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..123225a1825 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration _error_ implements-non-identifier Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/no-body/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/no-body/fixture.ts new file mode 100644 index 00000000000..12cf01a79ca --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/no-body/fixture.ts @@ -0,0 +1 @@ +class Foo; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/no-body/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/no-body/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..30525843580 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/no-body/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration _error_ no-body TSESTree - Error 1`] = `[TSError: '{' expected.]`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/no-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/no-body/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..e72c371e842 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/no-body/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration _error_ no-body Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:9)]`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/no-body/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/no-body/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..b6946023222 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/no-body/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration _error_ no-body Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/fixture.ts new file mode 100644 index 00000000000..140ca7e5d56 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/fixture.ts @@ -0,0 +1 @@ +class 'Foo' {} diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..7b137a8c5de --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration _error_ non-identifier-name TSESTree - Error 1`] = `[TSError: '{' expected.]`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..e3a40451c7e --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration _error_ non-identifier-name Babel - Error 1`] = `[SyntaxError: A class name is required. (1:6)]`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..098ed5e7a14 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration _error_ non-identifier-name Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/fixture.ts new file mode 100644 index 00000000000..57d09b35b4c --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/fixture.ts @@ -0,0 +1 @@ +abstract class Foo {} diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..bae3f5a8287 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,47 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration abstract TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [19, 21], + loc: { + start: { column: 19, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + superClass: null, + + range: [0, 21], + loc: { + start: { column: 0, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 22], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..0cda2312006 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration abstract TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "abstract", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..d8e3d045b84 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/3-Babel-AST.shot @@ -0,0 +1,47 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration abstract Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [19, 21], + loc: { + start: { column: 19, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + superClass: null, + + range: [0, 21], + loc: { + start: { column: 0, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 22], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..ac5930044d1 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration abstract Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "abstract", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..54a7219ce9a --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration abstract AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..248c67fcb6a --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/abstract/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration abstract AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/fixture.ts new file mode 100644 index 00000000000..a12e8045e83 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/fixture.ts @@ -0,0 +1 @@ +declare class Foo {} diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..d20ffd3e130 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,47 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration declare TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [18, 20], + loc: { + start: { column: 18, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + declare: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + superClass: null, + + range: [0, 20], + loc: { + start: { column: 0, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 21], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..4006c278dcb --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration declare TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [0, 7], + loc: { + start: { column: 0, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [8, 13], + loc: { + start: { column: 8, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..27ac3a41954 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/3-Babel-AST.shot @@ -0,0 +1,47 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration declare Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [18, 20], + loc: { + start: { column: 18, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + declare: true, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + superClass: null, + + range: [0, 20], + loc: { + start: { column: 0, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 21], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..0fbe7f7fe38 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration declare Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [0, 7], + loc: { + start: { column: 0, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [8, 13], + loc: { + start: { column: 8, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..9fbaa86d5a2 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration declare AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..1bb1eef41ab --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration declare AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/fixture.ts new file mode 100644 index 00000000000..259743a73f7 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/fixture.ts @@ -0,0 +1,3 @@ +@decoratorOne +@decoratorTwo +class Foo {} diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..ab7726fcd52 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration decoratorMany TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [38, 40], + loc: { + start: { column: 10, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "decoratorOne", + + range: [1, 13], + loc: { + start: { column: 1, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + + range: [0, 13], + loc: { + start: { column: 0, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "decoratorTwo", + + range: [15, 27], + loc: { + start: { column: 1, line: 2 }, + end: { column: 13, line: 2 }, + }, + }, + + range: [14, 27], + loc: { + start: { column: 0, line: 2 }, + end: { column: 13, line: 2 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [34, 37], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [0, 40], + loc: { + start: { column: 0, line: 1 }, + end: { column: 12, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 41], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..f406c812335 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration decoratorMany TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "@", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "decoratorOne", + + range: [1, 13], + loc: { + start: { column: 1, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [14, 15], + loc: { + start: { column: 0, line: 2 }, + end: { column: 1, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "decoratorTwo", + + range: [15, 27], + loc: { + start: { column: 1, line: 2 }, + end: { column: 13, line: 2 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [28, 33], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [34, 37], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [38, 39], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [39, 40], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..60af58e326d --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/3-Babel-AST.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration decoratorMany Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [38, 40], + loc: { + start: { column: 10, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "decoratorOne", + + range: [1, 13], + loc: { + start: { column: 1, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + + range: [0, 13], + loc: { + start: { column: 0, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "decoratorTwo", + + range: [15, 27], + loc: { + start: { column: 1, line: 2 }, + end: { column: 13, line: 2 }, + }, + }, + + range: [14, 27], + loc: { + start: { column: 0, line: 2 }, + end: { column: 13, line: 2 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [34, 37], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + superClass: null, + + range: [0, 40], + loc: { + start: { column: 0, line: 1 }, + end: { column: 12, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 41], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..888d2f213d3 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration decoratorMany Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "@", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "decoratorOne", + + range: [1, 13], + loc: { + start: { column: 1, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "@", + + range: [14, 15], + loc: { + start: { column: 0, line: 2 }, + end: { column: 1, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "decoratorTwo", + + range: [15, 27], + loc: { + start: { column: 1, line: 2 }, + end: { column: 13, line: 2 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [28, 33], + loc: { + start: { column: 0, line: 3 }, + end: { column: 5, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [34, 37], + loc: { + start: { column: 6, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [38, 39], + loc: { + start: { column: 10, line: 3 }, + end: { column: 11, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [39, 40], + loc: { + start: { column: 11, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..97881c1404c --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration decoratorMany AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..e57e9fa7313 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorMany/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration decoratorMany AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/fixture.ts new file mode 100644 index 00000000000..3db0178e0a4 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/fixture.ts @@ -0,0 +1,2 @@ +@decorator +class Foo {} diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..f0550dcabbe --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,67 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration decoratorOne TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [21, 23], + loc: { + start: { column: 10, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "decorator", + + range: [1, 10], + loc: { + start: { column: 1, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [0, 10], + loc: { + start: { column: 0, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [17, 20], + loc: { + start: { column: 6, line: 2 }, + end: { column: 9, line: 2 }, + }, + }, + superClass: null, + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 12, line: 2 }, + }, + }, + ], + sourceType: "script", + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 3 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..7354a4e9bfe --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration decoratorOne TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "@", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "decorator", + + range: [1, 10], + loc: { + start: { column: 1, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [11, 16], + loc: { + start: { column: 0, line: 2 }, + end: { column: 5, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [17, 20], + loc: { + start: { column: 6, line: 2 }, + end: { column: 9, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [21, 22], + loc: { + start: { column: 10, line: 2 }, + end: { column: 11, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [22, 23], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..f2e4581ba58 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/3-Babel-AST.shot @@ -0,0 +1,67 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration decoratorOne Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [21, 23], + loc: { + start: { column: 10, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + decorators: Array [ + Decorator { + type: "Decorator", + expression: Identifier { + type: "Identifier", + name: "decorator", + + range: [1, 10], + loc: { + start: { column: 1, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [0, 10], + loc: { + start: { column: 0, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + ], + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [17, 20], + loc: { + start: { column: 6, line: 2 }, + end: { column: 9, line: 2 }, + }, + }, + superClass: null, + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 12, line: 2 }, + }, + }, + ], + sourceType: "script", + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 3 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..eb1816cba73 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration decoratorOne Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "@", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "decorator", + + range: [1, 10], + loc: { + start: { column: 1, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [11, 16], + loc: { + start: { column: 0, line: 2 }, + end: { column: 5, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [17, 20], + loc: { + start: { column: 6, line: 2 }, + end: { column: 9, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [21, 22], + loc: { + start: { column: 10, line: 2 }, + end: { column: 11, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [22, 23], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..19b8f62ee26 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration decoratorOne AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..915fd1d51f9 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decoratorOne/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration decoratorOne AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/fixture.ts new file mode 100644 index 00000000000..4e6a6de6531 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/fixture.ts @@ -0,0 +1 @@ +class Foo {} diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..9ead7d30ab7 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration empty TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [10, 12], + loc: { + start: { column: 10, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 12], + loc: { + start: { column: 0, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 13], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..98e26f81f22 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration empty TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..b44e7f980bf --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/3-Babel-AST.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration empty Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [10, 12], + loc: { + start: { column: 10, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 12], + loc: { + start: { column: 0, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 13], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..7687be9ddb0 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration empty Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..795e34e032c --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration empty AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..bf9e1cf5e60 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration empty AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/README.md b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/README.md new file mode 100644 index 00000000000..2e811c1316f --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/README.md @@ -0,0 +1 @@ +This is dumb code - but it's 100% syntactically valid and adheres to the ESTree spec. diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/fixture.ts new file mode 100644 index 00000000000..7bb36dc0067 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/fixture.ts @@ -0,0 +1 @@ +class Foo extends 'Thing' {} diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..dc5437192e6 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration extends-literal TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [26, 28], + loc: { + start: { column: 26, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: Literal { + type: "Literal", + raw: "'Thing'", + value: "Thing", + + range: [18, 25], + loc: { + start: { column: 18, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..578f3c6a864 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration extends-literal TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [10, 17], + loc: { + start: { column: 10, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + String { + type: "String", + value: "'Thing'", + + range: [18, 25], + loc: { + start: { column: 18, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..0a84daeb896 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/3-Babel-AST.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration extends-literal Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [26, 28], + loc: { + start: { column: 26, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: Literal { + type: "Literal", + raw: "'Thing'", + value: "Thing", + + range: [18, 25], + loc: { + start: { column: 18, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..ec6443288fb --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration extends-literal Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [10, 17], + loc: { + start: { column: 10, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + String { + type: "String", + value: "'Thing'", + + range: [18, 25], + loc: { + start: { column: 18, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..432a1483eb4 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration extends-literal AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..5c213302190 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration extends-literal AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/fixture.ts new file mode 100644 index 00000000000..5d0bc8ed7c7 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/fixture.ts @@ -0,0 +1 @@ +class Foo extends Set {} diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..da9fc3ba5ca --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,75 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration extends-type-parameters TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [30, 32], + loc: { + start: { column: 30, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "Set", + + range: [18, 21], + loc: { + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + superTypeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [22, 28], + loc: { + start: { column: 22, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + ], + + range: [21, 29], + loc: { + start: { column: 21, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..3eb2b515a24 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration extends-type-parameters TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [10, 17], + loc: { + start: { column: 10, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Set", + + range: [18, 21], + loc: { + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [22, 28], + loc: { + start: { column: 22, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [31, 32], + loc: { + start: { column: 31, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..8f9634b6629 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/3-Babel-AST.shot @@ -0,0 +1,75 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration extends-type-parameters Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [30, 32], + loc: { + start: { column: 30, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "Set", + + range: [18, 21], + loc: { + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + superTypeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSStringKeyword { + type: "TSStringKeyword", + + range: [22, 28], + loc: { + start: { column: 22, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + ], + + range: [21, 29], + loc: { + start: { column: 21, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..db93259e13a --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration extends-type-parameters Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [10, 17], + loc: { + start: { column: 10, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Set", + + range: [18, 21], + loc: { + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [22, 28], + loc: { + start: { column: 22, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [31, 32], + loc: { + start: { column: 31, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..17f60ddc36a --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration extends-type-parameters AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..8c6277e35df --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-parameters/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration extends-type-parameters AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/fixture.ts new file mode 100644 index 00000000000..1f5fd8cad4e --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/fixture.ts @@ -0,0 +1 @@ +class Foo extends Object {} diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..d8241f2f4d5 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,55 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration extends TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [25, 27], + loc: { + start: { column: 25, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "Object", + + range: [18, 24], + loc: { + start: { column: 18, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..1a912d35116 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration extends TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [10, 17], + loc: { + start: { column: 10, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Object", + + range: [18, 24], + loc: { + start: { column: 18, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..337d09683e9 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/3-Babel-AST.shot @@ -0,0 +1,55 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration extends Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [25, 27], + loc: { + start: { column: 25, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "Object", + + range: [18, 24], + loc: { + start: { column: 18, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..2f17f69fe6b --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration extends Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [10, 17], + loc: { + start: { column: 10, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Object", + + range: [18, 24], + loc: { + start: { column: 18, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..7408520a611 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration extends AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..ff9ee33e186 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration extends AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/fixture.ts new file mode 100644 index 00000000000..c0cae9a1115 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/fixture.ts @@ -0,0 +1 @@ +class Foo implements Object, Function, RegExp {} diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..6467e4a37f0 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,105 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration implements-many TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [46, 48], + loc: { + start: { column: 46, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: Array [ + TSClassImplements { + type: "TSClassImplements", + expression: Identifier { + type: "Identifier", + name: "Object", + + range: [21, 27], + loc: { + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + + range: [21, 27], + loc: { + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + TSClassImplements { + type: "TSClassImplements", + expression: Identifier { + type: "Identifier", + name: "Function", + + range: [29, 37], + loc: { + start: { column: 29, line: 1 }, + end: { column: 37, line: 1 }, + }, + }, + + range: [29, 37], + loc: { + start: { column: 29, line: 1 }, + end: { column: 37, line: 1 }, + }, + }, + TSClassImplements { + type: "TSClassImplements", + expression: Identifier { + type: "Identifier", + name: "RegExp", + + range: [39, 45], + loc: { + start: { column: 39, line: 1 }, + end: { column: 45, line: 1 }, + }, + }, + + range: [39, 45], + loc: { + start: { column: 39, line: 1 }, + end: { column: 45, line: 1 }, + }, + }, + ], + superClass: null, + + range: [0, 48], + loc: { + start: { column: 0, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 49], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..ffe359159d4 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration implements-many TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "implements", + + range: [10, 20], + loc: { + start: { column: 10, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Object", + + range: [21, 27], + loc: { + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Function", + + range: [29, 37], + loc: { + start: { column: 29, line: 1 }, + end: { column: 37, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [37, 38], + loc: { + start: { column: 37, line: 1 }, + end: { column: 38, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "RegExp", + + range: [39, 45], + loc: { + start: { column: 39, line: 1 }, + end: { column: 45, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [46, 47], + loc: { + start: { column: 46, line: 1 }, + end: { column: 47, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [47, 48], + loc: { + start: { column: 47, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..c5a75e6d5b1 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/3-Babel-AST.shot @@ -0,0 +1,105 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration implements-many Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [46, 48], + loc: { + start: { column: 46, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: Array [ + TSExpressionWithTypeArguments { + type: "TSExpressionWithTypeArguments", + expression: Identifier { + type: "Identifier", + name: "Object", + + range: [21, 27], + loc: { + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + + range: [21, 27], + loc: { + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + TSExpressionWithTypeArguments { + type: "TSExpressionWithTypeArguments", + expression: Identifier { + type: "Identifier", + name: "Function", + + range: [29, 37], + loc: { + start: { column: 29, line: 1 }, + end: { column: 37, line: 1 }, + }, + }, + + range: [29, 37], + loc: { + start: { column: 29, line: 1 }, + end: { column: 37, line: 1 }, + }, + }, + TSExpressionWithTypeArguments { + type: "TSExpressionWithTypeArguments", + expression: Identifier { + type: "Identifier", + name: "RegExp", + + range: [39, 45], + loc: { + start: { column: 39, line: 1 }, + end: { column: 45, line: 1 }, + }, + }, + + range: [39, 45], + loc: { + start: { column: 39, line: 1 }, + end: { column: 45, line: 1 }, + }, + }, + ], + superClass: null, + + range: [0, 48], + loc: { + start: { column: 0, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 49], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..ca4cb279c00 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration implements-many Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "implements", + + range: [10, 20], + loc: { + start: { column: 10, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Object", + + range: [21, 27], + loc: { + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Function", + + range: [29, 37], + loc: { + start: { column: 29, line: 1 }, + end: { column: 37, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [37, 38], + loc: { + start: { column: 37, line: 1 }, + end: { column: 38, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "RegExp", + + range: [39, 45], + loc: { + start: { column: 39, line: 1 }, + end: { column: 45, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [46, 47], + loc: { + start: { column: 46, line: 1 }, + end: { column: 47, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [47, 48], + loc: { + start: { column: 47, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..77b0476655c --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,115 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration implements-many AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [46, 48], + loc: { + start: { column: 46, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: Array [ +- TSClassImplements { +- type: 'TSClassImplements', ++ TSExpressionWithTypeArguments { ++ type: 'TSExpressionWithTypeArguments', + expression: Identifier { + type: 'Identifier', + name: 'Object', + + range: [21, 27], + loc: { + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + + range: [21, 27], + loc: { + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, +- TSClassImplements { +- type: 'TSClassImplements', ++ TSExpressionWithTypeArguments { ++ type: 'TSExpressionWithTypeArguments', + expression: Identifier { + type: 'Identifier', + name: 'Function', + + range: [29, 37], + loc: { + start: { column: 29, line: 1 }, + end: { column: 37, line: 1 }, + }, + }, + + range: [29, 37], + loc: { + start: { column: 29, line: 1 }, + end: { column: 37, line: 1 }, + }, + }, +- TSClassImplements { +- type: 'TSClassImplements', ++ TSExpressionWithTypeArguments { ++ type: 'TSExpressionWithTypeArguments', + expression: Identifier { + type: 'Identifier', + name: 'RegExp', + + range: [39, 45], + loc: { + start: { column: 39, line: 1 }, + end: { column: 45, line: 1 }, + }, + }, + + range: [39, 45], + loc: { + start: { column: 39, line: 1 }, + end: { column: 45, line: 1 }, + }, + }, + ], + superClass: null, + + range: [0, 48], + loc: { + start: { column: 0, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 49], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..931998b9e18 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,112 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration implements-many AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'implements', + + range: [10, 20], + loc: { + start: { column: 10, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Object', + + range: [21, 27], + loc: { + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Function', + + range: [29, 37], + loc: { + start: { column: 29, line: 1 }, + end: { column: 37, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [37, 38], + loc: { + start: { column: 37, line: 1 }, + end: { column: 38, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'RegExp', + + range: [39, 45], + loc: { + start: { column: 39, line: 1 }, + end: { column: 45, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [46, 47], + loc: { + start: { column: 46, line: 1 }, + end: { column: 47, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [47, 48], + loc: { + start: { column: 47, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/fixture.ts new file mode 100644 index 00000000000..2e21f7b7833 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/fixture.ts @@ -0,0 +1 @@ +class Foo implements Object {} diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..c5228690b09 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,67 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration implements-one TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [28, 30], + loc: { + start: { column: 28, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: Array [ + TSClassImplements { + type: "TSClassImplements", + expression: Identifier { + type: "Identifier", + name: "Object", + + range: [21, 27], + loc: { + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + + range: [21, 27], + loc: { + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + ], + superClass: null, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..160a01b3a57 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration implements-one TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "implements", + + range: [10, 20], + loc: { + start: { column: 10, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Object", + + range: [21, 27], + loc: { + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..de05a724a09 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/3-Babel-AST.shot @@ -0,0 +1,67 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration implements-one Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [28, 30], + loc: { + start: { column: 28, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: Array [ + TSExpressionWithTypeArguments { + type: "TSExpressionWithTypeArguments", + expression: Identifier { + type: "Identifier", + name: "Object", + + range: [21, 27], + loc: { + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + + range: [21, 27], + loc: { + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + ], + superClass: null, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..07fe25e0f65 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration implements-one Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "implements", + + range: [10, 20], + loc: { + start: { column: 10, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Object", + + range: [21, 27], + loc: { + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..b0aec089f61 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,73 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration implements-one AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [28, 30], + loc: { + start: { column: 28, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + implements: Array [ +- TSClassImplements { +- type: 'TSClassImplements', ++ TSExpressionWithTypeArguments { ++ type: 'TSExpressionWithTypeArguments', + expression: Identifier { + type: 'Identifier', + name: 'Object', + + range: [21, 27], + loc: { + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + + range: [21, 27], + loc: { + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + ], + superClass: null, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..0d56c0d096e --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-one/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,72 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration implements-one AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'implements', + + range: [10, 20], + loc: { + start: { column: 10, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Object', + + range: [21, 27], + loc: { + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/fixture.ts new file mode 100644 index 00000000000..9a3d334adee --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/fixture.ts @@ -0,0 +1 @@ +class Foo extends Set {} diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..7fa28228017 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,115 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration type-parameters-extends-type-parameters TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [28, 30], + loc: { + start: { column: 28, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "Set", + + range: [21, 24], + loc: { + start: { column: 21, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + superTypeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ], + + range: [24, 27], + loc: { + start: { column: 24, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: Identifier { + type: "Identifier", + name: "T", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + ], + + range: [9, 12], + loc: { + start: { column: 9, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..f73a167dba3 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration type-parameters-extends-type-parameters TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [13, 20], + loc: { + start: { column: 13, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Set", + + range: [21, 24], + loc: { + start: { column: 21, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..7c5a5149bbe --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/3-Babel-AST.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration type-parameters-extends-type-parameters Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [28, 30], + loc: { + start: { column: 28, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "Set", + + range: [21, 24], + loc: { + start: { column: 21, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + superTypeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: Array [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "T", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ], + + range: [24, 27], + loc: { + start: { column: 24, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + ], + + range: [9, 12], + loc: { + start: { column: 9, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..17ca652dc4a --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration type-parameters-extends-type-parameters Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [13, 20], + loc: { + start: { column: 13, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Set", + + range: [21, 24], + loc: { + start: { column: 21, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..70cae74b300 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,120 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration type-parameters-extends-type-parameters AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [28, 30], + loc: { + start: { column: 28, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: Identifier { + type: 'Identifier', + name: 'Set', + + range: [21, 24], + loc: { + start: { column: 21, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + superTypeParameters: TSTypeParameterInstantiation { + type: 'TSTypeParameterInstantiation', + params: Array [ + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'T', + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ], + + range: [24, 27], + loc: { + start: { column: 24, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [10, 11], +- loc: { +- start: { column: 10, line: 1 }, +- end: { column: 11, line: 1 }, +- }, +- }, ++ name: 'T', + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + ], + + range: [9, 12], + loc: { + start: { column: 9, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..4e5329e739f --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration type-parameters-extends-type-parameters AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/fixture.ts new file mode 100644 index 00000000000..9f84d173bfa --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/fixture.ts @@ -0,0 +1 @@ +class Foo {} diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..0b476f5584e --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration type-parameters TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [13, 15], + loc: { + start: { column: 13, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: Identifier { + type: "Identifier", + name: "T", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + ], + + range: [9, 12], + loc: { + start: { column: 9, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + + 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/ClassDeclaration/fixtures/type-parameters/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..7afa2b8839b --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration type-parameters TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [13, 14], + loc: { + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..de9ab22cc6b --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/snapshots/3-Babel-AST.shot @@ -0,0 +1,67 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration type-parameters Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [13, 15], + loc: { + start: { column: 13, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + ], + + range: [9, 12], + loc: { + start: { column: 9, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + + 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/ClassDeclaration/fixtures/type-parameters/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..89bca663a6d --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration type-parameters Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [13, 14], + loc: { + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..f3b75ecbb25 --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,81 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration type-parameters AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [13, 15], + loc: { + start: { column: 13, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [10, 11], +- loc: { +- start: { column: 10, line: 1 }, +- end: { column: 11, line: 1 }, +- }, +- }, ++ name: 'T', + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + ], + + range: [9, 12], + loc: { + start: { column: 9, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + + 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/ClassDeclaration/fixtures/type-parameters/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..a99d685df3d --- /dev/null +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ClassDeclaration type-parameters AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/fixture.ts b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/fixture.ts new file mode 100644 index 00000000000..8bab23b3599 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/fixture.ts @@ -0,0 +1 @@ +export * as 'foo' from 'module'; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..5f6d97e5f2b --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration _error_ named-non-identifier TSESTree - Error 1`] = `[TSError: Identifier expected.]`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..04ccfb73d5b --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration _error_ named-non-identifier Babel - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..3e05e98bfaf --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration _error_ named-non-identifier Error Alignment 1`] = `"TSESTree errored but Babel didn't"`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/no-source/fixture.ts b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/no-source/fixture.ts new file mode 100644 index 00000000000..b5299226ad4 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/no-source/fixture.ts @@ -0,0 +1 @@ +export * from; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/no-source/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/no-source/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..acdaf4c735f --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/no-source/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration _error_ no-source TSESTree - Error 1`] = `[TSError: Expression expected.]`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/no-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/no-source/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..8bd09ace8dc --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/no-source/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration _error_ no-source Babel - Error 1`] = `[SyntaxError: Unexpected token (1:13)]`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/no-source/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/no-source/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..c2ac962baac --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/no-source/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration _error_ no-source Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/fixture.ts b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/fixture.ts new file mode 100644 index 00000000000..d78b6918cb1 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/fixture.ts @@ -0,0 +1 @@ +export * from module; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..bcf5b40695c --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration _error_ non-string-source TSESTree - Error 1`] = `[TSError: Module specifier must be a string literal.]`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..a3d08a7b52a --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration _error_ non-string-source Babel - Error 1`] = `[SyntaxError: Unexpected token (1:14)]`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..3a1a419a831 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration _error_ non-string-source Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/type-kind/fixture.ts b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/type-kind/fixture.ts new file mode 100644 index 00000000000..35e627e28c5 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/type-kind/fixture.ts @@ -0,0 +1 @@ +export type * from 'a'; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/type-kind/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/type-kind/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..a9b2c20c7fa --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/type-kind/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration _error_ type-kind TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/type-kind/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/type-kind/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..e448d4b4299 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/type-kind/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration _error_ type-kind Babel - Error 1`] = `[SyntaxError: Unexpected token (1:12)]`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/type-kind/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/type-kind/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..e9c5efb6898 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/type-kind/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration _error_ type-kind Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/fixture.ts b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/fixture.ts new file mode 100644 index 00000000000..32858cf7203 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/fixture.ts @@ -0,0 +1 @@ +export * from 'mod' assert { type: 'json' }; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..28172433eac --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,70 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration assertion TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportAllDeclaration { + type: "ExportAllDeclaration", + assertions: Array [ + ImportAttribute { + type: "ImportAttribute", + key: Identifier { + type: "Identifier", + name: "type", + + range: [29, 33], + loc: { + start: { column: 29, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + value: Literal { + type: "Literal", + raw: "'json'", + value: "json", + + range: [35, 41], + loc: { + start: { column: 35, line: 1 }, + end: { column: 41, line: 1 }, + }, + }, + + range: [29, 41], + loc: { + start: { column: 29, line: 1 }, + end: { column: 41, line: 1 }, + }, + }, + ], + exported: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [14, 19], + loc: { + start: { column: 14, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [0, 44], + loc: { + start: { column: 0, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 45], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..c1e14a803e2 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration assertion TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "*", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [9, 13], + loc: { + start: { column: 9, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [14, 19], + loc: { + start: { column: 14, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "assert", + + range: [20, 26], + loc: { + start: { column: 20, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [29, 33], + loc: { + start: { column: 29, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [33, 34], + loc: { + start: { column: 33, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + String { + type: "String", + value: "'json'", + + range: [35, 41], + loc: { + start: { column: 35, line: 1 }, + end: { column: 41, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [42, 43], + loc: { + start: { column: 42, line: 1 }, + end: { column: 43, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [43, 44], + loc: { + start: { column: 43, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..5a36d4040e4 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/3-Babel-AST.shot @@ -0,0 +1,70 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration assertion Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportAllDeclaration { + type: "ExportAllDeclaration", + assertions: Array [ + ImportAttribute { + type: "ImportAttribute", + key: Identifier { + type: "Identifier", + name: "type", + + range: [29, 33], + loc: { + start: { column: 29, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + value: Literal { + type: "Literal", + raw: "'json'", + value: "json", + + range: [35, 41], + loc: { + start: { column: 35, line: 1 }, + end: { column: 41, line: 1 }, + }, + }, + + range: [29, 41], + loc: { + start: { column: 29, line: 1 }, + end: { column: 41, line: 1 }, + }, + }, + ], + exported: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [14, 19], + loc: { + start: { column: 14, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [0, 44], + loc: { + start: { column: 0, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 45], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..963999a2a4d --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration assertion Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "*", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [9, 13], + loc: { + start: { column: 9, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [14, 19], + loc: { + start: { column: 14, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "assert", + + range: [20, 26], + loc: { + start: { column: 20, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [29, 33], + loc: { + start: { column: 29, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [33, 34], + loc: { + start: { column: 33, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + String { + type: "String", + value: "'json'", + + range: [35, 41], + loc: { + start: { column: 35, line: 1 }, + end: { column: 41, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [42, 43], + loc: { + start: { column: 42, line: 1 }, + end: { column: 43, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [43, 44], + loc: { + start: { column: 43, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..077fe892d33 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration assertion AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..d5d091ffabd --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration assertion AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/fixture.ts b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/fixture.ts new file mode 100644 index 00000000000..fca392829b8 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/fixture.ts @@ -0,0 +1 @@ +export * as mod from 'module'; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..0650677e2f6 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,48 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration named TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportAllDeclaration { + type: "ExportAllDeclaration", + assertions: Array [], + exported: Identifier { + type: "Identifier", + name: "mod", + + range: [12, 15], + loc: { + start: { column: 12, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'module'", + value: "module", + + range: [21, 29], + loc: { + start: { column: 21, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..7fc2d67baba --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration named TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "*", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [9, 11], + loc: { + start: { column: 9, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "mod", + + range: [12, 15], + loc: { + start: { column: 12, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [16, 20], + loc: { + start: { column: 16, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + String { + type: "String", + value: "'module'", + + range: [21, 29], + loc: { + start: { column: 21, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..25175436773 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/3-Babel-AST.shot @@ -0,0 +1,48 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration named Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportAllDeclaration { + type: "ExportAllDeclaration", + assertions: Array [], + exported: Identifier { + type: "Identifier", + name: "mod", + + range: [12, 15], + loc: { + start: { column: 12, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'module'", + value: "module", + + range: [21, 29], + loc: { + start: { column: 21, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..66f249ee6ca --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration named Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "*", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [9, 11], + loc: { + start: { column: 9, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "mod", + + range: [12, 15], + loc: { + start: { column: 12, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [16, 20], + loc: { + start: { column: 16, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + String { + type: "String", + value: "'module'", + + range: [21, 29], + loc: { + start: { column: 21, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..8aabbae3357 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration named AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..5020f9f630e --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration named AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/fixture.ts b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/fixture.ts new file mode 100644 index 00000000000..86a4838f7b9 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/fixture.ts @@ -0,0 +1 @@ +export * from 'my-module'; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..170461aa1db --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,39 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration unnamed TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportAllDeclaration { + type: "ExportAllDeclaration", + assertions: Array [], + exported: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'my-module'", + value: "my-module", + + range: [14, 25], + loc: { + start: { column: 14, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + + range: [0, 26], + loc: { + start: { column: 0, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..29ffb6ae0fe --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration unnamed TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "*", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [9, 13], + loc: { + start: { column: 9, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + String { + type: "String", + value: "'my-module'", + + range: [14, 25], + loc: { + start: { column: 14, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..67c28f6a239 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/3-Babel-AST.shot @@ -0,0 +1,39 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration unnamed Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportAllDeclaration { + type: "ExportAllDeclaration", + assertions: Array [], + exported: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'my-module'", + value: "my-module", + + range: [14, 25], + loc: { + start: { column: 14, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + + range: [0, 26], + loc: { + start: { column: 0, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..82327ff3352 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration unnamed Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "*", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [9, 13], + loc: { + start: { column: 9, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + String { + type: "String", + value: "'my-module'", + + range: [14, 25], + loc: { + start: { column: 14, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..351bb72f34f --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration unnamed AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..e2a55391779 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportAllDeclaration unnamed AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/fixture.ts b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/fixture.ts new file mode 100644 index 00000000000..0386d9255b0 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/fixture.ts @@ -0,0 +1 @@ +export default enum Foo {} diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..c289052b36c --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration _error_ enum TSESTree - Error 1`] = `[TSError: Expression expected.]`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..294c438cb03 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration _error_ enum Babel - Error 1`] = `[SyntaxError: Unexpected reserved word 'enum'. (1:15)]`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..32a1cb0d300 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration _error_ enum Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/fixture.ts b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/fixture.ts new file mode 100644 index 00000000000..dcefd115a28 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/fixture.ts @@ -0,0 +1 @@ +export default namespace Foo {} diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..d1633569950 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration _error_ namespace TSESTree - Error 1`] = `[TSError: ';' expected.]`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..a80c3233614 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration _error_ namespace Babel - Error 1`] = `[SyntaxError: Missing semicolon. (1:24)]`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..7ecaa9bcded --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration _error_ namespace Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/fixture.ts b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/fixture.ts new file mode 100644 index 00000000000..81b83c5de98 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/fixture.ts @@ -0,0 +1 @@ +export default type Foo = 1; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..bce2c7cd5ee --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration _error_ type-alias TSESTree - Error 1`] = `[TSError: ';' expected.]`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..6afc67d4a5b --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration _error_ type-alias Babel - Error 1`] = `[SyntaxError: Missing semicolon. (1:19)]`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..9f4c01a0337 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration _error_ type-alias Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/fixture.ts b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/fixture.ts new file mode 100644 index 00000000000..4b535f12615 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/fixture.ts @@ -0,0 +1 @@ +export default const x = 1; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..43ab9a3893e --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration _error_ variable-declaration TSESTree - Error 1`] = `[TSError: Expression expected.]`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..318dee3aacf --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration _error_ variable-declaration Babel - Error 1`] = `[SyntaxError: Only expressions, functions or classes are allowed as the \`default\` export. (1:15)]`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..327cd763562 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration _error_ variable-declaration Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/fixture.ts b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/fixture.ts new file mode 100644 index 00000000000..a6e68e98389 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/fixture.ts @@ -0,0 +1 @@ +export default class {} diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..bc5b9ffa8c1 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,47 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration anonymous-class TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [21, 23], + loc: { + start: { column: 21, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + id: null, + superClass: null, + + range: [15, 23], + loc: { + start: { column: 15, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + exportKind: "value", + + 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/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..9773e0f17a9 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration anonymous-class TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [7, 14], + loc: { + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [15, 20], + loc: { + start: { column: 15, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..1262745aead --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/3-Babel-AST.shot @@ -0,0 +1,47 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration anonymous-class Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [21, 23], + loc: { + start: { column: 21, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + id: null, + superClass: null, + + range: [15, 23], + loc: { + start: { column: 15, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + exportKind: "value", + + 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/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..74d6f62864b --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration anonymous-class Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [7, 14], + loc: { + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [15, 20], + loc: { + start: { column: 15, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..6c617458733 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration anonymous-class AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..7ace7535964 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration anonymous-class AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/fixture.ts b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/fixture.ts new file mode 100644 index 00000000000..ea9b101e1c2 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/fixture.ts @@ -0,0 +1 @@ +export default function () {} diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..e30c973e4c5 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,50 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration anonymous-function TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [27, 29], + loc: { + start: { column: 27, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [15, 29], + loc: { + start: { column: 15, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + exportKind: "value", + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..292689734d6 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration anonymous-function TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [7, 14], + loc: { + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [15, 23], + loc: { + start: { column: 15, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..d379b69f6c4 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/3-Babel-AST.shot @@ -0,0 +1,50 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration anonymous-function Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [27, 29], + loc: { + start: { column: 27, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [15, 29], + loc: { + start: { column: 15, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + exportKind: "value", + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..b52b674b4d5 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration anonymous-function Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [7, 14], + loc: { + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [15, 23], + loc: { + start: { column: 15, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..0472fbccb82 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration anonymous-function AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..9b1f36f4e1e --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration anonymous-function AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/fixture.ts b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/fixture.ts new file mode 100644 index 00000000000..2d1ec238274 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/fixture.ts @@ -0,0 +1 @@ +export default () => {}; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..d4ccafd5b51 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,50 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration arrow-function-expression TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [21, 23], + loc: { + start: { column: 21, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [15, 23], + loc: { + start: { column: 15, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + exportKind: "value", + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..b49305998ff --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration arrow-function-expression TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [7, 14], + loc: { + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [18, 20], + loc: { + start: { column: 18, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..85a0d39624f --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/3-Babel-AST.shot @@ -0,0 +1,50 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration arrow-function-expression Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [21, 23], + loc: { + start: { column: 21, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + + range: [15, 23], + loc: { + start: { column: 15, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + exportKind: "value", + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..fc7a2baf088 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration arrow-function-expression Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [7, 14], + loc: { + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [18, 20], + loc: { + start: { column: 18, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..359c33602be --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration arrow-function-expression AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..c7f2151c920 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/arrow-function-expression/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration arrow-function-expression AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/fixture.ts b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/fixture.ts new file mode 100644 index 00000000000..caaf4f896e8 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/fixture.ts @@ -0,0 +1 @@ +export default (class Foo {}); diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..166a1d77c3d --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration class-expression TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: ClassExpression { + type: "ClassExpression", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [26, 28], + loc: { + start: { column: 26, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [22, 25], + loc: { + start: { column: 22, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + superClass: null, + + range: [16, 28], + loc: { + start: { column: 16, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + exportKind: "value", + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..4e62aa0dc6a --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration class-expression TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [7, 14], + loc: { + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [16, 21], + loc: { + start: { column: 16, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [22, 25], + loc: { + start: { column: 22, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..25ab06d87ef --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/3-Babel-AST.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration class-expression Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: ClassExpression { + type: "ClassExpression", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [26, 28], + loc: { + start: { column: 26, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [22, 25], + loc: { + start: { column: 22, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + superClass: null, + + range: [16, 28], + loc: { + start: { column: 16, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + exportKind: "value", + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..4137a875c9f --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration class-expression Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [7, 14], + loc: { + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [16, 21], + loc: { + start: { column: 16, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [22, 25], + loc: { + start: { column: 22, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..4d3dd269c49 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration class-expression AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..1328ba27a28 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration class-expression AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/fixture.ts b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/fixture.ts new file mode 100644 index 00000000000..7804111002d --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/fixture.ts @@ -0,0 +1 @@ +export default class Foo {} diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..f2ce271ea77 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration class TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [25, 27], + loc: { + start: { column: 25, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [21, 24], + loc: { + start: { column: 21, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + superClass: null, + + range: [15, 27], + loc: { + start: { column: 15, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + exportKind: "value", + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..5703d446ea5 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration class TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [7, 14], + loc: { + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [15, 20], + loc: { + start: { column: 15, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [21, 24], + loc: { + start: { column: 21, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..432ded44307 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/3-Babel-AST.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration class Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [25, 27], + loc: { + start: { column: 25, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [21, 24], + loc: { + start: { column: 21, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + superClass: null, + + range: [15, 27], + loc: { + start: { column: 15, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + exportKind: "value", + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..01f9049584e --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration class Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [7, 14], + loc: { + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [15, 20], + loc: { + start: { column: 15, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [21, 24], + loc: { + start: { column: 21, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..892ae8987da --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration class AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..96e9c654eee --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration class AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/fixture.ts b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/fixture.ts new file mode 100644 index 00000000000..386baca1731 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/fixture.ts @@ -0,0 +1 @@ +export default function foo() {} diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..59570dbd56d --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,59 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration function TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [30, 32], + loc: { + start: { column: 30, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [24, 27], + loc: { + start: { column: 24, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + params: Array [], + + range: [15, 32], + loc: { + start: { column: 15, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + exportKind: "value", + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..b3a2cd2b15b --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration function TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [7, 14], + loc: { + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [15, 23], + loc: { + start: { column: 15, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [24, 27], + loc: { + start: { column: 24, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [31, 32], + loc: { + start: { column: 31, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..98b11432232 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/3-Babel-AST.shot @@ -0,0 +1,59 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration function Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [30, 32], + loc: { + start: { column: 30, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [24, 27], + loc: { + start: { column: 24, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + params: Array [], + + range: [15, 32], + loc: { + start: { column: 15, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + exportKind: "value", + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..44f7cd272d3 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration function Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [7, 14], + loc: { + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [15, 23], + loc: { + start: { column: 15, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [24, 27], + loc: { + start: { column: 24, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [31, 32], + loc: { + start: { column: 31, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..6e67c16fb8b --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration function AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..b5de7325dea --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration function AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/fixture.ts b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/fixture.ts new file mode 100644 index 00000000000..7b56c8b8f39 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/fixture.ts @@ -0,0 +1 @@ +export default x; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..11900ab6838 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,36 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration identifier TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: Identifier { + type: "Identifier", + name: "x", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + exportKind: "value", + + range: [0, 17], + loc: { + start: { column: 0, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 18], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..d52ccbb0406 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration identifier TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [7, 14], + loc: { + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..be4bb919b88 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/3-Babel-AST.shot @@ -0,0 +1,36 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration identifier Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: Identifier { + type: "Identifier", + name: "x", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + exportKind: "value", + + range: [0, 17], + loc: { + start: { column: 0, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 18], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..e4567a57c93 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration identifier Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [7, 14], + loc: { + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..1fc84e1257d --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration identifier AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..fa730c9cc1d --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration identifier AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/fixture.ts b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/fixture.ts new file mode 100644 index 00000000000..4c36019eea2 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/fixture.ts @@ -0,0 +1 @@ +export default interface Foo {} diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..755e1480fde --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,55 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration interface TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [29, 31], + loc: { + start: { column: 29, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [25, 28], + loc: { + start: { column: 25, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + + range: [15, 31], + loc: { + start: { column: 15, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + exportKind: "value", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..e528391c3b1 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration interface TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [7, 14], + loc: { + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "interface", + + range: [15, 24], + loc: { + start: { column: 15, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [25, 28], + loc: { + start: { column: 25, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..2619c1ffa78 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/3-Babel-AST.shot @@ -0,0 +1,55 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration interface Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [29, 31], + loc: { + start: { column: 29, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [25, 28], + loc: { + start: { column: 25, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + + range: [15, 31], + loc: { + start: { column: 15, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + exportKind: "value", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..9363ba0a28b --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration interface Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [7, 14], + loc: { + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "interface", + + range: [15, 24], + loc: { + start: { column: 15, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [25, 28], + loc: { + start: { column: 25, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..778b30b1513 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration interface AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..e0918e2af4e --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,72 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration interface AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'export', + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'default', + + range: [7, 14], + loc: { + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [15, 24], + loc: { + start: { column: 15, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [25, 28], + loc: { + start: { column: 25, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/fixture.ts b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/fixture.ts new file mode 100644 index 00000000000..aef22247d75 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/fixture.ts @@ -0,0 +1 @@ +export default 1; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..dae455b793b --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,37 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration literal TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + exportKind: "value", + + range: [0, 17], + loc: { + start: { column: 0, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 18], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..48eaeb62600 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration literal TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [7, 14], + loc: { + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..f4c959e63f2 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/3-Babel-AST.shot @@ -0,0 +1,37 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration literal Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportDefaultDeclaration { + type: "ExportDefaultDeclaration", + declaration: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + exportKind: "value", + + range: [0, 17], + loc: { + start: { column: 0, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 18], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..209d1dbb63f --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration literal Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "default", + + range: [7, 14], + loc: { + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..7715558acb1 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration literal AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..c0a93423d4d --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/literal/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportDefaultDeclaration literal AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/spec.ts b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/spec.ts index 492d0981b8c..2cfe1cce5b3 100644 --- a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/spec.ts +++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/spec.ts @@ -6,6 +6,10 @@ import type { ExportKind } from '../ExportAndImportKind'; export interface ExportDefaultDeclaration extends BaseNode { type: AST_NODE_TYPES.ExportDefaultDeclaration; - declaration: ExportDeclaration | Expression; + declaration: + | // TODO(error handling) - the following are disallowed syntactically, but allowed by TS error recovery: + // TSEnumDeclaration, TSModuleDeclaration, TSTypeAliasDeclaration, VariableDeclaration + ExportDeclaration + | Expression; exportKind: ExportKind; } diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/fixture.ts new file mode 100644 index 00000000000..5faf31b8867 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/fixture.ts @@ -0,0 +1 @@ +export { a as 'a' }; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..71841045f6c --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ aliased-literal TSESTree - Error 1`] = `[TSError: Identifier expected.]`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..dabc7d927d5 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ aliased-literal Babel - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..efb97399842 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ aliased-literal Error Alignment 1`] = `"TSESTree errored but Babel didn't"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/fixture.ts new file mode 100644 index 00000000000..c433d66cf64 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/fixture.ts @@ -0,0 +1 @@ +export class {} diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..4bb37139b1b --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ anonymous-class TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..b3ebe67f29a --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ anonymous-class Babel - Error 1`] = `[SyntaxError: A class name is required. (1:13)]`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..82e5ade4750 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ anonymous-class Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/fixture.ts new file mode 100644 index 00000000000..d9a2010f925 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/fixture.ts @@ -0,0 +1 @@ +export function () {} diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..9c89f7d7f37 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ anonymous-function-expression TSESTree - Error 1`] = `[TSError: Identifier expected.]`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..70ef1140faa --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ anonymous-function-expression Babel - Error 1`] = `[SyntaxError: Unexpected token (1:16)]`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..15aae2856e1 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ anonymous-function-expression Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/fixture.ts new file mode 100644 index 00000000000..ec7e7945aaf --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/fixture.ts @@ -0,0 +1 @@ +export () => {}; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..bc1507d797f --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ arrow-function TSESTree - Error 1`] = `[TSError: Declaration or statement expected.]`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..d3a01941b96 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ arrow-function Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:7)]`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..fd6445ddef3 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ arrow-function Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/fixture.ts new file mode 100644 index 00000000000..bb46c3698b9 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/fixture.ts @@ -0,0 +1 @@ +export (class Foo {}); diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..af9eba5ac2c --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ class-expression TSESTree - Error 1`] = `[TSError: Declaration or statement expected.]`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..59d790cb18d --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ class-expression Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:7)]`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..dbe6913aab5 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ class-expression Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/fixture.ts new file mode 100644 index 00000000000..0d3d77ac413 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/fixture.ts @@ -0,0 +1 @@ +export a; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..302c6c7c652 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ identifier-direct TSESTree - Error 1`] = `[TSError: Declaration or statement expected.]`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..968987af209 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ identifier-direct Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:7)]`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..00f60c625f5 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ identifier-direct Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/fixture.ts new file mode 100644 index 00000000000..7eec000d816 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/fixture.ts @@ -0,0 +1 @@ +export { 'a' }; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..7e7d8c008fc --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ literal-braced TSESTree - Error 1`] = `[TSError: Identifier expected.]`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..3ba27489473 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/2-Babel-Error.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ literal-braced Babel - Error 1`] = ` +[SyntaxError: A string literal cannot be used as an exported binding without \`from\`. +- Did you mean \`export { 'a' as 'a' } from 'some-module'\`? (1:9)] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..f2d4bb40cc5 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ literal-braced Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/fixture.ts new file mode 100644 index 00000000000..ed5896524bf --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/fixture.ts @@ -0,0 +1 @@ +export 'a'; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..9e96ac05522 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ literal-direct TSESTree - Error 1`] = `[TSError: Declaration or statement expected.]`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..cf5a26409d1 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ literal-direct Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:7)]`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..7d06f41fc05 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ literal-direct Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/fixture.ts new file mode 100644 index 00000000000..060ae5187cf --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/fixture.ts @@ -0,0 +1 @@ +export { a as b }; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..c5593e6762b --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,61 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration aliased TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: null, + exportKind: "value", + source: null, + specifiers: Array [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "b", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 15], + loc: { + start: { column: 9, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + ], + + range: [0, 18], + loc: { + start: { column: 0, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 19], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..24df13756b8 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration aliased TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [11, 13], + loc: { + start: { column: 11, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..8978d2ea713 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/3-Babel-AST.shot @@ -0,0 +1,61 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration aliased Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: null, + exportKind: "value", + source: null, + specifiers: Array [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "b", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 15], + loc: { + start: { column: 9, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + ], + + 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/ExportNamedDeclaration/fixtures/aliased/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..bce9dd071b1 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration aliased Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [11, 13], + loc: { + start: { column: 11, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..845f2cb5cfb --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration aliased AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: null, + exportKind: 'value', + source: null, + specifiers: Array [ + ExportSpecifier { + type: 'ExportSpecifier', + exported: Identifier { + type: 'Identifier', + name: 'b', + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + exportKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'a', + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 15], + loc: { + start: { column: 9, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + ], + + range: [0, 18], + loc: { + start: { column: 0, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [0, 19], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..ce523723d51 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration aliased AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/fixture.ts new file mode 100644 index 00000000000..f139479dad0 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/fixture.ts @@ -0,0 +1 @@ +export { foo } from 'mod' assert { type: 'json' }; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..9136ca295cb --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,102 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration assertion TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [ + ImportAttribute { + type: "ImportAttribute", + key: Identifier { + type: "Identifier", + name: "type", + + range: [35, 39], + loc: { + start: { column: 35, line: 1 }, + end: { column: 39, line: 1 }, + }, + }, + value: Literal { + type: "Literal", + raw: "'json'", + value: "json", + + range: [41, 47], + loc: { + start: { column: 41, line: 1 }, + end: { column: 47, line: 1 }, + }, + }, + + range: [35, 47], + loc: { + start: { column: 35, line: 1 }, + end: { column: 47, line: 1 }, + }, + }, + ], + declaration: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [20, 25], + loc: { + start: { column: 20, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + specifiers: Array [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "foo", + + range: [9, 12], + loc: { + start: { column: 9, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "foo", + + range: [9, 12], + loc: { + start: { column: 9, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + + range: [9, 12], + loc: { + start: { column: 9, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + ], + + range: [0, 50], + loc: { + start: { column: 0, line: 1 }, + end: { column: 50, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 51], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..9a30eb2745c --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration assertion TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [9, 12], + loc: { + start: { column: 9, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [13, 14], + loc: { + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [15, 19], + loc: { + start: { column: 15, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [20, 25], + loc: { + start: { column: 20, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "assert", + + range: [26, 32], + loc: { + start: { column: 26, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [33, 34], + loc: { + start: { column: 33, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [35, 39], + loc: { + start: { column: 35, line: 1 }, + end: { column: 39, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [39, 40], + loc: { + start: { column: 39, line: 1 }, + end: { column: 40, line: 1 }, + }, + }, + String { + type: "String", + value: "'json'", + + range: [41, 47], + loc: { + start: { column: 41, line: 1 }, + end: { column: 47, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [48, 49], + loc: { + start: { column: 48, line: 1 }, + end: { column: 49, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [49, 50], + loc: { + start: { column: 49, line: 1 }, + end: { column: 50, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..b2ee980389e --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/3-Babel-AST.shot @@ -0,0 +1,102 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration assertion Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [ + ImportAttribute { + type: "ImportAttribute", + key: Identifier { + type: "Identifier", + name: "type", + + range: [35, 39], + loc: { + start: { column: 35, line: 1 }, + end: { column: 39, line: 1 }, + }, + }, + value: Literal { + type: "Literal", + raw: "'json'", + value: "json", + + range: [41, 47], + loc: { + start: { column: 41, line: 1 }, + end: { column: 47, line: 1 }, + }, + }, + + range: [35, 47], + loc: { + start: { column: 35, line: 1 }, + end: { column: 47, line: 1 }, + }, + }, + ], + declaration: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [20, 25], + loc: { + start: { column: 20, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + specifiers: Array [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "foo", + + range: [9, 12], + loc: { + start: { column: 9, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "foo", + + range: [9, 12], + loc: { + start: { column: 9, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + + range: [9, 12], + loc: { + start: { column: 9, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + ], + + range: [0, 50], + loc: { + start: { column: 0, line: 1 }, + end: { column: 50, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 51], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..95aa314bf6b --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration assertion Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [9, 12], + loc: { + start: { column: 9, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [13, 14], + loc: { + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [15, 19], + loc: { + start: { column: 15, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [20, 25], + loc: { + start: { column: 20, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "assert", + + range: [26, 32], + loc: { + start: { column: 26, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [33, 34], + loc: { + start: { column: 33, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [35, 39], + loc: { + start: { column: 35, line: 1 }, + end: { column: 39, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [39, 40], + loc: { + start: { column: 39, line: 1 }, + end: { column: 40, line: 1 }, + }, + }, + String { + type: "String", + value: "'json'", + + range: [41, 47], + loc: { + start: { column: 41, line: 1 }, + end: { column: 47, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [48, 49], + loc: { + start: { column: 48, line: 1 }, + end: { column: 49, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [49, 50], + loc: { + start: { column: 49, line: 1 }, + end: { column: 50, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..258519a7adf --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration assertion AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..dade8ee29e7 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration assertion AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/fixture.ts new file mode 100644 index 00000000000..223d0a8b395 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/fixture.ts @@ -0,0 +1 @@ +export class Foo {} diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..d33d4cd08d4 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,59 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration class TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [17, 19], + loc: { + start: { column: 17, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [13, 16], + loc: { + start: { column: 13, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + superClass: null, + + range: [7, 19], + loc: { + start: { column: 7, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [0, 19], + loc: { + start: { column: 0, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 20], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..b9218046a08 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration class TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [7, 12], + loc: { + start: { column: 7, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [13, 16], + loc: { + start: { column: 13, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..b50c37aca33 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/3-Babel-AST.shot @@ -0,0 +1,59 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration class Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [17, 19], + loc: { + start: { column: 17, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [13, 16], + loc: { + start: { column: 13, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + superClass: null, + + range: [7, 19], + loc: { + start: { column: 7, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [0, 19], + loc: { + start: { column: 0, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 20], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..cdfb7afcd34 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration class Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [7, 12], + loc: { + start: { column: 7, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [13, 16], + loc: { + start: { column: 13, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..cb90ab5e0fb --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration class AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..8f68d87f732 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration class AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/fixture.ts new file mode 100644 index 00000000000..b1725174a5e --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/fixture.ts @@ -0,0 +1 @@ +export declare function foo(): void; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..e6cd6c4d7a3 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,71 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration declare-function TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSDeclareFunction { + type: "TSDeclareFunction", + async: false, + declare: true, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [24, 27], + loc: { + start: { column: 24, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [31, 35], + loc: { + start: { column: 31, line: 1 }, + end: { column: 35, line: 1 }, + }, + }, + + range: [29, 35], + loc: { + start: { column: 29, line: 1 }, + end: { column: 35, line: 1 }, + }, + }, + + range: [7, 36], + loc: { + start: { column: 7, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, + exportKind: "type", + source: null, + specifiers: Array [], + + range: [0, 36], + loc: { + start: { column: 0, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 37], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..13073c0479d --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration declare-function TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [7, 14], + loc: { + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [15, 23], + loc: { + start: { column: 15, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [24, 27], + loc: { + start: { column: 24, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [31, 35], + loc: { + start: { column: 31, line: 1 }, + end: { column: 35, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [35, 36], + loc: { + start: { column: 35, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..59786b3f97e --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/3-Babel-AST.shot @@ -0,0 +1,71 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration declare-function Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSDeclareFunction { + type: "TSDeclareFunction", + async: false, + declare: true, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [24, 27], + loc: { + start: { column: 24, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSVoidKeyword { + type: "TSVoidKeyword", + + range: [31, 35], + loc: { + start: { column: 31, line: 1 }, + end: { column: 35, line: 1 }, + }, + }, + + range: [29, 35], + loc: { + start: { column: 29, line: 1 }, + end: { column: 35, line: 1 }, + }, + }, + + range: [7, 36], + loc: { + start: { column: 7, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, + exportKind: "type", + source: null, + specifiers: Array [], + + range: [0, 36], + loc: { + start: { column: 0, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 37], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..b5ea9d5fbf4 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration declare-function Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [7, 14], + loc: { + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [15, 23], + loc: { + start: { column: 15, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [24, 27], + loc: { + start: { column: 24, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "void", + + range: [31, 35], + loc: { + start: { column: 31, line: 1 }, + end: { column: 35, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [35, 36], + loc: { + start: { column: 35, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..9aaae286a11 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration declare-function AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: TSDeclareFunction { + type: 'TSDeclareFunction', + async: false, + declare: true, + expression: false, + generator: false, + id: Identifier { + type: 'Identifier', + name: 'foo', + + range: [24, 27], + loc: { + start: { column: 24, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSVoidKeyword { + type: 'TSVoidKeyword', + + range: [31, 35], + loc: { + start: { column: 31, line: 1 }, + end: { column: 35, line: 1 }, + }, + }, + + range: [29, 35], + loc: { + start: { column: 29, line: 1 }, + end: { column: 35, line: 1 }, + }, + }, + + range: [7, 36], + loc: { + start: { column: 7, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, + exportKind: 'type', + source: null, + specifiers: Array [], + + range: [0, 36], + loc: { + start: { column: 0, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [0, 37], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..9b1647311bd --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration declare-function AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/fixture.ts new file mode 100644 index 00000000000..3705c4fd946 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/fixture.ts @@ -0,0 +1 @@ +export enum Foo {} diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..70f1a5783f9 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,49 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration 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: [12, 15], + loc: { + start: { column: 12, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + members: Array [], + + range: [7, 18], + loc: { + start: { column: 7, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [0, 18], + loc: { + start: { column: 0, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 19], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..5c6e73d4b25 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration enum TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "enum", + + range: [7, 11], + loc: { + start: { column: 7, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [12, 15], + loc: { + start: { column: 12, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..cff1b64a3bc --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/3-Babel-AST.shot @@ -0,0 +1,49 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration 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: [12, 15], + loc: { + start: { column: 12, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + members: Array [], + + range: [7, 18], + loc: { + start: { column: 7, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [0, 18], + loc: { + start: { column: 0, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 19], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..e7ad15b4a50 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration enum Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "enum", + + range: [7, 11], + loc: { + start: { column: 7, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [12, 15], + loc: { + start: { column: 12, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..1a21129afb2 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration enum AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..2d3cd94a36c --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,62 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration enum AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'export', + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'enum', + + range: [7, 11], + loc: { + start: { column: 7, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [12, 15], + loc: { + start: { column: 12, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/fixture.ts new file mode 100644 index 00000000000..f99d4277774 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/fixture.ts @@ -0,0 +1 @@ +export function foo() {} diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..ad4118a633c --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,62 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration function-declaration TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [22, 24], + loc: { + start: { column: 22, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [16, 19], + loc: { + start: { column: 16, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + params: Array [], + + range: [7, 24], + loc: { + start: { column: 7, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..c4c9340ff8c --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration function-declaration TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [7, 15], + loc: { + start: { column: 7, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [16, 19], + loc: { + start: { column: 16, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..0a8a9e7e818 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/3-Babel-AST.shot @@ -0,0 +1,62 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration function-declaration Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [22, 24], + loc: { + start: { column: 22, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [16, 19], + loc: { + start: { column: 16, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + params: Array [], + + range: [7, 24], + loc: { + start: { column: 7, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..f60ad2056b0 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration function-declaration Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [7, 15], + loc: { + start: { column: 7, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [16, 19], + loc: { + start: { column: 16, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..fe318b3ed6f --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration function-declaration AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..502fe958a40 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration function-declaration AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/fixture.ts new file mode 100644 index 00000000000..7e905f38bf5 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/fixture.ts @@ -0,0 +1 @@ +export { a }; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..3a91eb9c252 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,61 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration identifier-braced TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: null, + exportKind: "value", + source: null, + specifiers: Array [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + ], + + range: [0, 13], + loc: { + start: { column: 0, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 14], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..471a1862f6c --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration identifier-braced TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..355669e5d30 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/3-Babel-AST.shot @@ -0,0 +1,61 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration identifier-braced Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: null, + exportKind: "value", + source: null, + specifiers: Array [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + ], + + 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/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..c01ed8b93a4 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration identifier-braced Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..240f602618f --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration identifier-braced AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: null, + exportKind: 'value', + source: null, + specifiers: Array [ + ExportSpecifier { + type: 'ExportSpecifier', + exported: Identifier { + type: 'Identifier', + name: 'a', + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + exportKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'a', + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + ], + + range: [0, 13], + loc: { + start: { column: 0, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [0, 14], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..d3563662f8c --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration identifier-braced AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/fixture.ts new file mode 100644 index 00000000000..606432a162a --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/fixture.ts @@ -0,0 +1 @@ +export { a, b }; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..4c2fa789c16 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,91 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration identifier-many TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: null, + exportKind: "value", + source: null, + specifiers: Array [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "b", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "b", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + ], + + range: [0, 16], + loc: { + start: { column: 0, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 17], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..91bf0e7c2b9 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration identifier-many TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..d228386edb5 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/3-Babel-AST.shot @@ -0,0 +1,91 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration identifier-many Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: null, + exportKind: "value", + source: null, + specifiers: Array [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "b", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "b", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + ], + + range: [0, 16], + loc: { + start: { column: 0, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 17], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..f29165c63d0 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration identifier-many Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..8d76dc7c571 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration identifier-many AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: null, + exportKind: 'value', + source: null, + specifiers: Array [ + ExportSpecifier { + type: 'ExportSpecifier', + exported: Identifier { + type: 'Identifier', + name: 'a', + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + exportKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'a', + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + ExportSpecifier { + type: 'ExportSpecifier', + exported: Identifier { + type: 'Identifier', + name: 'b', + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + exportKind: 'value', + local: Identifier { + type: 'Identifier', + name: 'b', + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + ], + + range: [0, 16], + loc: { + start: { column: 0, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [0, 17], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..939b36fc37c --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration identifier-many AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/fixture.ts new file mode 100644 index 00000000000..39df3b83f7e --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/fixture.ts @@ -0,0 +1 @@ +export interface Foo {} diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..a301d0efca7 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,58 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration interface TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + 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 }, + }, + }, + + range: [7, 23], + loc: { + start: { column: 7, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + exportKind: "type", + 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/ExportNamedDeclaration/fixtures/interface/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..9a0b5ef7598 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration interface TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "interface", + + range: [7, 16], + loc: { + start: { column: 7, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [17, 20], + loc: { + start: { column: 17, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..776ce5004ba --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/3-Babel-AST.shot @@ -0,0 +1,58 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration interface Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + 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 }, + }, + }, + + range: [7, 23], + loc: { + start: { column: 7, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + exportKind: "type", + source: null, + specifiers: Array [], + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..c52d2829e2e --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration interface Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "interface", + + range: [7, 16], + loc: { + start: { column: 7, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [17, 20], + loc: { + start: { column: 17, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..02ddc518379 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,63 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration interface AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + 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 }, + }, + }, + + range: [7, 23], + loc: { + start: { column: 7, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + exportKind: 'type', + source: null, + specifiers: Array [], + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..3bf1141ae94 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,62 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration interface AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'export', + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [7, 16], + loc: { + start: { column: 7, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [17, 20], + loc: { + start: { column: 17, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/fixture.ts new file mode 100644 index 00000000000..851030bd028 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/fixture.ts @@ -0,0 +1 @@ +export namespace Foo {} 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 new file mode 100644 index 00000000000..8bee64090fc --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,58 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration namespace TSESTree - AST 1`] = ` +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 }, + }, + }, + + 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/ExportNamedDeclaration/fixtures/namespace/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..72df88433a4 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration namespace TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "namespace", + + range: [7, 16], + loc: { + start: { column: 7, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [17, 20], + loc: { + start: { column: 17, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..494c5144247 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/3-Babel-AST.shot @@ -0,0 +1,58 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration namespace Babel - AST 1`] = ` +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 }, + }, + }, + + 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/ExportNamedDeclaration/fixtures/namespace/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..0a3d1ca1dee --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,56 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration namespace Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "namespace", + + range: [7, 16], + loc: { + start: { column: 7, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [17, 20], + loc: { + start: { column: 17, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, +] +`; 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 new file mode 100644 index 00000000000..00a19c01c58 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration namespace AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..57daa643d18 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration namespace AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/fixture.ts new file mode 100644 index 00000000000..f29cc6f5296 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/fixture.ts @@ -0,0 +1 @@ +export type A = 1; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..2a6f27ff691 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,68 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration type-alias TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "A", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + typeAnnotation: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [7, 18], + loc: { + start: { column: 7, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + exportKind: "type", + source: null, + specifiers: Array [], + + range: [0, 18], + loc: { + start: { column: 0, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 19], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..b7fb84a7c81 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration type-alias TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [7, 11], + loc: { + start: { column: 7, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..b4392aa8e9c --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/3-Babel-AST.shot @@ -0,0 +1,68 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration type-alias Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: TSTypeAliasDeclaration { + type: "TSTypeAliasDeclaration", + id: Identifier { + type: "Identifier", + name: "A", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + typeAnnotation: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [7, 18], + loc: { + start: { column: 7, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + exportKind: "type", + source: null, + specifiers: Array [], + + 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/ExportNamedDeclaration/fixtures/type-alias/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..597a4d5f2bd --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration type-alias Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [7, 11], + loc: { + start: { column: 7, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..db70418e9f1 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,73 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration type-alias 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: 'A', + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + typeAnnotation: TSLiteralType { + type: 'TSLiteralType', + literal: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [7, 18], + loc: { + start: { column: 7, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + exportKind: 'type', + source: null, + specifiers: Array [], + + range: [0, 18], + loc: { + start: { column: 0, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [0, 19], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..6f04a9a6981 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration type-alias AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/fixture.ts new file mode 100644 index 00000000000..ad1d380d6cc --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/fixture.ts @@ -0,0 +1 @@ +export const x = 1; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..64a85af7e54 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,71 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration variable-declaration TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + + range: [13, 14], + loc: { + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + + range: [13, 18], + loc: { + start: { column: 13, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + kind: "const", + + range: [7, 19], + loc: { + start: { column: 7, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [0, 19], + loc: { + start: { column: 0, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 20], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..73bd6c93bb9 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration variable-declaration TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [7, 12], + loc: { + start: { column: 7, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [13, 14], + loc: { + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..8b842b6d584 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/3-Babel-AST.shot @@ -0,0 +1,71 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration variable-declaration Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: Array [], + declaration: VariableDeclaration { + type: "VariableDeclaration", + declarations: Array [ + VariableDeclarator { + type: "VariableDeclarator", + id: Identifier { + type: "Identifier", + name: "x", + + range: [13, 14], + loc: { + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + init: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + + range: [13, 18], + loc: { + start: { column: 13, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + kind: "const", + + range: [7, 19], + loc: { + start: { column: 7, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + exportKind: "value", + source: null, + specifiers: Array [], + + range: [0, 19], + loc: { + start: { column: 0, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 20], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..1bfff47fa92 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration variable-declaration Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [7, 12], + loc: { + start: { column: 7, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "x", + + range: [13, 14], + loc: { + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..bb45021e9c4 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration variable-declaration AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..de15dbc1cc6 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration variable-declaration AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts index d2f4d75b3c2..3e2989b7499 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts @@ -8,6 +8,7 @@ import type { ExportKind } from '../ExportAndImportKind'; export interface ExportNamedDeclaration extends BaseNode { type: AST_NODE_TYPES.ExportNamedDeclaration; + // TODO(error handling) - ClassExpression is not valid here declaration: ExportDeclaration | null; specifiers: ExportSpecifier[]; source: StringLiteral | null; diff --git a/packages/ast-spec/tests/PunctuatorTokenToText.test.ts b/packages/ast-spec/tests/PunctuatorTokenToText.type-test.ts similarity index 100% rename from packages/ast-spec/tests/PunctuatorTokenToText.test.ts rename to packages/ast-spec/tests/PunctuatorTokenToText.type-test.ts diff --git a/packages/ast-spec/tests/ast-node-types.test.ts b/packages/ast-spec/tests/ast-node-types.type-test.ts similarity index 100% rename from packages/ast-spec/tests/ast-node-types.test.ts rename to packages/ast-spec/tests/ast-node-types.type-test.ts diff --git a/packages/ast-spec/tests/fixtures-with-differences-ast.shot b/packages/ast-spec/tests/fixtures-with-differences-ast.shot new file mode 100644 index 00000000000..2a37d6b6582 --- /dev/null +++ b/packages/ast-spec/tests/fixtures-with-differences-ast.shot @@ -0,0 +1,16 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures List fixtures with AST differences 1`] = ` +Set { + "declaration/ClassDeclaration/fixtures/implements-many/fixture.ts", + "declaration/ClassDeclaration/fixtures/implements-one/fixture.ts", + "declaration/ClassDeclaration/fixtures/type-parameters-extends-type-parameters/fixture.ts", + "declaration/ClassDeclaration/fixtures/type-parameters/fixture.ts", + "declaration/ExportNamedDeclaration/fixtures/aliased/fixture.ts", + "declaration/ExportNamedDeclaration/fixtures/declare-function/fixture.ts", + "declaration/ExportNamedDeclaration/fixtures/identifier-braced/fixture.ts", + "declaration/ExportNamedDeclaration/fixtures/identifier-many/fixture.ts", + "declaration/ExportNamedDeclaration/fixtures/interface/fixture.ts", + "declaration/ExportNamedDeclaration/fixtures/type-alias/fixture.ts", +} +`; diff --git a/packages/ast-spec/tests/fixtures-with-differences-errors.shot b/packages/ast-spec/tests/fixtures-with-differences-errors.shot new file mode 100644 index 00000000000..59b5c479a75 --- /dev/null +++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot @@ -0,0 +1,15 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures List fixtures with Error differences 1`] = ` +Object { + "Babel errored but TSESTree didn't": Set { + "declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/fixture.ts", + "declaration/ExportAllDeclaration/fixtures/_error_/type-kind/fixture.ts", + "declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/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", + }, +} +`; diff --git a/packages/ast-spec/tests/fixtures-with-differences-tokens.shot b/packages/ast-spec/tests/fixtures-with-differences-tokens.shot new file mode 100644 index 00000000000..6c8d721a41a --- /dev/null +++ b/packages/ast-spec/tests/fixtures-with-differences-tokens.shot @@ -0,0 +1,11 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures List fixtures with Token differences 1`] = ` +Set { + "declaration/ClassDeclaration/fixtures/implements-many/fixture.ts", + "declaration/ClassDeclaration/fixtures/implements-one/fixture.ts", + "declaration/ExportDefaultDeclaration/fixtures/interface/fixture.ts", + "declaration/ExportNamedDeclaration/fixtures/enum/fixture.ts", + "declaration/ExportNamedDeclaration/fixtures/interface/fixture.ts", +} +`; diff --git a/packages/ast-spec/tests/fixtures.test.ts b/packages/ast-spec/tests/fixtures.test.ts new file mode 100644 index 00000000000..aa4553ec401 --- /dev/null +++ b/packages/ast-spec/tests/fixtures.test.ts @@ -0,0 +1,249 @@ +import fs from 'fs'; +import glob from 'glob'; +import makeDir from 'make-dir'; +import path from 'path'; +import { parseBabel } from './util/parsers/babel'; +import { Fixture } from './util/parsers/parser-types'; +import { parseTSESTree } from './util/parsers/typescript-estree'; +import { snapshotDiff, diffHasChanges } from './util/snapshot-diff'; + +const PACKAGE_ROOT = path.resolve(__dirname, '..'); +const SRC_DIR = path.resolve(PACKAGE_ROOT, 'src'); + +// 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. ['declaration', 'ClassDeclaration', 'abstract'] will only test /declaration/ClassDeclaration/fixtures/abstract/fixture.ts +// prettier-ignore +const ONLY = [].join(path.sep); + +const fixturesWithASTDifferences = new Set(); +const fixturesWithTokenDifferences = new Set(); +enum ErrorLabel { + TSESTree = "TSESTree errored but Babel didn't", + Babel = "Babel errored but TSESTree didn't", + Both = 'Both errored', + None = 'No errors', +} +const fixturesWithErrorDifferences = { + [ErrorLabel.TSESTree]: new Set(), + [ErrorLabel.Babel]: new Set(), +} as const; + +const validFixtures = glob.sync(`${SRC_DIR}/**/fixtures/*/*.{ts,tsx}`); +const errorFixtures = glob.sync(`${SRC_DIR}/**/fixtures/_error_/*/*.{ts,tsx}`); + +const fixtures: readonly Fixture[] = [...validFixtures, ...errorFixtures].map( + absolute => { + const relativeToSrc = path.relative(SRC_DIR, absolute); + const { dir, ext } = path.parse(relativeToSrc); + const segments = dir.split(path.sep).filter(s => s !== 'fixtures'); + const name = segments.pop()!; + const snapshotPath = path.join(SRC_DIR, dir, 'snapshots'); + return { + absolute, + name, + ext, + isError: absolute.includes('/_error_/'), + isJSX: ext.endsWith('x'), + relative: path.relative(SRC_DIR, absolute), + segments, + snapshotPath, + snapshotFiles: { + success: { + tsestree: { + ast: path.join(snapshotPath, '1-TSESTree-AST.shot'), + tokens: path.join(snapshotPath, '2-TSESTree-Tokens.shot'), + }, + babel: { + ast: path.join(snapshotPath, '3-Babel-AST.shot'), + tokens: path.join(snapshotPath, '4-Babel-Tokens.shot'), + }, + alignment: { + ast: path.join(snapshotPath, '5-AST-Alignment-AST.shot'), + tokens: path.join(snapshotPath, '6-AST-Alignment-Tokens.shot'), + }, + }, + error: { + tsestree: path.join(snapshotPath, '1-TSESTree-Error.shot'), + babel: path.join(snapshotPath, '2-Babel-Error.shot'), + alignment: path.join(snapshotPath, '3-Alignment-Error.shot'), + }, + }, + }; + }, +); + +function isError(e: unknown): e is { code: unknown } { + return typeof e === 'object' && e != null && 'code' in e; +} + +function nestDescribe(fixture: Fixture, 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 (e) { + if (isError(e) && e.code === 'EEXIST') { + // already exists - ignored + } else { + throw e; + } + } + + const tsestreeParsed = parseTSESTree(fixture, contents); + const babelParsed = parseBabel(fixture, contents); + const babelError = babelParsed.error !== 'NO ERROR'; + const tsestreeError = tsestreeParsed.error !== 'NO ERROR'; + let errorLabel: ErrorLabel; + if (!babelError && tsestreeError) { + errorLabel = ErrorLabel.TSESTree; + } else if (babelError && !tsestreeError) { + errorLabel = ErrorLabel.Babel; + } else if (babelError && tsestreeError) { + errorLabel = ErrorLabel.Both; + } else { + errorLabel = ErrorLabel.None; + } + if (fixture.isError) { + it('TSESTree - Error', () => { + expect(tsestreeParsed.error).toMatchSpecificSnapshot( + fixture.snapshotFiles.error.tsestree, + ); + }); + it('Babel - Error', () => { + expect(babelParsed.error).toMatchSpecificSnapshot( + fixture.snapshotFiles.error.babel, + ); + }); + it('Error Alignment', () => { + if ( + errorLabel === ErrorLabel.TSESTree || + errorLabel === ErrorLabel.Babel + ) { + fixturesWithErrorDifferences[errorLabel].add(fixture.relative); + } + expect(errorLabel).toMatchSpecificSnapshot( + fixture.snapshotFiles.error.alignment, + ); + }); + it('Should parse with errors', () => { + // if this fails and you WEREN'T expecting a parser error, then your fixture should not be in the `_error_` subfolder + // if this fails and you WERE expecting a parser error - then something is broken. + expect(errorLabel).not.toBe(ErrorLabel.None); + }); + } else { + it('TSESTree - AST', () => { + expect(tsestreeParsed.ast).toMatchSpecificSnapshot( + fixture.snapshotFiles.success.tsestree.ast, + ); + }); + it('TSESTree - Tokens', () => { + expect(tsestreeParsed.tokens).toMatchSpecificSnapshot( + fixture.snapshotFiles.success.tsestree.tokens, + ); + }); + + it('Babel - AST', () => { + expect(babelParsed.ast).toMatchSpecificSnapshot( + fixture.snapshotFiles.success.babel.ast, + ); + }); + it('Babel - Tokens', () => { + expect(babelParsed.tokens).toMatchSpecificSnapshot( + fixture.snapshotFiles.success.babel.tokens, + ); + }); + + it('AST Alignment - AST', () => { + const diffResult = snapshotDiff( + 'TSESTree', + tsestreeParsed.ast, + 'Babel', + babelParsed.ast, + ); + expect(diffResult).toMatchSpecificSnapshot( + fixture.snapshotFiles.success.alignment.ast, + ); + + if (diffHasChanges(diffResult)) { + fixturesWithASTDifferences.add(fixture.relative); + } + }); + it('AST Alignment - Token', () => { + const diffResult = snapshotDiff( + 'TSESTree', + tsestreeParsed.tokens, + 'Babel', + babelParsed.tokens, + ); + expect(diffResult).toMatchSpecificSnapshot( + fixture.snapshotFiles.success.alignment.tokens, + ); + + if (diffHasChanges(diffResult)) { + fixturesWithTokenDifferences.add(fixture.relative); + } + }); + + it('Should parse with no errors', () => { + // log the error for debug purposes in case there wasn't supposed to be an error + switch (errorLabel) { + case ErrorLabel.None: + return; + + case ErrorLabel.Babel: + console.error('Babel:\n', babelParsed.error); + break; + + case ErrorLabel.TSESTree: + console.error('TSESTree:\n', tsestreeParsed.error); + break; + + case ErrorLabel.Both: + console.error('Babel:\n', babelParsed.error); + console.error('TSESTree:\n', tsestreeParsed.error); + break; + } + + // if this fails and you WERE expecting a parser error, then your fixture should be in the `_error_` subfolder + // if this fails and you WEREN'T expecting a parser error - then something is broken. + expect(errorLabel).toBe(ErrorLabel.None); + }); + } + }; + + if ([...fixture.segments, fixture.name].join(path.sep) === ONLY) { + // eslint-disable-next-line jest/no-focused-tests + describe.only(fixture.name, test); + } else { + describe(fixture.name, test); + } + } +} + +describe('AST Fixtures', () => { + fixtures.forEach(f => nestDescribe(f)); + + // once we've run all the tests, snapshot the list of fixtures that have differences for easy reference + it('List fixtures with AST differences', () => { + expect(fixturesWithASTDifferences).toMatchSpecificSnapshot( + path.resolve(__dirname, 'fixtures-with-differences-ast.shot'), + ); + }); + it('List fixtures with Token differences', () => { + expect(fixturesWithTokenDifferences).toMatchSpecificSnapshot( + path.resolve(__dirname, 'fixtures-with-differences-tokens.shot'), + ); + }); + it('List fixtures with Error differences', () => { + expect(fixturesWithErrorDifferences).toMatchSpecificSnapshot( + path.resolve(__dirname, 'fixtures-with-differences-errors.shot'), + ); + }); +}); diff --git a/packages/ast-spec/tests/util/parsers/babel.ts b/packages/ast-spec/tests/util/parsers/babel.ts new file mode 100644 index 00000000000..e69b6d7969f --- /dev/null +++ b/packages/ast-spec/tests/util/parsers/babel.ts @@ -0,0 +1,50 @@ +import { parse, ParserPlugin } from '@babel/eslint-parser'; +import { Fixture, ParserResponse } from './parser-types'; + +const PLUGINS: ParserPlugin[] = [ + // TODO - enable classFeatures instead of classProperties when we support it + // 'classFeatures', + 'classProperties', + 'decorators-legacy', + 'importAssertions', + 'typescript', +]; + +export function parseBabel(fixture: Fixture, contents: string): ParserResponse { + const plugins = [...PLUGINS]; + if (fixture.isJSX) { + plugins.push('jsx'); + } + + let ast: unknown | 'ERROR' = 'ERROR'; + let tokens: unknown | 'ERROR' = 'ERROR'; + let error: unknown | 'NO ERROR' = 'NO ERROR'; + + try { + const result = parse(contents, { + allowImportExportEverywhere: true, + babelOptions: { + parserOpts: { + plugins, + }, + }, + ecmaFeatures: { + globalReturn: true, + }, + requireConfigFile: false, + sourceType: 'unambiguous', + }); + const { tokens: _, comments: __, ...program } = result; + + tokens = result.tokens; + ast = program; + } catch (e: unknown) { + error = e; + } + + return { + tokens, + ast, + error, + }; +} diff --git a/packages/ast-spec/tests/util/parsers/parser-types.ts b/packages/ast-spec/tests/util/parsers/parser-types.ts new file mode 100644 index 00000000000..6bc6fe71b3b --- /dev/null +++ b/packages/ast-spec/tests/util/parsers/parser-types.ts @@ -0,0 +1,33 @@ +interface SuccessSnapshotPaths { + readonly ast: string; + readonly tokens: string; +} + +export interface Fixture { + readonly absolute: string; + readonly name: string; + readonly ext: string; + readonly isError: boolean; + readonly isJSX: boolean; + readonly relative: string; + readonly segments: string[]; + readonly snapshotPath: string; + readonly snapshotFiles: { + readonly success: { + readonly tsestree: SuccessSnapshotPaths; + readonly babel: SuccessSnapshotPaths; + readonly alignment: SuccessSnapshotPaths; + }; + readonly error: { + readonly tsestree: string; + readonly babel: string; + readonly alignment: string; + }; + }; +} + +export interface ParserResponse { + readonly ast: unknown | 'ERROR'; + readonly tokens: unknown | 'ERROR'; + readonly error: unknown | 'NO ERROR'; +} diff --git a/packages/ast-spec/tests/util/parsers/typescript-estree.ts b/packages/ast-spec/tests/util/parsers/typescript-estree.ts new file mode 100644 index 00000000000..07a6fd64491 --- /dev/null +++ b/packages/ast-spec/tests/util/parsers/typescript-estree.ts @@ -0,0 +1,33 @@ +import { parse, TSESTree } from '../typescript-estree-import'; +import { Fixture, ParserResponse } from './parser-types'; + +export function parseTSESTree( + fixture: Fixture, + contents: string, +): ParserResponse { + let ast: TSESTree.Program | 'ERROR' = 'ERROR'; + let tokens: TSESTree.Token[] | 'ERROR' = 'ERROR'; + let error: unknown | 'NO ERROR' = 'NO ERROR'; + + try { + const result = parse(contents, { + comment: false, + jsx: fixture.ext.endsWith('x'), + loc: true, + range: true, + tokens: true, + }); + const { tokens: _, comments: __, ...program } = result; + + tokens = result.tokens; + ast = program; + } catch (e: unknown) { + error = e; + } + + return { + tokens, + ast, + error, + }; +} diff --git a/packages/ast-spec/tests/util/serializers/Node.ts b/packages/ast-spec/tests/util/serializers/Node.ts new file mode 100644 index 00000000000..a9e6b4ddf06 --- /dev/null +++ b/packages/ast-spec/tests/util/serializers/Node.ts @@ -0,0 +1,83 @@ +import type * as TSESTree from '../../../src'; +import { NewPlugin } from 'pretty-format'; +import { AST_NODE_TYPES } from '../../../src'; + +function sortKeys(node: TSESTree.Node): (keyof typeof node)[] { + const keySet = new Set(Object.keys(node)); + + // type place as first key + keySet.delete('type'); + // range and loc we place after all properties + keySet.delete('range'); + keySet.delete('loc'); + + // babel keys + keySet.delete('start'); + keySet.delete('end'); + if (node.type === AST_NODE_TYPES.Program) { + keySet.delete('interpreter'); + } + + return Array.from(keySet).sort((a, b) => + a.localeCompare(b), + ) as (keyof typeof node)[]; +} + +function stringifyLineAndColumn(loc: TSESTree.Position): string { + return `{ column: ${loc.column}, line: ${loc.line} }`; +} + +function isObject(val: unknown): val is Record { + return val != null && typeof val === 'object'; +} +function hasValidType(type: unknown): type is string { + return typeof type === 'string'; +} + +const serializer: NewPlugin = { + test(val: unknown) { + return isObject(val) && hasValidType(val.type); + }, + serialize(node: TSESTree.Node, config, indentation, depth, refs, printer) { + const keys = sortKeys(node); + const type = node.type; + const loc = node.loc; + const range = node.range; + + const outputLines = []; + const childIndentation = indentation + config.indent; + + const printValue = (value: unknown): string => + printer(value, config, childIndentation, depth, refs); + + outputLines.push(`${type} {`); + outputLines.push(`${childIndentation}type: ${printValue(type)},`); + + for (const key of keys) { + const value = node[key]; + if (value === undefined) { + continue; + } + + outputLines.push(`${childIndentation}${key}: ${printValue(value)},`); + } + + outputLines.push(''); + outputLines.push(`${childIndentation}range: [${range.join(', ')}],`); + outputLines.push( + `${childIndentation}loc: {`, + `${childIndentation}${config.indent}start: ${stringifyLineAndColumn( + loc.start, + )},`, + `${childIndentation}${config.indent}end: ${stringifyLineAndColumn( + loc.end, + )},`, + `${childIndentation}},`, + ); + outputLines.push(`${indentation}}`); + + return outputLines.join('\n'); + }, +}; + +export { serializer }; diff --git a/packages/ast-spec/tests/util/serializers/index.ts b/packages/ast-spec/tests/util/serializers/index.ts new file mode 100644 index 00000000000..c9c0e3c54be --- /dev/null +++ b/packages/ast-spec/tests/util/serializers/index.ts @@ -0,0 +1,6 @@ +import * as Node from './Node'; + +export const serializers = [ + // + Node.serializer, +] as const; diff --git a/packages/ast-spec/tests/util/serializers/string.ts b/packages/ast-spec/tests/util/serializers/string.ts new file mode 100644 index 00000000000..81750c26009 --- /dev/null +++ b/packages/ast-spec/tests/util/serializers/string.ts @@ -0,0 +1,38 @@ +import { NewPlugin } from 'pretty-format'; + +// custom string serializer so that we can use single-quoted strings instead of double quoted strings +// this plays nicer with the way that the snapshot diff result, which is a pure string +const serializer: NewPlugin = { + test(val: unknown) { + return typeof val === 'string'; + }, + serialize( + str: string, + // config, + // indentation, + // depth, + // refs, + // printer, + ) { + const characters: string[] = []; + + characters.push("'"); + for (const character of str) { + switch (character) { + case "'": + characters.push('\\'); + break; + + case '\\': + characters.push('\\'); + break; + } + characters.push(character); + } + characters.push("'"); + + return characters.join(''); + }, +}; + +export { serializer }; diff --git a/packages/ast-spec/tests/util/setupJest.ts b/packages/ast-spec/tests/util/setupJest.ts new file mode 100644 index 00000000000..6b9e99943bf --- /dev/null +++ b/packages/ast-spec/tests/util/setupJest.ts @@ -0,0 +1,8 @@ +import { addSerializer } from 'jest-specific-snapshot'; +import { serializers } from './serializers'; + +for (const serializer of serializers) { + // the jest types are wrong here + expect.addSnapshotSerializer(serializer); + addSerializer(serializer); +} diff --git a/packages/ast-spec/tests/util/snapshot-diff.ts b/packages/ast-spec/tests/util/snapshot-diff.ts new file mode 100644 index 00000000000..4bf6546eeec --- /dev/null +++ b/packages/ast-spec/tests/util/snapshot-diff.ts @@ -0,0 +1,67 @@ +import { diff } from 'jest-diff'; +import defaultPrinter from 'pretty-format'; +import * as NodeSerializer from './serializers/Node'; +import * as StringSerializer from './serializers/string'; + +function identity(value: T): T { + return value; +} + +function diffStrings( + valueA: unknown, + valueB: unknown, + valueAName: string, + valueBName: string, +): string | null { + return diff(valueA, valueB, { + expand: false, + // we want to show the entire file in the diff + // that way you don't have to try and figure out what lines map to which sections + contextLines: Number.MAX_SAFE_INTEGER, + aAnnotation: valueAName, + bAnnotation: valueBName, + aColor: identity, + bColor: identity, + changeColor: identity, + commonColor: identity, + patchColor: identity, + }); +} + +export function snapshotDiff( + valueAName: string, + valueA: unknown, + valueBName: string, + valueB: unknown, +): string { + const OPTIONS = { + plugins: [ + NodeSerializer.serializer, + // by default jest will quote the string with double quotes + // this means the diff string will have double quotes escaped and look ugly + // this is a single-quote string serializer which won't clash with the outer double quotes + // so we get a nicer looking diff because of it! + StringSerializer.serializer, + ], + }; + + const difference = diffStrings( + defaultPrinter(valueA, OPTIONS), + defaultPrinter(valueB, OPTIONS), + valueAName, + valueBName, + ); + + if (difference == null) { + throw new Error('Unexpected null when diffing snapshots.'); + } + + return 'Snapshot Diff:\n' + difference; +} + +// https://github.com/facebook/jest/blob/a293b75310cfc209713df1d34d243eb258995316/packages/jest-diff/src/constants.ts#L8 +const NO_DIFF_MESSAGE = 'Compared values have no visual difference.'; + +export function diffHasChanges(diff: string): boolean { + return !diff.includes(NO_DIFF_MESSAGE); +} diff --git a/packages/ast-spec/tests/util/typescript-estree-import.ts b/packages/ast-spec/tests/util/typescript-estree-import.ts new file mode 100644 index 00000000000..e15291de4fd --- /dev/null +++ b/packages/ast-spec/tests/util/typescript-estree-import.ts @@ -0,0 +1,17 @@ +/** + * Nx is picking up on the fact that we technically have a circular dependency between ast-spec + * and typescript-estree. + * + * This circular dependency only occurs in the tests/ for ast-spec and not in the main package source. + * + * We could therefore solve this by separating the ast-spec tests out into their own package, but the + * other option is to get Nx to turn a blind eye to the circular dependency by doing the following: + * + * - Removing @typescript-eslint/typescript-estree as an explicit devDependency in the package.json + * - Add an `.nxignore` file at the root of the monorepo which ignores this file (which we then in turn + * ensure is the only place we directly import from the @typescript-eslint/typescript-estree package). + */ + +// We need to ignore this lint error regarding it being missing from the package.json, see above. +// eslint-disable-next-line import/no-extraneous-dependencies +export { parse, TSESTree } from '@typescript-eslint/typescript-estree'; diff --git a/packages/ast-spec/tsconfig.build.json b/packages/ast-spec/tsconfig.build.json index 215a0282df2..89b0284199a 100644 --- a/packages/ast-spec/tsconfig.build.json +++ b/packages/ast-spec/tsconfig.build.json @@ -6,5 +6,6 @@ "rootDir": "./src", "resolveJsonModule": true }, - "include": ["src", "typings"] + "include": ["src", "typings"], + "exclude": ["**/fixtures/**"] } diff --git a/packages/ast-spec/tsconfig.json b/packages/ast-spec/tsconfig.json index 4b76ef4253b..fd3827cd5ba 100644 --- a/packages/ast-spec/tsconfig.json +++ b/packages/ast-spec/tsconfig.json @@ -4,5 +4,7 @@ "composite": false, "rootDir": "." }, - "include": ["src", "typings", "tests", "tools", "./rollup.config.ts"] + "include": ["src", "typings", "tests", "tools", "./rollup.config.ts"], + "exclude": ["**/fixtures/**"], + "references": [{ "path": "../typescript-estree/tsconfig.build.json" }] } diff --git a/packages/ast-spec/typings/babel-eslint-parser.d.ts b/packages/ast-spec/typings/babel-eslint-parser.d.ts new file mode 100644 index 00000000000..a18a6597a94 --- /dev/null +++ b/packages/ast-spec/typings/babel-eslint-parser.d.ts @@ -0,0 +1,24 @@ +declare module '@babel/eslint-parser' { + import type { TransformOptions } from '@babel/core'; + + export type { ParserPlugin } from '@babel/parser'; + + export interface Options { + readonly allowImportExportEverywhere?: boolean; + readonly babelOptions?: TransformOptions; + readonly ecmaFeatures?: { + readonly globalReturn?: boolean; + }; + readonly requireConfigFile?: boolean; + readonly sourceType?: string; + } + + export interface BabelAST { + readonly tokens: unknown; + readonly comments: unknown; + readonly [k: string]: unknown; + } + + export function parse(code: string, options: Options): BabelAST; + // export function parseForESLint(code: string, options: Options): unknown; +} diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index d68aab94b24..5a4f6423fda 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -30,6 +30,7 @@ "scripts": { "build": "cd ../../ && nx build @typescript-eslint/scope-manager", "clean": "cd ../../ && nx clean @typescript-eslint/scope-manager", + "clean-fixtures": "cd ../../ && nx clean-fixtures @typescript-eslint/scope-manager", "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", "generate:lib": "cd ../../ && nx generate-lib @typescript-eslint/scope-manager", "lint": "cd ../../ && nx lint @typescript-eslint/scope-manager", diff --git a/packages/scope-manager/project.json b/packages/scope-manager/project.json index 71a628c64aa..f60c2fd75a9 100644 --- a/packages/scope-manager/project.json +++ b/packages/scope-manager/project.json @@ -43,6 +43,16 @@ ] } }, + "clean-fixtures": { + "executor": "@nrwl/workspace:run-commands", + "options": { + "parallel": false, + "cwd": "packages/scope-manager", + "commands": [ + "rimraf -g \"./src/**/fixtures/**/snapshots\"" + ] + } + }, "lint": { "executor": "@nrwl/linter:eslint", "outputs": ["{options.outputFile}"], diff --git a/packages/scope-manager/tests/fixtures.test.ts b/packages/scope-manager/tests/fixtures.test.ts index b504710c4cf..f029367ba06 100644 --- a/packages/scope-manager/tests/fixtures.test.ts +++ b/packages/scope-manager/tests/fixtures.test.ts @@ -185,7 +185,7 @@ if (ONLY === '') { describe('ast snapshots should have an associated test', () => { for (const snap of snapshots) { it(snap.relative, () => { - fs.existsSync(snap.fixturePath); + expect(fs.existsSync(snap.fixturePath)).toBeTruthy(); }); } }); diff --git a/packages/types/tools/copy-ast-spec.ts b/packages/types/tools/copy-ast-spec.ts index bd1a0b1120c..faaae4b1579 100644 --- a/packages/types/tools/copy-ast-spec.ts +++ b/packages/types/tools/copy-ast-spec.ts @@ -1,11 +1,39 @@ -import chlidProcess from 'child_process'; +import childProcess from 'child_process'; import fs from 'fs'; import path from 'path'; import { promisify } from 'util'; const readFile = promisify(fs.readFile); const writeFile = promisify(fs.writeFile); -const execAsync = promisify(chlidProcess.exec); + +// the promisify util will eat the stderr logs +async function execAsync( + command: string, + args: ReadonlyArray, + options: childProcess.SpawnOptions, +): Promise { + return new Promise((resolve, reject) => { + const child = childProcess.spawn(command, args, { + ...options, + stdio: 'inherit', + }); + + child.on('error', e => reject(e)); + child.on('exit', () => resolve()); + child.on('close', () => resolve()); + + // (error, stdout, stderr) => { + // if (error) { + // console.error(stderr); + // reject(error); + // return; + // } + + // // console.log(stdout); + // resolve(); + // }, + }); +} const AST_SPEC_PATH = path.resolve(__dirname, '../../ast-spec'); const OUTPUT_PATH = path.join(path.resolve(__dirname, '../src/generated')); @@ -43,12 +71,15 @@ async function copyFile( encoding: 'utf-8', }); - await execAsync(`yarn prettier --write ${outpath}`); + await execAsync('yarn', ['prettier', '--write', outpath], {}); console.log('Copied', fileName); } async function main(): Promise { + // ensure the package is built + await execAsync('yarn', ['build'], { cwd: AST_SPEC_PATH }); + await Promise.all([ copyFile('dist', 'ast-spec.ts', code => code.replace(/export declare enum/g, 'export enum'), diff --git a/packages/visitor-keys/tests/visitor-keys.test.ts b/packages/visitor-keys/tests/visitor-keys.test.ts index a6fe66bc540..ca727a5de33 100644 --- a/packages/visitor-keys/tests/visitor-keys.test.ts +++ b/packages/visitor-keys/tests/visitor-keys.test.ts @@ -20,6 +20,11 @@ const IGNORED_KEYS = new Set([ describe('Every visitor key should have an ast node type defined', () => { for (const key of keys) { if (IGNORED_KEYS.has(key)) { + if (types.has(key)) { + it(`${key} should not be ignored as it has an AST_NODE_TYPE defined`, () => { + expect(true).toBeFalsy(); + }); + } continue; } diff --git a/yarn.lock b/yarn.lock index f4ac198c685..e9cb790e17a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -137,18 +137,46 @@ dependencies: "@jridgewell/trace-mapping" "^0.3.0" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.0", "@babel/code-frame@^7.16.7", "@babel/code-frame@^7.8.3": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.14.5": + version "7.15.8" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.15.8.tgz#45990c47adadb00c03677baa89221f7cc23d2503" + integrity sha512-2IAnmn8zbvC/jKYhq5Ki9I+DwjlrtMPUCH/CpHvqI4dNnlwHwsxoIhlc8WcYY5LSYknXQtAlFYuHfqAFCvQ4Wg== + dependencies: + "@babel/highlight" "^7.14.5" + +"@babel/code-frame@^7.10.4", "@babel/code-frame@^7.16.0", "@babel/code-frame@^7.16.7", "@babel/code-frame@^7.8.3": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== dependencies: "@babel/highlight" "^7.16.7" -"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.16.8", "@babel/compat-data@^7.17.0", "@babel/compat-data@^7.17.7": +"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.15.0", "@babel/compat-data@^7.16.8", "@babel/compat-data@^7.17.0", "@babel/compat-data@^7.17.7": version "7.17.7" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.7.tgz#078d8b833fbbcc95286613be8c716cef2b519fa2" integrity sha512-p8pdE6j0a29TNGebNm7NzYZWB3xVZJBZ7XGs42uAKzQo8VQ3F0By/cQCtUEABwIqw5zo6WA4NbmxsfzADzMKnQ== +"@babel/core@*", "@babel/core@^7.1.0", "@babel/core@^7.7.2", "@babel/core@^7.7.5": + version "7.14.3" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.14.3.tgz#5395e30405f0776067fbd9cf0884f15bfb770a38" + integrity sha512-jB5AmTKOCSJIZ72sd78ECEhuPiDMKlQdDI/4QRI6lzYATx5SSogS1oQA2AoPecRCknm30gHi2l+QVvNUu3wZAg== + dependencies: + "@babel/code-frame" "^7.12.13" + "@babel/generator" "^7.14.3" + "@babel/helper-compilation-targets" "^7.13.16" + "@babel/helper-module-transforms" "^7.14.2" + "@babel/helpers" "^7.14.0" + "@babel/parser" "^7.14.3" + "@babel/template" "^7.12.13" + "@babel/traverse" "^7.14.2" + "@babel/types" "^7.14.2" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.1.2" + semver "^6.3.0" + source-map "^0.5.0" + "@babel/core@7.12.9": version "7.12.9" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.12.9.tgz#fd450c4ec10cdbb980e2928b7aa7a28484593fc8" @@ -171,7 +199,7 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.15.5", "@babel/core@^7.17.8", "@babel/core@^7.7.2", "@babel/core@^7.7.5", "@babel/core@^7.8.0": +"@babel/core@^7.12.3", "@babel/core@^7.15.5", "@babel/core@^7.17.8", "@babel/core@^7.8.0": version "7.17.8" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.8.tgz#3dac27c190ebc3a4381110d46c80e77efe172e1a" integrity sha512-OdQDV/7cRBtJHLSOBqqbYNkOcydOgnX59TZx4puf41fzcVtN3e/4yqY8lMQsK+5X2lJtAdmA+6OHqsj1hBJ4IQ== @@ -192,7 +220,16 @@ json5 "^2.1.2" semver "^6.3.0" -"@babel/generator@^7.12.5", "@babel/generator@^7.17.3", "@babel/generator@^7.17.7", "@babel/generator@^7.7.2": +"@babel/eslint-parser@*", "@babel/eslint-parser@^7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.15.4.tgz#46385943726291fb3e8db99522c8099b15684387" + integrity sha512-hPMIAmGNbmQzXJIo2P43Zj9UhRmGev5f9nqdBFOWNGDGh6XKmjby79woBvg6y0Jur6yRfQBneDbUQ8ZVc1krFw== + dependencies: + eslint-scope "^5.1.1" + eslint-visitor-keys "^2.1.0" + semver "^6.3.0" + +"@babel/generator@^7.12.5", "@babel/generator@^7.17.3", "@babel/generator@^7.17.7": version "7.17.7" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.7.tgz#8da2599beb4a86194a3b24df6c085931d9ee45ad" integrity sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w== @@ -201,6 +238,24 @@ jsesc "^2.5.1" source-map "^0.5.0" +"@babel/generator@^7.14.3", "@babel/generator@^7.15.4", "@babel/generator@^7.7.2": + version "7.15.8" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.8.tgz#fa56be6b596952ceb231048cf84ee499a19c0cd1" + integrity sha512-ECmAKstXbp1cvpTTZciZCgfOt6iN64lR0d+euv3UZisU5awfRawOvg07Utn/qBGuH4bRIEZKrA/4LzZyXhZr8g== + dependencies: + "@babel/types" "^7.15.6" + jsesc "^2.5.1" + source-map "^0.5.0" + +"@babel/generator@^7.17.9": + version "7.17.9" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.9.tgz#f4af9fd38fa8de143c29fce3f71852406fc1e2fc" + integrity sha512-rAdDousTwxbIxbz5I7GEQ3lUip+xVCXooZNbsydCWs3xA7ZsYOv+CFRdzGxRX78BmQHu9B1Eso59AOZQOJDEdQ== + dependencies: + "@babel/types" "^7.17.0" + jsesc "^2.5.1" + source-map "^0.5.0" + "@babel/helper-annotate-as-pure@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.7.tgz#bb2339a7534a9c128e3102024c60760a3a7f3862" @@ -226,6 +281,16 @@ browserslist "^4.17.5" semver "^6.3.0" +"@babel/helper-compilation-targets@^7.13.16": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz#cf6d94f30fbefc139123e27dd6b02f65aeedb7b9" + integrity sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ== + dependencies: + "@babel/compat-data" "^7.15.0" + "@babel/helper-validator-option" "^7.14.5" + browserslist "^4.16.6" + semver "^6.3.0" + "@babel/helper-create-class-features-plugin@^7.16.10", "@babel/helper-create-class-features-plugin@^7.16.7", "@babel/helper-create-class-features-plugin@^7.17.6": version "7.17.6" resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.17.6.tgz#3778c1ed09a7f3e65e6d6e0f6fbfcc53809d92c9" @@ -275,6 +340,14 @@ dependencies: "@babel/types" "^7.16.7" +"@babel/helper-function-name@^7.15.4", "@babel/helper-function-name@^7.17.9": + version "7.17.9" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz#136fcd54bc1da82fcb47565cf16fd8e444b1ff12" + integrity sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg== + dependencies: + "@babel/template" "^7.16.7" + "@babel/types" "^7.17.0" + "@babel/helper-function-name@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz#f1ec51551fb1c8956bc8dd95f38523b6cf375f8f" @@ -291,7 +364,7 @@ dependencies: "@babel/types" "^7.16.7" -"@babel/helper-hoist-variables@^7.16.7": +"@babel/helper-hoist-variables@^7.15.4", "@babel/helper-hoist-variables@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz#86bcb19a77a509c7b77d0e22323ef588fa58c246" integrity sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg== @@ -305,7 +378,7 @@ dependencies: "@babel/types" "^7.17.0" -"@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.16.7": +"@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.15.4", "@babel/helper-module-imports@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz#25612a8091a999704461c8a222d0efec5d091437" integrity sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg== @@ -326,6 +399,20 @@ "@babel/traverse" "^7.17.3" "@babel/types" "^7.17.0" +"@babel/helper-module-transforms@^7.14.2": + version "7.15.8" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.8.tgz#d8c0e75a87a52e374a8f25f855174786a09498b2" + integrity sha512-DfAfA6PfpG8t4S6npwzLvTUpp0sS7JrcuaMiy1Y5645laRJIp/LiLGIBbQKaXSInK8tiGNI7FL7L8UvB8gdUZg== + dependencies: + "@babel/helper-module-imports" "^7.15.4" + "@babel/helper-replace-supers" "^7.15.4" + "@babel/helper-simple-access" "^7.15.4" + "@babel/helper-split-export-declaration" "^7.15.4" + "@babel/helper-validator-identifier" "^7.15.7" + "@babel/template" "^7.15.4" + "@babel/traverse" "^7.15.4" + "@babel/types" "^7.15.6" + "@babel/helper-optimise-call-expression@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.7.tgz#a34e3560605abbd31a18546bd2aad3e6d9a174f2" @@ -352,7 +439,7 @@ "@babel/helper-wrap-function" "^7.16.8" "@babel/types" "^7.16.8" -"@babel/helper-replace-supers@^7.16.7": +"@babel/helper-replace-supers@^7.15.4", "@babel/helper-replace-supers@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.16.7.tgz#e9f5f5f32ac90429c1a4bdec0f231ef0c2838ab1" integrity sha512-y9vsWilTNaVnVh6xiJfABzsNpgDPKev9HnAgz6Gb1p6UUwf9NepdlsV7VXGCftJM+jqD5f7JIEubcpLjZj5dBw== @@ -363,7 +450,7 @@ "@babel/traverse" "^7.16.7" "@babel/types" "^7.16.7" -"@babel/helper-simple-access@^7.17.7": +"@babel/helper-simple-access@^7.15.4", "@babel/helper-simple-access@^7.17.7": version "7.17.7" resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz#aaa473de92b7987c6dfa7ce9a7d9674724823367" integrity sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA== @@ -377,19 +464,19 @@ dependencies: "@babel/types" "^7.16.0" -"@babel/helper-split-export-declaration@^7.16.7": +"@babel/helper-split-export-declaration@^7.15.4", "@babel/helper-split-export-declaration@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz#0b648c0c42da9d3920d85ad585f2778620b8726b" integrity sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw== dependencies: "@babel/types" "^7.16.7" -"@babel/helper-validator-identifier@^7.16.7": +"@babel/helper-validator-identifier@^7.14.9", "@babel/helper-validator-identifier@^7.15.7", "@babel/helper-validator-identifier@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad" integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw== -"@babel/helper-validator-option@^7.16.7": +"@babel/helper-validator-option@^7.14.5", "@babel/helper-validator-option@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23" integrity sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ== @@ -413,6 +500,24 @@ "@babel/traverse" "^7.17.3" "@babel/types" "^7.17.0" +"@babel/helpers@^7.14.0": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.15.4.tgz#5f40f02050a3027121a3cf48d497c05c555eaf43" + integrity sha512-V45u6dqEJ3w2rlryYYXf6i9rQ5YMNu4FLS6ngs8ikblhu2VdR1AqAd6aJjBzmf2Qzh6KOLqKHxEN9+TFbAkAVQ== + dependencies: + "@babel/template" "^7.15.4" + "@babel/traverse" "^7.15.4" + "@babel/types" "^7.15.4" + +"@babel/highlight@^7.14.5": + version "7.17.9" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.17.9.tgz#61b2ee7f32ea0454612def4fccdae0de232b73e3" + integrity sha512-J9PfEKCbFIv2X5bjTMiZu6Vf341N05QIY+d6FvVKynkG1S7G0j3I0QoRtWIrXhZ+/Nlb5Q0MzqL7TokEJ5BNHg== + dependencies: + "@babel/helper-validator-identifier" "^7.16.7" + chalk "^2.0.0" + js-tokens "^4.0.0" + "@babel/highlight@^7.16.7": version "7.16.10" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.10.tgz#744f2eb81579d6eea753c227b0f570ad785aba88" @@ -422,11 +527,21 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.12.7", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.17.3", "@babel/parser@^7.17.8": +"@babel/parser@*", "@babel/parser@^7.1.0", "@babel/parser@^7.14.3", "@babel/parser@^7.15.4", "@babel/parser@^7.15.7": + version "7.15.8" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.8.tgz#7bacdcbe71bdc3ff936d510c15dcea7cf0b99016" + integrity sha512-BRYa3wcQnjS/nqI8Ac94pYYpJfojHVvVXJ97+IDCImX4Jc8W8Xv1+47enbruk+q1etOpsQNwnfFcNGw+gtPGxA== + +"@babel/parser@^7.12.7", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.17.3", "@babel/parser@^7.17.8": version "7.17.8" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.8.tgz#2817fb9d885dd8132ea0f8eb615a6388cca1c240" integrity sha512-BoHhDJrJXqcg+ZL16Xv39H9n+AqJ4pcDrQBGZN+wHxIysrLZ3/ECwCBUch/1zUNhnsXULcONU3Ei5Hmkfk6kiQ== +"@babel/parser@^7.17.9", "@babel/parser@^7.7.2": + version "7.17.9" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.9.tgz#9c94189a6062f0291418ca021077983058e171ef" + integrity sha512-vqUSBLP8dQHFPdPi9bc5GK9vRkYHJ49fsZdtoJ8EQ8ibpwk5rPKfvNIwChB0KVXcIjcepEBBd2VHC5r9Gy8ueg== + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.7.tgz#4eda6d6c2a0aa79c70fa7b6da67763dfe2141050" @@ -1151,7 +1266,16 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.12.7", "@babel/template@^7.16.7", "@babel/template@^7.3.3": +"@babel/template@^7.12.13", "@babel/template@^7.3.3": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.15.4.tgz#51898d35dcf3faa670c4ee6afcfd517ee139f194" + integrity sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg== + dependencies: + "@babel/code-frame" "^7.14.5" + "@babel/parser" "^7.15.4" + "@babel/types" "^7.15.4" + +"@babel/template@^7.12.7", "@babel/template@^7.15.4", "@babel/template@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.7.tgz#8d126c8701fde4d66b264b3eba3d96f07666d155" integrity sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w== @@ -1160,7 +1284,7 @@ "@babel/parser" "^7.16.7" "@babel/types" "^7.16.7" -"@babel/traverse@^7.12.9", "@babel/traverse@^7.13.0", "@babel/traverse@^7.16.7", "@babel/traverse@^7.16.8", "@babel/traverse@^7.17.3", "@babel/traverse@^7.7.2": +"@babel/traverse@^7.12.9", "@babel/traverse@^7.13.0", "@babel/traverse@^7.16.7", "@babel/traverse@^7.16.8", "@babel/traverse@^7.17.3": version "7.17.3" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.3.tgz#0ae0f15b27d9a92ba1f2263358ea7c4e7db47b57" integrity sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw== @@ -1176,7 +1300,46 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.12.7", "@babel/types@^7.15.6", "@babel/types@^7.16.0", "@babel/types@^7.16.7", "@babel/types@^7.16.8", "@babel/types@^7.17.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": +"@babel/traverse@^7.14.2", "@babel/traverse@^7.7.2": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.15.4.tgz#ff8510367a144bfbff552d9e18e28f3e2889c22d" + integrity sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA== + dependencies: + "@babel/code-frame" "^7.14.5" + "@babel/generator" "^7.15.4" + "@babel/helper-function-name" "^7.15.4" + "@babel/helper-hoist-variables" "^7.15.4" + "@babel/helper-split-export-declaration" "^7.15.4" + "@babel/parser" "^7.15.4" + "@babel/types" "^7.15.4" + debug "^4.1.0" + globals "^11.1.0" + +"@babel/traverse@^7.15.4": + version "7.17.9" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.9.tgz#1f9b207435d9ae4a8ed6998b2b82300d83c37a0d" + integrity sha512-PQO8sDIJ8SIwipTPiR71kJQCKQYB5NGImbOviK8K+kg5xkNSYXLBupuX9QhatFowrsvo9Hj8WgArg3W7ijNAQw== + dependencies: + "@babel/code-frame" "^7.16.7" + "@babel/generator" "^7.17.9" + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-function-name" "^7.17.9" + "@babel/helper-hoist-variables" "^7.16.7" + "@babel/helper-split-export-declaration" "^7.16.7" + "@babel/parser" "^7.17.9" + "@babel/types" "^7.17.0" + debug "^4.1.0" + globals "^11.1.0" + +"@babel/types@^7.0.0", "@babel/types@^7.14.2", "@babel/types@^7.15.4", "@babel/types@^7.15.6", "@babel/types@^7.3.0", "@babel/types@^7.3.3": + version "7.15.6" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.6.tgz#99abdc48218b2881c058dd0a7ab05b99c9be758f" + integrity sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig== + dependencies: + "@babel/helper-validator-identifier" "^7.14.9" + to-fast-properties "^2.0.0" + +"@babel/types@^7.12.7", "@babel/types@^7.16.0", "@babel/types@^7.16.7", "@babel/types@^7.16.8", "@babel/types@^7.17.0", "@babel/types@^7.4.4": version "7.17.0" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.17.0.tgz#a826e368bccb6b3d84acd76acad5c0d87342390b" integrity sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw== @@ -2204,7 +2367,28 @@ jest-haste-map "^27.5.1" jest-runtime "^27.5.1" -"@jest/transform@^27.2.2", "@jest/transform@^27.5.1": +"@jest/transform@^27.2.2": + version "27.3.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.3.1.tgz#ff80eafbeabe811e9025e4b6f452126718455220" + integrity sha512-3fSvQ02kuvjOI1C1ssqMVBKJpZf6nwoCiSu00zAKh5nrp3SptNtZy/8s5deayHnqxhjD9CWDJ+yqQwuQ0ZafXQ== + dependencies: + "@babel/core" "^7.1.0" + "@jest/types" "^27.2.5" + babel-plugin-istanbul "^6.0.0" + chalk "^4.0.0" + convert-source-map "^1.4.0" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.2.4" + jest-haste-map "^27.3.1" + jest-regex-util "^27.0.6" + jest-util "^27.3.1" + micromatch "^4.0.4" + pirates "^4.0.1" + slash "^3.0.0" + source-map "^0.6.1" + write-file-atomic "^3.0.0" + +"@jest/transform@^27.3.1", "@jest/transform@^27.5.1": version "27.5.1" resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-27.5.1.tgz#6c3501dcc00c4c08915f292a600ece5ecfe1f409" integrity sha512-ipON6WtYgl/1329g5AIJVbUuEh0wZVbdpGwC99Jw4LwuoBNS95MVphU6zOeD9pDkon+LLbFL7lOQRapbB8SCHw== @@ -2225,7 +2409,18 @@ source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/types@^27.1.1", "@jest/types@^27.5.1": +"@jest/types@^27.1.1": + version "27.2.5" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.5.tgz#420765c052605e75686982d24b061b4cbba22132" + integrity sha512-nmuM4VuDtCZcY+eTpw+0nvstwReMsjPoj7ZR80/BbixulhLaiX+fbv8oeLW8WZlJMcsGQsTmMKT/iTZu1Uy/lQ== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^16.0.0" + chalk "^4.0.0" + +"@jest/types@^27.2.5", "@jest/types@^27.5.1": version "27.5.1" resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.5.1.tgz#3c79ec4a8ba61c170bf937bcf9e98a9df175ec80" integrity sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw== @@ -3727,10 +3922,10 @@ resolved "https://registry.yarnpkg.com/@types/babel__code-frame/-/babel__code-frame-7.0.3.tgz#eda94e1b7c9326700a4b69c485ebbc9498a0b63f" integrity sha512-2TN6oiwtNjOezilFVl77zwdNPwQWaDBBCCWWxyo1ctiO3vAtd7H/aB/CBJdw9+kqq3+latD0SXoedIuHySSZWw== -"@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": - version "7.1.16" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.16.tgz#bc12c74b7d65e82d29876b5d0baf5c625ac58702" - integrity sha512-EAEHtisTMM+KaKwfWdC3oyllIqswlznXCIVCt7/oRNrh+DhgT4UEBNC/jlADNjvw7UnfbcdkGQcPVZ1xYiLcrQ== +"@types/babel__core@*", "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.14": + version "7.1.14" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.14.tgz#faaeefc4185ec71c389f4501ee5ec84b170cc402" + integrity sha512-zGZJzzBUVDo/eV6KgbE0f0ZI7dInEYvo12Rb70uNQDshC3SkRMb67ja0GgRHZgAX3Za6rhaWlvbDO8rrGyAb1g== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" @@ -4836,7 +5031,7 @@ babel-plugin-extract-import-names@1.6.22: dependencies: "@babel/helper-plugin-utils" "7.10.4" -babel-plugin-istanbul@^6.1.1: +babel-plugin-istanbul@^6.0.0, babel-plugin-istanbul@^6.1.1: version "6.1.1" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== @@ -6573,7 +6768,7 @@ didyoumean@^1.2.1: resolved "https://registry.yarnpkg.com/didyoumean/-/didyoumean-1.2.2.tgz#989346ffe9e839b4555ecf5666edea0d3e8ad037" integrity sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw== -diff-sequences@^27.5.1: +diff-sequences@^27.0.6, diff-sequences@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.5.1.tgz#eaecc0d327fd68c8d9672a1e64ab8dccb2ef5327" integrity sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ== @@ -7105,7 +7300,7 @@ eslint-utils@^3.0.0: dependencies: eslint-visitor-keys "^2.0.0" -eslint-visitor-keys@^2.0.0: +eslint-visitor-keys@^2.0.0, eslint-visitor-keys@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== @@ -7291,7 +7486,7 @@ expand-tilde@^2.0.0, expand-tilde@^2.0.2: dependencies: homedir-polyfill "^1.0.1" -expect@^27.5.1: +expect@^27.3.1, expect@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/expect/-/expect-27.5.1.tgz#83ce59f1e5bdf5f9d2b94b61d2050db48f3fef74" integrity sha512-E1q5hSUG2AmYQwQJ041nvgpkODHQvB+RKlB4IYdru6uJsyFTRyZAP463M+1lINorwbqAmUggi6+WwkD8lCS/Dw== @@ -9317,6 +9512,16 @@ jest-config@^27.5.1: slash "^3.0.0" strip-json-comments "^3.1.1" +jest-diff@*, jest-diff@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.3.1.tgz#d2775fea15411f5f5aeda2a5e02c2f36440f6d55" + integrity sha512-PCeuAH4AWUo2O5+ksW4pL9v5xJAcIKPUPfIhZBcG1RKv/0+dvaWTQK1Nrau8d67dp65fOqbeMdoil+6PedyEPQ== + dependencies: + chalk "^4.0.0" + diff-sequences "^27.0.6" + jest-get-type "^27.3.1" + pretty-format "^27.3.1" + jest-diff@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.5.1.tgz#a07f5011ac9e6643cf8a95a462b7b1ecf6680def" @@ -9370,12 +9575,37 @@ jest-environment-node@^27.2.2, jest-environment-node@^27.5.1: jest-mock "^27.5.1" jest-util "^27.5.1" -jest-get-type@^27.0.6, jest-get-type@^27.5.1: +jest-get-type@^27.0.6: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.3.1.tgz#a8a2b0a12b50169773099eee60a0e6dd11423eff" + integrity sha512-+Ilqi8hgHSAdhlQ3s12CAVNd8H96ZkQBfYoXmArzZnOfAtVAJEiPDBirjByEblvG/4LPJmkL+nBqPO3A1YJAEg== + +jest-get-type@^27.3.1, jest-get-type@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.5.1.tgz#3cd613c507b0f7ace013df407a1c1cd578bcb4f1" integrity sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw== -jest-haste-map@^27.2.2, jest-haste-map@^27.5.1: +jest-haste-map@^27.2.2: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.3.1.tgz#7656fbd64bf48bda904e759fc9d93e2c807353ee" + integrity sha512-lYfNZIzwPccDJZIyk9Iz5iQMM/MH56NIIcGj7AFU1YyA4ewWFBl8z+YPJuSCRML/ee2cCt2y3W4K3VXPT6Nhzg== + dependencies: + "@jest/types" "^27.2.5" + "@types/graceful-fs" "^4.1.2" + "@types/node" "*" + anymatch "^3.0.3" + fb-watchman "^2.0.0" + graceful-fs "^4.2.4" + jest-regex-util "^27.0.6" + jest-serializer "^27.0.6" + jest-util "^27.3.1" + jest-worker "^27.3.1" + micromatch "^4.0.4" + walker "^1.0.7" + optionalDependencies: + fsevents "^2.3.2" + +jest-haste-map@^27.3.1, jest-haste-map@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.5.1.tgz#9fd8bd7e7b4fa502d9c6164c5640512b4e811e7f" integrity sha512-7GgkZ4Fw4NFbMSDSpZwXeBiIbx+t/46nJ2QitkOjvwPYyZmqttu2TDSimMHP1EkPOi4xUZAN1doE5Vd25H4Jng== @@ -9426,7 +9656,7 @@ jest-leak-detector@^27.5.1: jest-get-type "^27.5.1" pretty-format "^27.5.1" -jest-matcher-utils@^27.0.0, jest-matcher-utils@^27.5.1: +jest-matcher-utils@^27.0.0, jest-matcher-utils@^27.3.1, jest-matcher-utils@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz#9c0cdbda8245bc22d2331729d1091308b40cf8ab" integrity sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw== @@ -9436,7 +9666,7 @@ jest-matcher-utils@^27.0.0, jest-matcher-utils@^27.5.1: jest-get-type "^27.5.1" pretty-format "^27.5.1" -jest-message-util@^27.5.1: +jest-message-util@^27.3.1, jest-message-util@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.5.1.tgz#bdda72806da10d9ed6425e12afff38cd1458b6cf" integrity sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g== @@ -9494,7 +9724,23 @@ jest-resolve@27.2.2: resolve "^1.20.0" slash "^3.0.0" -jest-resolve@^27.2.2, jest-resolve@^27.5.1: +jest-resolve@^27.2.2: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.3.1.tgz#0e5542172a1aa0270be6f66a65888647bdd74a3e" + integrity sha512-Dfzt25CFSPo3Y3GCbxynRBZzxq9AdyNN+x/v2IqYx6KVT5Z6me2Z/PsSGFSv3cOSUZqJ9pHxilao/I/m9FouLw== + dependencies: + "@jest/types" "^27.2.5" + chalk "^4.0.0" + graceful-fs "^4.2.4" + jest-haste-map "^27.3.1" + jest-pnp-resolver "^1.2.2" + jest-util "^27.3.1" + jest-validate "^27.3.1" + resolve "^1.20.0" + resolve.exports "^1.1.0" + slash "^3.0.0" + +jest-resolve@^27.3.1, jest-resolve@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-27.5.1.tgz#a2f1c5a0796ec18fe9eb1536ac3814c23617b384" integrity sha512-FFDy8/9E6CV83IMbDpcjOhumAQPDyETnU2KZ1O98DwTnz8AOBsW/Xv3GySr1mOZdItLR+zDZ7I/UdTFbgSOVCw== @@ -9565,7 +9811,7 @@ jest-runtime@^27.5.1: slash "^3.0.0" strip-bom "^4.0.0" -jest-serializer@^27.5.1: +jest-serializer@^27.0.6, jest-serializer@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-27.5.1.tgz#81438410a30ea66fd57ff730835123dea1fb1f64" integrity sha512-jZCyo6iIxO1aqUxpuBlwTDMkzOAJS4a3eYz3YzgxxVQFwLeSA7Jfq5cbqCY+JLvTDrWirgusI/0KwxKMgrdf7w== @@ -9573,7 +9819,37 @@ jest-serializer@^27.5.1: "@types/node" "*" graceful-fs "^4.2.9" -jest-snapshot@^27.0.2, jest-snapshot@^27.5.1: +jest-snapshot@*, jest-snapshot@^27.0.2, jest-snapshot@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.3.1.tgz#1da5c0712a252d70917d46c037054f5918c49ee4" + integrity sha512-APZyBvSgQgOT0XumwfFu7X3G5elj6TGhCBLbBdn3R1IzYustPGPE38F51dBWMQ8hRXa9je0vAdeVDtqHLvB6lg== + dependencies: + "@babel/core" "^7.7.2" + "@babel/generator" "^7.7.2" + "@babel/parser" "^7.7.2" + "@babel/plugin-syntax-typescript" "^7.7.2" + "@babel/traverse" "^7.7.2" + "@babel/types" "^7.0.0" + "@jest/transform" "^27.3.1" + "@jest/types" "^27.2.5" + "@types/babel__traverse" "^7.0.4" + "@types/prettier" "^2.1.5" + babel-preset-current-node-syntax "^1.0.0" + chalk "^4.0.0" + expect "^27.3.1" + graceful-fs "^4.2.4" + jest-diff "^27.3.1" + jest-get-type "^27.3.1" + jest-haste-map "^27.3.1" + jest-matcher-utils "^27.3.1" + jest-message-util "^27.3.1" + jest-resolve "^27.3.1" + jest-util "^27.3.1" + natural-compare "^1.4.0" + pretty-format "^27.3.1" + semver "^7.3.2" + +jest-snapshot@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-27.5.1.tgz#b668d50d23d38054a51b42c4039cab59ae6eb6a1" integrity sha512-yYykXI5a0I31xX67mgeLw1DZ0bJB+gpq5IpSuCAoyDi0+BhgU/RIrL+RTzDmkNTchvDFWKP8lp+w/42Z3us5sA== @@ -9620,7 +9896,19 @@ jest-util@27.2.0: is-ci "^3.0.0" picomatch "^2.2.3" -jest-util@^27.2.0, jest-util@^27.5.1: +jest-util@^27.2.0: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.3.1.tgz#a58cdc7b6c8a560caac9ed6bdfc4e4ff23f80429" + integrity sha512-8fg+ifEH3GDryLQf/eKZck1DEs2YuVPBCMOaHQxVVLmQwl/CDhWzrvChTX4efLZxGrw+AA0mSXv78cyytBt/uw== + dependencies: + "@jest/types" "^27.2.5" + "@types/node" "*" + chalk "^4.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.4" + picomatch "^2.2.3" + +jest-util@^27.3.1, jest-util@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.5.1.tgz#3ba9771e8e31a0b85da48fe0b0891fb86c01c2f9" integrity sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw== @@ -9632,7 +9920,7 @@ jest-util@^27.2.0, jest-util@^27.5.1: graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^27.2.2, jest-validate@^27.5.1: +jest-validate@^27.2.2, jest-validate@^27.3.1, jest-validate@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-27.5.1.tgz#9197d54dc0bdb52260b8db40b46ae668e04df067" integrity sha512-thkNli0LYTmOI1tDB3FI1S1RTp/Bqyd9pTarJwL87OIBFuqEb5Apv5EaApEudYg4g86e3CT6kM0RowkhtEnCBQ== @@ -9657,7 +9945,7 @@ jest-watcher@^27.5.1: jest-util "^27.5.1" string-length "^4.0.1" -jest-worker@^27.0.2, jest-worker@^27.2.2, jest-worker@^27.4.5, jest-worker@^27.5.1: +jest-worker@^27.0.2, jest-worker@^27.2.2, jest-worker@^27.3.1, jest-worker@^27.4.5, jest-worker@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" integrity sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg== @@ -11724,6 +12012,11 @@ pify@^5.0.0: resolved "https://registry.yarnpkg.com/pify/-/pify-5.0.0.tgz#1f5eca3f5e87ebec28cc6d54a0e4aaf00acc127f" integrity sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA== +pirates@^4.0.1: + version "4.0.5" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" + integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== + pirates@^4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.4.tgz#07df81e61028e402735cdd49db701e4885b4e6e6" @@ -12074,7 +12367,17 @@ pretty-error@^4.0.0: lodash "^4.17.20" renderkid "^3.0.0" -pretty-format@*, pretty-format@^27.0.0, pretty-format@^27.2.2, pretty-format@^27.3.1, pretty-format@^27.5.1: +pretty-format@*, pretty-format@^27.0.0, pretty-format@^27.2.2, pretty-format@^27.3.1: + version "27.3.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.3.1.tgz#7e9486365ccdd4a502061fa761d3ab9ca1b78df5" + integrity sha512-DR/c+pvFc52nLimLROYjnXPtolawm+uWDxr4FjuLDLUn+ktWnSN851KoHwHzzqq6rfCOjkzN8FLgDrSub6UDuA== + dependencies: + "@jest/types" "^27.2.5" + ansi-regex "^5.0.1" + ansi-styles "^5.0.0" + react-is "^17.0.1" + +pretty-format@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" integrity sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==